Me and Spiegel (Tiago Costa) have been working for a few weeks on this framework. It’s meant to separate data, logic and view. It’s currently just experimental and is meant for review purposes only, use at your own risk.
It’s inspired by Adam Martin’s “Entity Systems are the future of MMORPG” articles published on http://t-machine.org/.
This framework requires different thinking when it comes to game programming. No longer are entities just self-contained objects, but consist of data/state components which are processed by systems/aspects.
Entity is an irrelevant object, it however still exists for design simplicity and convenience.
Components are attached to entities and they contain data or state for that entity. Imagine a components like Transform and Velocity.
Systems “process” certain “aspects” of entities. You can imagine one aspect being “Movement”, and you would create a MovementSystem which processes all entities containing the Transform and Velocity components.
Currently there are 3 types of systems you can extend from:
- EntitySystem: the very basic raw system, which simply allows you to handle the processing loop however you want.
- EntityProcessingSystem: used to process individual entities of a certain aspect sequentially. If you always need to process all entities use this.
- IntervalEntitySystem: a very basic and raw system but is only executed at certain intervals, e.g. it runs processing every 100 ms. This way you can tune your game better for performance.
This is a very fast system and offers a lot of flexibility, whilst keeping your code clean. It’s NOT dependent on any particular graphics library or any library, you can use this for your Java2D, Slick, or raw OpenGL games.
Click here for demo game, code and jars for everything:
Game demo: http://gamadu.com/games/starwarrior/
Artemis here: http://gamadu.com/artemis/
We’re looking for feedback, so please provide if you can.
Any questions? Please ask here.