Entity Component System

From RogueBasin
(Difference between revisions)
Jump to: navigation, search
(References)
(References)
Line 16: Line 16:
  
 
* [http://www.gamedev.net/page/resources/_/technical/game-programming/case-study-bomberman-mechanics-in-an-entity-component-system-r3159 Case Study: Bomberman Mechanics in an Entity-Component-System], a post on actually implementing a small ECS.
 
* [http://www.gamedev.net/page/resources/_/technical/game-programming/case-study-bomberman-mechanics-in-an-entity-component-system-r3159 Case Study: Bomberman Mechanics in an Entity-Component-System], a post on actually implementing a small ECS.
 +
 +
* [http://gameprogrammingpatterns.com/component.html Game Programming Patterns: Component], a straightforward explanation of component based architecture, along with example implementation.
  
 
[[Category:Developing]]
 
[[Category:Developing]]

Revision as of 17:52, 24 February 2014

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

Personal tools