WFG for teh win!

Published July 01, 2006
Advertisement
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 &#106avascript 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 &#106avascript 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>
Previous Entry Untitled
Next Entry Untitled
0 likes 2 comments

Comments

Sir Sapo
Thats a pretty cool system, thanks for sharing! It's always interesting to see how other people code their stuff.
July 01, 2006 09:51 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Advertisement

Latest Entries

Not really.

891 views

Untitled

932 views

WFG for teh win!

938 views

Untitled

815 views

Untitled

864 views

weeeeeeee

854 views

Untitled

801 views

Schweet.

851 views

return (me)

790 views
Advertisement