View Full Version : XML Tidyup
Deliverator Jul 04, 2009, 04:30 AM Can we go through an exercise of tidying up the XML please? It gets really difficult to remember that BONUS_CRAB refers to Sword Grass, or UNIT_PARATROOPER is the Mentat Assassin.
It is a boring exercise to do, but it does hamper tuning and evolving the mod when you have no idea what tag refers to what object. If you look at the FfH2 XML it is much tidier, and tags have names corresponding to what they are.
davidlallen Jul 09, 2009, 01:02 AM I'm not sure if this should go in the patch discussion thread or here. But as I threatened in the patch discussion thread, I have written a program which does a mass renaming. There are 1000 symbols which it renames, for a total of about 4000 lines changed among all the xml.
I have run it on the 1.2.8 patch. The good news is it passes through civchecker. But the bad news is the game does not start up yet.
It may be that I am too aggressive in renaming things. For example in the first try, I renamed all the TERRAIN_GRASS to TERRAIN_ARID; but it crashes during the mapscript. Somewhere in the mapscript subroutines there may be some hardcoded references to terrains by name, which fail. So I left the terrains the same and I got a little further. Now some funny alert gets thrown during initialization which causes the tech chooser screen to display.
Attached are the 1000 (or so) renames. I will try a few things. But we should plan to release 1.3 with the "old" names. If anybody has a lot of local changes, whenever I add this I can guarantee your stuff will break. Civchecker "should" catch any violations, and you may find the renaming script useful somehow.
Deliverator Jul 09, 2009, 02:12 AM It would make sense to proceed gradually. Perhaps rename all the BonusInfos and UnitInfos first.
koma13 Jul 09, 2009, 10:25 AM Can you please wait with Civ4UnitInfos until I'll finish my unit balancing. It is already hard to keep track of all that changes from updates. ;)
davidlallen Jul 09, 2009, 10:36 AM I can break down the script so that it performs only a limited renaming, for example just bonuses, and still run it on all the files which need changing.
However, just about every file has an effect on unitinfos. Tech, buildings, and bonus all have effect. One possibility may be for me to run my script on your unitinfos file. So the steps would be, 1. you send your local unitinfos, 2. I run the script on the current version plus separately on your file, 3. I send back your file with changes, 4. I upload a patch which has all the changed files. You should be able to download the patch, add the changed file I sent you, and continue right on.
Personally I find bonuses and techs to be the most confusing, because those are referred from other files. So I sit in buildinginfo saying, "What is BONUS_CLAM again? or TECH_THE_WHEEL?" Unit names are usually only used in the unit file, although they also have to be updated in civilizationinfos (barb restrictions and UU).
How about after 1.3 is released in the next few days, I can do bonuses and techs. Maybe buildings and improvements. I can update koma's units file; but after the units file is done, then I can do a second renaming for units. There are some minor things too like civ names, but those are less likely to change.
koma13 Jul 09, 2009, 10:56 AM Well, problem is I also made numerous changes to civ4techinfos.xml and civ4buildinginfos.xml. Next, I'm not good at naming units, you surely want to rename them to something better fitting which would result in new unit tags I assume.
But I gave myself a deadline. I will upload my changes until weekend, ready or not. :)
davidlallen Jul 09, 2009, 10:56 AM Well, problem is I also made numerous changes to civ4techinfos.xml and civ4buildinginfos.xml. Next, I'm not good at naming units, you surely want to rename them to something better fitting which would result in new unit tags I assume.
But I gave myself a deadline. I will upload my changes until weekend, ready or not. :)
OK, let us hold off on renaming for a while.
davidlallen Jul 21, 2009, 08:30 AM Done in 1.3.8, except for improvements.
|
|