A few years ago, entity systems (or component systems) were a hot topic. In particular, Scott Bilas gave a great GDC talk (http://scottbilas.com/files/2002/gdc_san_jose/game_objects_slides.pdf – updated link thanks to @junkdogAP) on using them in the development of Dungeon Siege. The main advantages to entity systems were:
- No programmer required for designers to modify game logic
- Circumvents the “impossible” problem of hard-coding all entity relationships at start of project
- Allows for easy implementation of game-design ideas that cross-cut traditional OOP objects
- Much faster compile/test/debug cycles
- Much more agile way to develop code
I first started using entity systems in anger back in 2001-2003, when I was working on MMOG server middleware. We were targetting the few most painful problems in MMOG development, one of which was the difficulty of constantly changing your game logic after launch, which led us to entity systems. I learnt then that entity systems were an almost perfect solution to massively speeding up the development time for most MMOG’s, and for also allowing almost unrestrained re-writing of fundamental game features post-launch with very little effort.
That last issue is critical to the success of an MMOG: once an MMOG is launched successfully, its long term success or failure depends more upon the ability of the dev team to evolve that game into a better game month after month than upon anything else.
I learned a lot from that first run-in with them, more about the things that go wrong and what makes developing with entity systems particularly hard than about the things that went right. We also discovered that performance could easily become a major issue – although they are very flexible and dynamic, the lack of pre-compiled lookups and optimizations can make runtime performance disappointingly (unacceptably) poor. Why? Mainly because of the amount of indirection and checks needed to run even a single method call (but I’ll go into detail on that problem, and how to fix it, a bit later).
I moved on, and didn’t think about them again, until last year. In 2006 I joined the Operation Flashpoint 2 team as the lead network programmer, where we trying to make an MMO-FPS on an unprecedented scale, and I discovered that the programming team was considering an entity-system to drive the whole game. The attractions for the OFP2 team were different – mainly around the improvements to memory management they could get from it, and the stream-oriented coding (which is essential for PS3 development) – but it turned out to be something of a silver bullet for the “MM” and “O” parts of the MMOFPS. As the network programmer, discovering that an entity system was going to be the interconnect for all other subsystems was a huge relief: the entity system meant I could implement the complex latency hiding and prediction techniques with minimal interference with the coding of all the rest of the game systems. When you’ve got 20+ programmers on a team, you really don’t want to be placing yourself in a position where you’re going to have to redesign code for all of them just to make it “network friendly”.
whilst I was working on OFP2, I got in touch with Scott, and exchanged ideas on what the future might hold for entity systems, including additional uses for them, and on how to share this knowledge more widely. He encouraged me to start a blog (and, actually, a year later that was one of the main reasons I even started this blog, T=Machine), so I figured now was a good time to start (finally) writing about those entities :).
And to blame Scott for the existence of this blog…
Since then, I’ve been thinking a lot off and on about entity systems and their appropriateness for use in MMOG development (again!). Only this time around – thanks to OFP2 and some of the issues it threw up – I had a much better idea how to use them to increase performance rather than reduce it, and had come across some other major problems that they conveniently solve. Most obviously, they work wonders for PS3 development. Knowing how PS3’s fundamental architecture works, I can’t immediately see how you’d want to use anything other than a full entity system for game development. There’s so much horsepower in that beast that you can certainly write games many different ways, but it’s particularly well-suited to this approach.
As it stands, I’m beginning to think that next-generation MMOG’s are going to be practically impossible to develop unless based heavily around a core entity-system. “practically” being the key word – unless you’re willing to spend $100 million for your development…
“Anything is possible”, of course, so there’ll be many exceptions to that – but I think any team that doesn’t go this route is going to suffer a lot because of it.
I think most people would agree. But … recent discussions on game-industry mailing lists – and the experiences I had within games companies with programmers who were much better at programming than I was – made me realise that there’s a lot of ignorance over these systems, and many people aren’t getting anywhere near the full potential of them. So, if you’re interested, read on…
I’ll do this in a series of posts (it’s going to take some time to write it all up!), but it’ll go something approximately like this:
- UPDATE December 2010: I’ve started a wiki dedicated to documenting and providing source examples of simple Entity Systems; please read the articles below *first*, so it makes sense, but then come back to the wiki
- Part 1 – intro (you’re reading it)
- Part 2 – what is an entity system
- Part 3 – more on what is, and isn’t, an entity system
- Part 4 – Introduction to MMO Development Practices
- Part 5 – initialization, storage, and data
- …coming eventually: serialization, de-serialization, and distributed state management
- Latest posts on Entity Systems (including examples, source code, all sorts of things)
EDIT, December 2007 – You may also want to take a look at Mick West’s introduction to entity systems for game development, it’s a shorter read than my posts, but narrower in scope.
NB: as I post the other parts, I’ll update the list above to link to them.
77 replies on “Entity Systems are the future of MMOG development – Part 1”
[…] This T=Machine blog series offers a highly detailed and experienced look at the advantages to EC in MMO development. […]
[…] up. Eventually I settled on creating a basic Entity-Component framework inspired by Artemis and posts by Adam Martin. Just about everything in the game is an Entity; every data attribute is packaged in a Component; […]
[…] Entity Systems are the future of MMOG development (Sep 2007) […]
[…] challenge at all, but it’s also no fun at all. To make it more interesting (and after reading this fantastic articles series) I decided to try Entity Systems approach to designing game […]
[…] T-machine.org – Entity Systems are the future of MMOG development […]
[…] you are new to Entity Component Systems, I would highly recommend Adam Martin’s blog series on them, he goes into great detail about what problem they solve, and what is required to […]
[…] http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/ […]
“No programmer required” … LOL good luck with that one.
[…] Entity Systems are the future of MMOG development – good start about ECS […]
[…] that process lists of these components. There is a great 5-part blog series on this topic over at T-Machine. I’ll describe what I’ve done once I manage to get a little more working. So far, I […]
[…] In particolare, sto attualmente trasformando ZoM per farlo aderire ad un modello chiamato “Sistema ad Entità e Componenti”. Detta in termini semplici, si sposta una buona parte dell’organizzazione “logica” delle entità (razze viventi e oggetti) dal codice vero e proprio (Java nel caso di ZoM) ai dati (database SQL per ZoM). Dopo aver razionalizzato tutte le strutture, si modifica il codice in modo che i dati siano caricati e processati. Per una spiegazione completa e interessante, leggete qui. […]
[…] This is 3 links/resources for a good introduction : Gamasutra the Entity Component Model, Entity Systems are the future of MMOG development, Entity Systems. Then Richard Lord has made a very good blog post with code example using his own […]
[…] OOP. This is 3 useful links/resources if you are interested : Gamasutra the Entity Component Model, Entity Systems are the future of MMOG development, Entity Systems. This links are very interesting, but there isn’t any implementation. You can […]
[…] those that didn’t understand much about what I just wrote, I recommend reading through the T-Machine blog posts on entity systems. He brings up the core concepts of how they work, as well as addressing common […]
[…] I take my approach from this excellent guide by Adam from T-machine. […]
[…] develop in Java using jMonkeyEngine 3. Our main IDE is IntelliJ Idea. Data is stored in an Entity Component System, both on client and server. Persistant data is written to a PostgreSQL […]
[…] Zur Entwicklung nutzen wir IntelliJ Idea. Die Datenhaltung auf Client und Gameserver ist mit einem EntityComponentSystem realisiert. Zur Persistierung verwenden wir eine PostgreSQL […]
[…] Entity Systems are the future of MMOG development by T-Machine […]
[…] http://t-machine.org/index.php/2007/09/03/entity-systems-are-the-future-of-mmog-development-part-1/ http://en.wikipedia.org/wiki/Entity_component_system http://c2.com/cgi/wiki?ValueObject http://www.richardlord.net/blog/what-is-an-entity-framework […]
[…] started writing about Entity Systems back in 2007, mostly because I was frustrated that so many game studios were “doing it […]
[…] this article Entity Systems are the future of MMOG development will be a good […]
[…] features, or that Unity’s component based architecture sucked and I should have gone for an Entity Component System if I was going to bother to change […]
[…] T-machine.org: Entity Systems are the future of MMOG development – Part 1 […]
[…] Although definitions can vary, I wouldn’t define Unity3D as an Entity System. When we talk about Entity System, we should follow the Adam Martin definition […]
[…] Entity Systems are the future of MMOG development […]
[…] Entity Systems are the future of MMOG development […]
[…] the component pattern, and some improvements. I came across a great series of blog posts about Entity Systems. These sound quite appealing and I’d like to implement this change to my component […]