GECS 2.0.0 Scripts 4.0 Community
Submitted by user csprance; CC0; 2024-11-21
# GECS
> Godot Entity Component System
A lightweight, performant ECS framework for Godot 4.x that integrates seamlessly with Godot's node system.
## Features
- Full integration with Godot's node system
- Query-based entity filtering with optimized component indexing
- System groups for organized processing
- Component resources that work in the editor
- Easy setup with automatic node management
## Introduction
GECS is an Entity Component System (ECS) framework designed for the Godot Engine. It provides a simple yet powerful way to organize your game logic using the ECS pattern, allowing for better code organization, reusability, and scalability.
This documentation will guide you through the setup and usage of the GECS addon, providing examples from a sample game project to illustrate key concepts.
## Installation
1. **Download the Addon**: Clone or download the GECS addon and place it in your project's `addons` folder.
2. **Enable the Addon**: In the Godot editor, go to `Project > Project Settings > Plugins`, and enable the `GECS` plugin.
3. **Autoload ECS**: The addon requires the `ECS` singleton to be autoloaded. This should be handled automatically when you enable the plugin. If not, go to `Project > Project Settings > Autoload`, and add `ECS` pointing to `res://addons/gecs/ecs.gd`.
4. **Configure Entity Base Type**: GECS allows you to set the base type for entities. In `Project > Project Settings > GECS`, set `Entity Base Type` to `Node2D` or `Node3D` depending on your project's requirements.
## Getting Started
### Basic Concepts
> Each class has a full set of in-editor Godot documentation. Check there as well!
Before diving into the usage of the GECS addon, it's important to understand the basic concepts of an Entity Component System (ECS):
- **Entity**: A container or placeholder that represents an object in your game. Entities can have multiple components added to them to define their behavior and properties.
- **Component**: A data container that holds specific attributes or properties. Components do not contain game logic.
- **System**: A system contains the logic that operates on entities with specific components.
- **World**: The context in which entities and systems exist and interact.
- **Query**: A way to query for specific entities in the world based on the components they contain.
- **ECS Singleton**: Provides global access to the current `World` instance and offers utility functions for processing.
View files Download Submit an issue Recent Edits