Right so, the powers that be gave me permission to do some theory stuff regarding what I'm working on over at Wildfire Games. The project is called 0 AD, and is a RTS game based on civilizations from 500 BC to 500 AD. You can check it out at teh website, or check out some very awesome screenies at teh screenie viewor!!1.
Moving on, our entity system, ground up.
Our base system consists of an extremely stripped down engine (known as Pyrogenesis) that brings in all the game data through .xml and our javascript code. This is done to make the game heavily data driven, so everyone and their dog can build on top of it without modifying base code. The javascript portion is handled through Mozilla's SpiderMonkey (an excellent library I might add), and the XML is parsed through what I believe to be a proprietary parsing system. I could be wrong on that one.<br><br>Anyway, we handle game entities as such. First, there are three master entity types - Gaia, Structure, and Unit. Gaia is just that...earthy things. Flora and fauna if you will. Structures are your building entities and their defensive values - this includes walls, towers, civic centers, etc. Buildings can be destroyed (or rebuilt), and hence, have defensive (and in garrisoning buildings, a =+ effect on offensive abilities) properties. Unit entities are basically anything that belongs to a player that is not a building. Ships, special units, basic infantry and calvary, etc.<br><br>The XML system works under a heirarchical tree structure. Because the unit entity type is the largest, I'll use it for example.<br><br>It starts with template_unit.xml. This is the base XML file that all units, fat skinny big and small, inheret their properties from. This is an extremely general 'guess' of what the 'base' unit would be, just for redundancy sake. Then, the tree moves into seven branches, _calvary, _special, _fauna, _mechanical, _super, _support, and _infantry. The not-so-obvious ones are _support, _super, and _fauna. Support are healer units, workers, etc. Supers are certain 'special' units (known as heroes), that have some insane fighting abilities and stats. Fauna are things like sheep and deer and stuff. Sometimes gaia's fauna can get a little shaky shaky, and hence can have attack and definsive capabilites (those sheep are nasty).<br><br>Anyway, these seven categories break off into about a million different ones, based on ranged or sword/spear attacks, the type of mech unit (seige units, ships, etc), and various other properties. These are template units, so they all are just base values that really mean little in the game - the individual civs will have their own heirarchy of XML files that are loaded in. The whole data-driven thing.<br><br>Because of this parent-child style system, no entity in the game will have no properties, and hence, won't just appear and then die or something similar. Entities are only creatable in the map/scenario editor if they are a valid XML file, so no tricky funky-magic-entity nonsense would be going on.<br><br><br>While not too technical, that's a general overview of how the entity system is based. It's pretty straightforward (like most RTS games) - nothing too hard, and therefore easy for click-click users to get used to and handle (in the case of modmaking). In a later post I think I'm gonna get some more programmer-oriented stuff up, possibly something about SpiderMonkey and it's ensuing..uh..stuff.<br><br>Adeiu, and apologies if that was a winded waste of time.<div>
</div>
Advertisement
Latest Entries
Not really.
941 views
Untitled
980 views
WFG for teh win!
995 views
Untitled
863 views
Untitled
915 views
weeeeeeee
903 views
Untitled
852 views
GameDev Lightbulb Forum!
885 views
Schweet.
900 views
return (me)
838 views
Advertisement