Difference between revisions of "Entity Component System"

From RogueBasin
Jump to navigation Jump to search
(Add link to systems architecture thing. Remove reference to Teratogen, a rewrite of it is upcoming and probably won't feature an ECS.)
Line 4: Line 4:


This makes it easy to have data-driven object construction and allows very diverse combinations of component loadouts in objects that still coexist in the same game world as the same fundamental type of program object.
This makes it easy to have data-driven object construction and allows very diverse combinations of component loadouts in objects that still coexist in the same game world as the same fundamental type of program object.
The [[Teratogen]] roguelike uses a simple component system.


== References ==
== References ==
Line 14: Line 12:


* [http://entity-systems.wikidot.com/ Entity Systems Project], an entity component system wiki
* [http://entity-systems.wikidot.com/ Entity Systems Project], an entity component system wiki
* [http://t-machine.org/index.php/2012/03/16/entity-systems-what-makes-good-components-good-entities/ Entity Systems: what makes good Components? good Entities?], a post describing an architecture that has both entity components and global system objects for the game state


[[Category:Developing]]
[[Category:Developing]]

Revision as of 19:48, 2 February 2013

An entity component system is a way to implement your game objects so that you can build their functionality through composition instead of object-oriented inheritance. The prevailing wisdom in current game development seems to be that complex games should have one of those instead of an inheritance-based object system that is likely to lead to unmaintainable blobs of a class. A roguelike is probably a complex enough game that you should use an entity component system in one.

The basic idea is that game objects at their core are just unique identifiers (UIDs), plain strings or integers, instead of complex objects. The complex data and functionality is moved into multiple components, which are stored in their own containers and associated with the object UIDs.

This makes it easy to have data-driven object construction and allows very diverse combinations of component loadouts in objects that still coexist in the same game world as the same fundamental type of program object.

References