Guy, on Feb 17 2006, 12:40 PM, said:
Some kind of data format which doesn't rely on piles of fields for every resource. No limits on the number of spobs/links in systems or default weapons/outfits on ships and each individual resource only as big as it needs to be. Someone mentioned XML which would probably work great (or some similar format). I've played around a bit with the data for C&C Generals which is pretty much just one giant XML file - no limit on what you can do in any one resource.
View Post
I've been thinking about the xml idea since it was first mentioned. I'm not sure how to get away from large amounts of fields in each resource. Massive, I think I've already done, but there are a bunch of fields that, while excludable if unused, can't be easily reduced/replaced.
Do you think you can post/attach/email a sample of the C&C Gen. xml? I'd be interested to see that.
here's an example of what I've been thinking.
(groups with a data type essentially become dynamic arrays. I believe there's already xml methods around that get child counts.)
<resource type="char">
<res id="0" name="">
<field type="bool" name="default">0</field>
<field type="int" name="cash">0</field>
<field type="int" name="ship">0</field>
<group type="point" name="start_system">
<!-- point( system , probababilty ) -->
<field type="point"><int>0</int><int>100</int></field>
</group>
<group type="point" name="govt">
<!-- point( govt , reputation ) -->
<field type="point" name=""><int>0</int><int>0</int></field>
</group>
<field type="int" name="combat">0</field>
<group type="point" name="intro_pics">
<!-- point( pict_id , delay ) -->
<field type="point" name=""><int>0</int><int>0</int></field>
</group>
<field type="int" name="intro_text">0</field>
<field type="cb_string" name="event:onStart"><!(CDATA())></field>
<!--vector( year , month , day )-->
<field type="vector" name="start_date"><int>0</int><int>0</int><int>0</int></field>
<field type="string" name="date_prefix"></field>
<field type="string" name="date_suffix"></field>
</res>
</resource>
<resource type="syst">
<res id="0" class="0" name="">
<field type="cb_string" name="visible"><!(CDATA())></field>
<field type="point" name="location"><int>0</int><int>0</int></field>
<group type="int" name="hyperlinks">
<field type="int">-1</field>
</group>
<group type="int" name="stellars">
<field type="int">-1</field>
</group>
<group type="int" name="dudes">
<!--point( type , probability )-->
<field type="point"><int>-1</int><int>0</int></field>
</group>
<group type="int" name="pers">
<!--point( type , probability )-->
<field type="point"><int>-1</int><int>0</int></field>
</group>
<field type="int" name="avg_ships">0</field>
<field type="int" name="govt">0</field>
<field type="int" name="msg_bouy">0</field>
<field type="int" name="asteroid_count">0</field>
<field type="int" name="interference">0</field>
<field type="color" name="background_color">0x000000</field>
<field type="int" name="murk">0</field>
<group type="vector" name="reinforcements">
<!--vector( fleet , delay , interval )-->
<field type="vector"><int>-1</int><int>0</int><int>0</int></field>
</group>
<group type="point" name="asteroids">
<!--point( type , probability )-->
<field type="point"><int>0</int><int>0</int></field>
</group>
</res>
<res id="0" class="1" name="">
<!--0=overwrite, 1=add, 2=multiply-->
<field type="int" name="overlay_mode">0</field>
<!-- inherit then modify, ect.-->
</res>
</resource>
(edit: fixed the indents)
This post has been edited by Artanis : 18 February 2006 - 01:54 PM