Fearthecute schreef: > Giel van Schijndel schrieb: >> I wouldn't mind seeing special purpose scripts written in Lua. Whenever >> your just storing data and describing object properties (which is just >> about all that is being done in data/stats/*.txt AFAIK) though I think >> XML is much more intuitive to use. It is also easier to create a >> data-editor for XML than it is for Lua. >> > Because XML is a buzzword, xml is NOT good for everything. > Its a markup language for a static tree-like definition list. > And not for data storage... > As for the buzzword part I agree it is that much, but luckily, it is more than just that (to my opinion). About describing XML as a data storage container, let me rephrase that: XML is (to my opinion) better for the purpose of describing than any programming/scripting language is. The latter describes instructions/actions to be executed (e.g. by a PC), whereas XML is designed to describe data, and importantly in this case as opposed to plain text, it also describes the meaning of the data (especially towards humans). > And where do we have a tree-like static definition? > How do you want to use it? > > ~~~~~ > > <map name="MapName" player="2"> > <tile x="1" y="1" textureID="17" textureAlign="2" height="128" /> > <tile x="2" y="1" textureID="16" textureAlign="1" height="128" /> > <tile x="3" y="1" textureID="12" textureAlign="1" height="128" /> > <tile x="4" y="1" textureID="19" textureAlign="2" height="129" /> > ... > </map> > > ~~~~~ > > This produces MUCH overhead and will increase the filesize by n^4 or > whatever... > > Or something like > > ~~~~~ > > <map name="MapName" player="2"> > <mapdata> > 1 1 17 2 128 > 2 1 16 1 128 > 3 1 12 1 128 > 4 1 19 2 129 > ... > </mapdata> > </map> > > ~~~~~ > > That would be absolutly the same thing, like it's now handled. > It's just beautyfied with some <NameHere></NameHere> tags. > If you have something different in your mind, then i'm sorry :) > Yes, actually I have something different in mind. Just compare http://svn.gna.org/svn/warzone/trunk/data/stats/repair.txt with my attached example XML-file.
I agree that for the example you gave above, describing 3D-objects by means of coordinates, XML isn't by far the best solution. Instead I meant the data/stats/*.txt and mp/data/stats/*.txt files which has lots of hierarchal relations, i.e. statistics about all sorts of objects. The PIE-files (which define the 3D-objects if I'm not mistaken, and is what you gave as example) are quite a different subject. I wouldn't use XML for those exactly for that overhead you noted. -- Giel
<?xml version="1.0" encoding="UTF-8"?> <RepairStats> <objectStats name="ZNULLREPAIR"> <property name="techLevel" type="string">Level All</property> <property name="buildPower" type="number">0</property> <property name="buildPoints" type="number">0</property> <property name="weight" type="number">0</property> <property name="hitPoints" type="number">0</property> <property name="systemPoints" type="number">0</property> <property name="repairArmour" type="number">0</property> <property name="location" type="string" /><!-- has "DEFAULT" as original value, but default should be obvious if the value is unspecified --> <property name="GfxFile" type="string" /><!-- has "0" as original value, which suggests no file (I think!?), so why specify it at all --> <property name="mountGfx" type="string" /><!-- has "0" as original value, which suggests no file (I think!?), so why specify it at all --> <property name="repairPoints" type="number">0</property> <property name="time" type="number">100</property> <property name="designable" type="bool">false</property> </objectStats> <objectStats name="NEXUSrepair"> <property name="techLevel" type="string">Level Three</property> <property name="buildPower" type="number">0</property> <property name="buildPoints" type="number">0</property> <property name="weight" type="number">0</property> <property name="hitPoints" type="number">0</property> <property name="systemPoints" type="number">0</property> <property name="repairArmour" type="number">1</property> <property name="location" type="string" /><!-- has "DEFAULT" as original value, but default should be obvious if the value is unspecified --> <property name="GfxFile" type="string" /><!-- has "0" as original value, which suggests no file (I think!?), so why specify it at all --> <property name="mountGfx" type="string" /><!-- has "0" as original value, which suggests no file (I think!?), so why specify it at all --> <property name="repairPoints" type="number">100</property> <property name="time" type="number">100</property> <property name="designable" type="bool">false</property> </objectStats> <objectStats name="LightRepair1"> <property name="techLevel" type="string">Level All</property> <property name="buildPower" type="number">50</property> <property name="buildPoints" type="number">250</property> <property name="weight" type="number">800</property> <property name="hitPoints" type="number">0</property> <property name="systemPoints" type="number">10</property> <property name="repairArmour" type="number">0</property> <property name="location" type="string">TURRET</property> <property name="GfxFile" type="string">GNMREPAR.PIE</property> <property name="mountGfx" type="string">TRMECM1.PIE</property> <property name="repairPoints" type="number">15</property> <property name="time" type="number">7</property> <property name="designable" type="bool">true</property> </objectStats> </RepairStats>
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Warzone-dev mailing list [email protected] https://mail.gna.org/listinfo/warzone-dev
