
Dotity is an ECS framework for managing game entities and logic, offering performance optimization and clear separation of concerns for scalable projects.Dotity is an open-source Entity Component System (ECS) framework inspired by Entitas, designed for learning and contribution. It provides a structured way to manage game entities and their associated data and logic. The framework separates concerns into Components (data), Entities (ID and list of components), Matchers and Groups (managing entities based on component sets), and Systems (logic execution).The package offers two versions:Version 1: Components are reused, and entity changes trigger events for group updates. Systems operate in a defined order: InitializeSystem, ExecuteSystem, RenderSystem, and CleanUpSystem.Version 2: This version is more performant as it caches component references at the beginning of loops, reducing GetComponent calls, though it requires more manual management.While the provided content doesn't specify a particular genre, the ECS architecture itself is highly customizable and suitable for a wide range of game genres. Its focus on data-driven design and clear separation of concerns makes it adaptable for complex simulations, strategy games, action games, or any project where efficient entity management and performance are crucial. The modular nature of components and systems allows developers to define custom data structures and behaviors tailored to their specific game mechanics.https://github.com/lhminh120/DotityHere are the key features of the Dotity framework:Component-based Data Storage: Components are used to define and store data, which can include primitive types, strings, or even Unity Components. Destroyed components are recycled for reuse, improving performance.Entity Management: Entities are lightweight, containing only an ID and a list of components. Like components, destroyed entities are also reused. Adding or removing components triggers events to keep Groups updated.Matcher and Group System: Groups efficiently manage entities that share common component sets. Matchers are used to define these common characteristics, allowing for checks on component presence or absence, and can be combined for complex filtering.Structured System Execution: The framework provides a clear execution order for logic through different System types: InitializeSystem, ExecuteSystem, RenderSystem, and CleanUpSystem. This promotes organized game logic.Performance Optimization (Version 2): Dotity offers a second version that significantly improves performance by caching component references at the beginning of loops, reducing repetitive GetComponent calls during execution.Event-Driven Group Updates: When components are added to or removed from an entity, corresponding events are triggered, which help the Group system to maintain accurate membership of entities.Data Recycling: Both Components and Entities are not immediately destroyed but are instead placed into a reuse list, which helps in reducing garbage collection and improving performance.