So I am writing a bunch of little xml files like this to define a ship:
<TypeID>1000</TypeID>
<Name>Columbia class Destroyer</Name>
<Abbreviation>CCD</Abbreviation>
<Mass>110000</Mass> <!--mass in kg-->
<Length>42</Length> <!--length in meters-->
<HitPoints>250</HitPoints> <!--hitpoints of hull-->
<SubSystems>
<Reactor ReactorTypeID="1000"/>
<Engine EngineTypeID="1000"/>
<Weapon WeaponTypeID="1000"/><Weapon WeaponTypeID="1001"/>
<Sensors SensorTypeID="1000"/><LifeSupport LifeSupportID="1000"/>
</SubSystems>
<!--drawing instructions: MoveTo(x,y):LineTo(x,y)-->
<Geometry>M,0,-10:L,5,5:L,0,0:L,-5,5:L,0,-10</Geometry>
</ShipType>
You can see that this small ship has one engine and two weapons. The specifications of the engines and weapons are defined in other XML files. This way, it should be easy to make new ship types or tweak existing ones for balance.
The "geometry" section is drawing instructions for the client. This is so each ship class will look a little different so you can tell them apart visually. Right now, I am just going to use simple line drawing graphics, but maybe in the future I will add some actual artwork. (I am no artist!)
No comments:
Post a Comment