Jeysie Jeysie

Fun with data tables

Fun with data tables

From XML files to human-readable in 5.2 hours

I don't know if anyone else would find this sort of thing useful, but I've been using my l33t (OK, not really) HTML skills to turn the game's XML files into something easy to scan.

So far I've finished the Defense-related ship parts:

http://miscfile.alienharmony.com/galciv2/ship-defenses.htm

Note: The techs with question marks are where the tech requirements in the ship parts file didn't match up with any exact tech tree file techs... however, they did seem to me like they would match up with various alignment-related techs. No idea what "Telepathic Defenses" gives you, though.

Feel free to do with this file whatever you like. I'll post more tables when I'm finished with them, if people would like that.

Peace & Luv, Liz
22,460 views 32 replies
Reply #26 Top
Anyhoo. I went through and scanned the patched data files, and I think I got everything updated... the missing stuff added, and some silly goof-ups I had made fixed. All the ship-part files should be updated.

Although I can tell just by looking at the tables that there will probably be another patch in the future... there's some issues with two different parts seeming to have the same stats. Droid Sentries II and III, for instance.

Peace & Luv, Liz
Reply #27 Top
HIghly useful work. At a glance we can all tell where the pivotal technology thresholds are. As noted above, the arrival of Impulse drives early is significant.

Thanks Jeysie.
Reply #29 Top
I'm afraid I'm not playing the Beta. For one, I have to run the game on my roommate's computer, and don't want to take chances with any potential weird bugs more than necessary. For two, more importantly, I just don't have any major free time right now.

When 1.1 Final comes out I'll see what needs to be updated.

Peace & Luv, Liz
Reply #30 Top
Hmm. I know of XSLT and CSS... is there some other form of XML stylesheet? I'm still a n00b at XML-specific stuff. I did use CSS to help me format the text for porting into table code.


You could also use JavaScript to access the XML file using XMLHttpRequest, which would load XML into an object that JavaScript can read. Then you could use JavaScript Object Notation (JSON) to format the XML data anyway you please. Once that is done, you could output that data dynamically to perhaps create tables and what not. That way, all you have to do is write the code to drive the data, and once the data is updated (in the case your XML file), the page will always be current and up-to-date.
Reply #31 Top
Dark-Star:

Ah! Yes, I've heard of JSON... it looks interesting. Unfortunately learning JavaScript is still on my "to-do" list. *sheepish look* Thank you for the tip, though!

Peace & Luv, Liz
Reply #32 Top
GOod stuff!

What is the difference between the Size and Size Mod columns?


ComponentEffectiveSize = INT(BaseComponentSize + (SizeMod / 100) * EffectiveHullSize)

Where

EffectiveHullSize = INT( BaseHullSize * (1 + TotalMiniaturizationBonus)); for example, 60 for a cargo hull (55) with 10% Miniaturization bonus.