Entity Systems are a great way to build up game objects, but a significant thought shift from traditional OOP inheritance trees. Simply getting started is one of the bigger challenges as well as being aware of, and avoiding, functionality creep into entity and component objects.
Much has been written on entity systems, although most of it is at a very high level overview of what they are. There are some examples in a few books, but I'm cheap. Browsing the net though, here's a quick list of some of the best examples and most helpful collections:
- Scott Bilas's 2002 GDC Presentation - From 2002, but still very relevant. He discusses the the advantages of entity systems (game objects as he calls them) and a few details of how they implemented them in Dungeon Siege.
- Adam Martin's series on ES - Parts 2, 3, and 5 are especially good foundation material. There's a lot to absorb here.
- Adam Martin again implements ES on Android - some create implementation details. Much more explained in the comments.
- Amit's Epic Game Programming Links - Here's where I got started into this. Also, he has a lot of other wonderful things.
Step 1
I plan on stepping away from OTD for a little while here. It has a ton of code behind it, a lot which has been sitting there for over a year without refactoring. I'm starting a much smaller project to focus on entity systems for a while as well as clean up some of my engine code.
Amoebal
Source code is up on BitBucket. It's still very, very early, but a decent foundation to build on. Further posts will detail the process of creating an entity system in XNA and C# as well as try to explain my reasoning behind a few things.
Questions to deal with
- How will lists of components be sent to systems? Big dictionaries?
- How will component types be cached and then pruned? Entities can register components on add
No comments:
Post a Comment