A Ruby port of Artemis (an high performance Entity System Framework for games)
This is a brief of artemis manual
The World instance is an easily accessible context to manage all your entities, retrieve systems, components and managers.
Entities correspond to game objects, e.g., trees, defenders, monsters...
Entity = unique UUID + a bunch of components associate with it.
Entity contains several methods, such as for adding or removing components, and for adding or deleting the entity itself from the world.
Entity class is NOT inheritable!
Components are pure data classes, they do not have any logic in them other than that for setting/getting its data, and perhaps some helper methods.
All component classes must inherits from
Example of components: position, physics, health, damage...
Aspects are used by the systems as a filter against entities, to figure out if an entity should be inserted into a system. They define the type of entities the system is interested in. Instead of thinking of systems processing entities, they rather process aspects of entities.
Example of aspect: entities contains 3 components (position, health, damage).
Entity Systems are meant to process certain aspects of entities (entities possessing certain components).
Example of entity systems: movement system, collision handling system, rendering system, attack system...
Component mappers provide a fast way to access entities’ components. Although you can retrieve components using the getComponent method of the Entity class, you should NOT do this while processing entities continuously, as using component mappers is a faster way of doing it.
Managers sit on the sidelines and help you manage and organize your entities. There are two primary managers that are core to Artemis, they are the
ComponentManager. All other managers are add-on or "custom" managers that can be added into your world instance.
Relationship between definitions
We can have many worlds in a game.
Each world has many entities, aspects, systems, managers.
Each entity has many components.
Each aspect filters entities by the components the entity has.
Each system processes aspects of entities.
Managers are used to manage entities & components.
- utils/Bag.java currently is ruby Hash
- utils/FastMath.java won't need
- utils/ImmutableBag.java currently is Bag
- utils/Timer.java won't need
- utils/TrigLUT.java won't need
- utils/Utils.java won't need