C2C - mass XML changes parser

Coffee and sandwiches too?

Yes please. But remember no sugar...

To be honest all xml files grouped by category (info that it contains) will be usefull.
 
Wonders are special. They are just buildings with class that set the following tags. So it maybe not one hundred percent sure list.
Code:
                        <iMaxGlobalInstances>
			<iMaxTeamInstances>
			<iMaxPlayerInstances>
			<iExtraPlayerInstances>
Especially, as I do not know what is "ExtraPlayerInstances".

To be honest all xml files grouped by category (info that it contains) will be usefull.
Better prepare a list. I do not think you want for example ColorVal-s or HintInfo-s. Or maybe you want? :crazyeye:

Yes please. But remember no sugar...
Coffee is out. Currently we have cabbage and parsley leaves. :p
 
@TD, this below is responsible for binding a type name with its id. I'm not sure are those all places, but there is a good chance for it.

void CvXMLLoadUtility::LoadGlobalClassInfo(...)
Code:
GC.setInfoTypeFromString(pClassInfo->getType(), (int)aInfos.size() - 1);

void CvXMLLoadUtility::SetGlobalClassInfo(...)
Code:
GC.setInfoTypeFromString(pClassInfo->getType(), iID);

About combat classes loading, I would try to move it, from LoadBasicInfos() to LoadPreMenuGlobals() before UnitInfo-s loading. Combat classes should not be required to load any Info-s except UnitInfo (at least logically), so if some problem would even appear, it should be minor.
 
@TD, this below is responsible for binding a type name with its id. I'm not sure are those all places, but there is a good chance for it.

void CvXMLLoadUtility::LoadGlobalClassInfo(...)
Code:
GC.setInfoTypeFromString(pClassInfo->getType(), (int)aInfos.size() - 1);

void CvXMLLoadUtility::SetGlobalClassInfo(...)
Code:
GC.setInfoTypeFromString(pClassInfo->getType(), iID);

About combat classes loading, I would try to move it, from LoadBasicInfos() to LoadPreMenuGlobals() before UnitInfo-s loading. Combat classes should not be required to load any Info-s except UnitInfo (at least logically), so if some problem would even appear, it should be minor.

I found it oddly problematic to move it from LoadBasicInfos... something seemed to go wrong when I did but I can't be sure it wasn't something else I fixed when reversing some changes I'd made. I might've mistook my bug for something else.

Also, you know the whole thing about don't mess with something you don't understand? I could not figure out what the reasoning for having a difference between LoadBasicInfos and LoadPreMenuGlobals was for so was a little cautious about trying to move it before I could identify why CCs were there in the first place.

What we'd have to do is review everything we move Combat Classes behind in the load order to make sure that none of those Classes try to load a tag with a CombatClass reference.

Not sure if that will make it any easier for us on those 3 tags either without looking at the list but I do suspect you MAY be right. It's surprising sometimes how many classes have tags referring to other classes that you wouldn't have expected though... Maybe you'll find the time to review that and find it would work though... that'd be appreciated if you could take a look.
 
Yes please. But remember no sugar...

To be honest all xml files grouped by category (info that it contains) will be usefull.

The category of the files are part of their name all *UnitInfos*.XML are unit files. All buildings are in *BuildingInfos*.XML files but for the difference between a building, national wonder and great wonder you will need to examine the *BuildingClassInfos*.XML file contents.

Are you suggesting in all this that if we add new modules then your process will not work? Or will you be adding a bit before your process that will go through all the C2C folders and gatherer the list of files into categories?
 
It will work for as many files as you want.

Thanks for this name schema explenation. I simply want to test my parser on all unit/buildings files.
 
What we'd have to do is review everything we move Combat Classes behind in the load order to make sure that none of those Classes try to load a tag with a CombatClass reference.

Not sure if that will make it any easier for us on those 3 tags either without looking at the list but I do suspect you MAY be right. It's surprising sometimes how many classes have tags referring to other classes that you wouldn't have expected though... Maybe you'll find the time to review that and find it would work though... that'd be appreciated if you could take a look.
No, we rather do not need reviewing. If you move it and after running c2c with debug build, you do not get error messages, then everything should be ok. If something is dependent on something else, it calls FindInInfoClass(type_name) -- at least in those cases I have seen -- to get the id of this dependency and this call generates an error message, if the id is not found.

@Dancing Hoskuld, can you say something about this iExtraPlayerInstances tag?
 
@Dancing Hoskuld, can you say something about this iExtraPlayerInstances tag?

If you look at the Modiki here you will see that the description for that item is
Code:
Number of building class that can be constructed if the limit has already been reached (used to allow the Palace to be moved)

edit notice how I both answer your question and point you at the source so you can find such things in the future. I remember my mentor training course I did many years ago.:lol:
 
No, we rather do not need reviewing. If you move it and after running c2c with debug build, you do not get error messages, then everything should be ok. If something is dependent on something else, it calls FindInInfoClass(type_name) -- at least in those cases I have seen -- to get the id of this dependency and this call generates an error message, if the id is not found.
Well, yeah, that's true. I suppose I just expect it will happen so it's more of 'taking a count' of how many reprogrammed tags it will enforce to make such a move. But it may well be that it could work so I'll test it in a bit here.

Also, you were looking for an xml code example of the use of NotOnGameOptions or OnGameOptions:

Code:
<NotOnGameOptionTypes>
	<GameOptionType>GAMEOPTION_RAGING_BARBARIANS</GameOptionType>
</NotOnGameOptionTypes>

and

<OnGameOptionTypes>
	<GameOptionType>GAMEOPTION_NO_NUKES</GameOptionType>
	<GameOptionType>GAMEOPTION_LEVELING_LEADERHEADS</GameOptionType>
</OnGameOptionTypes>
The first example would make the Combat Class not active (not loaded onto any units during the game nor showing on unit definitions in the pedia even if it's included it in their SubCombatTypes tag in their definition) if the Raging Barbarians game option is on.

The second would enable the Combat Class to be active ONLY if either No Nukes or Leveling Leaderheads was on.

It's in this way that I can make the armor, weapon, speed and possibly more CC category combat classes active only if an option turns them on. Many promotions would inherit this by having those as prereqs (and I'd probably want to make those promotions disabled by the same sort of tag use on the promotions themselves so as to not confuse players in the pedia.)
 
@: Nimek

Could your Parser also handle such a problem? http://forums.civfanatics.com/showpost.php?p=12829726&postcount=841

In words, if I had a table that would be:

Building A| Value A | Building B | Value B | Tech A | Value Tech A | Resource A | Value Resource A

Solar Panels | 5 | Power Grids | 1 | Wireless Electricity | 2 | Nanotubes | 3

etc, [ BTW, why isn't it shown as table?

Could your Parser translate it in the code like the code in the post linked above?
 
@Faust

It should work.
Give me one example (building) that exist now in svn or add it.

During weekend I will test it and try to add required functions if needed.

I didnt add table formatting because my parser is help form XML moderrs.
I dont plan full visual editor at this stage, but who knows what future will bring ;)
 
@TD, yeah, there were some dependencies. Promo lines needed Combats and this caused a nice waterfall. :p But as I've said, it is enough to move a loading compile, clear cache (sorry, I forgot to mention it earlier) and try to run. If it produce an error check where and move the dependency. Still, indeed you need to understand, how some things are going.

When moving for example
Code:
LoadGlobalClassInfo(GC.getLeaderHeadInfo(), "CIV4LeaderHeadInfos", "Civilizations", "Civ4LeaderHeadInfos/LeaderHeadInfos/LeaderHeadInfo", false, true, GC.getLeaderHeadInfoReplacements());
but leaving the following
Code:
SortAlphabetGlobalClassInfo(GC.getLeaderHeadInfo());
there will be no errors, but LeaderHeadInfos won't be sorted. So if later there is some code it assume they are, we get a bug.

I reordered loading, so combat class loading is in the place you wanted and things seems to be working. But I've made one change I asked Koshiling about in my working copy, so I will not commit it until he responses.
 
I was toying with this last night too and this arrangement seems to work fine:
Code:
	LoadGlobalClassInfo(GC.getFeatureInfo(), "Civ4FeatureInfos", "Terrain", "Civ4FeatureInfos/FeatureInfos/FeatureInfo", false, true, GC.getFeatureInfoReplacements());
	LoadGlobalClassInfo(GC.getReligionInfo(), "CIV4ReligionInfo", "GameInfo", "Civ4ReligionInfo/ReligionInfos/ReligionInfo", false, true, GC.getReligionInfoReplacements());
	LoadGlobalClassInfo(GC.getBonusInfo(), "CIV4BonusInfos", "Terrain", "Civ4BonusInfos/BonusInfos/BonusInfo", false, true, GC.getBonusInfoReplacements());
	LoadGlobalClassInfo(GC.getUnitCombatInfo(), "CIV4UnitCombatInfos", "Units", "Civ4UnitCombatInfos/UnitCombatInfos/UnitCombatInfo", false, true);

	//TB Promotion Line Mod begin
	LoadGlobalClassInfo(GC.getPromotionLineInfo(), "CIV4PromotionLineInfos", "Units", "Civ4PromotionLineInfos/PromotionLineInfos/PromotionLineInfo", false,true);
Moving UnitCombats to just above PromotionLines (I read through all the classes and judged from a little memory and a little research where I wasn't sure and found it could be moved here so it's confirming to see you found the same result.) and then moving Bonus infos up a few shifts so it comes up before UnitCombats. (Bonuses are pretty much the core information profile for a Culture definition.) This seems to load just fine. I forgot about clearing the cache to make sure though.

But do you think
Code:
DestroyFXml();
that comes up at the end of LoadBasicInfos() or
Code:
OutputDebugString("Begin cached load region\n");
which now comes up before UnitCombats rather than after, would have any possible negative impact for such a move?
 
You should post your Parser link in big letters on first page.

Also I know we design, I can make it beautiful with basic HTML like make background black.
 
I can be polite in answering this, somehow. I am not saying about scores. They are worthless. I am saying about knowledge of common people. Like a random guy you can meet on the street. The best example was Thunddie who even haven't known what is the order of arithmetic operations. -- Without this knowledge you will not even be able to pass the 4'th class of primary school in Europe. And it it a small example. But I don't want to offend guys here even more, so I will not list them.

Why would the international test scores be worthless? If a country has more students retaining what they learned from school, their students should be putting more of it in long-term memory.

I've looked into it, and found out the US doesn't do as bad as a lot of people claim.



I can't verify if the person who set this up was accurately accounting for the differences because of the government shutdown. XD. He gave a link, though, so it's unlikely he totally BS'd Note: There's also differences that might not be accounted for on this chart. For example, Germany's younger generation increasingly isn't white.

Also, I've seen articles mention that the scores are misleading.

From HuffingtonPost:

"Analyses of PISA scores show that white and economically privileged students in the U.S. outperform all other groups internationally -- a fact that is often used to claim that the consequences poverty and diversity are keeping many American students behind, and dragging down the country's composite scores."

http://articles.latimes.com/1998/mar/15/opinion/op-29081

"Aggregate scores also hide the fact that large subgroups in bigger nations may be performing at stellar levels. A 1992 international achievement test similar to TIMSS showed that while the overall U.S. score was low, American Asians did better than any group in the world, wealthier U.S. urban residents placed fourth, and white U.S. students fifth."

I also find it striking that Canada does well when they certainly don't have an academic culture, and their education system is in lockstep with the US.
 
Good news

I make a test and after some tweaks it reads and edit property manipulators.

Also i have idea how to rewrite reading function to be able read tags to any depth.
I will do it during weekend or at the beginning of new week.
 
I was toying with this last night too and this arrangement seems to work fine:
Code:
	LoadGlobalClassInfo(GC.getFeatureInfo(), "Civ4FeatureInfos", "Terrain", "Civ4FeatureInfos/FeatureInfos/FeatureInfo", false, true, GC.getFeatureInfoReplacements());
	LoadGlobalClassInfo(GC.getReligionInfo(), "CIV4ReligionInfo", "GameInfo", "Civ4ReligionInfo/ReligionInfos/ReligionInfo", false, true, GC.getReligionInfoReplacements());
	LoadGlobalClassInfo(GC.getBonusInfo(), "CIV4BonusInfos", "Terrain", "Civ4BonusInfos/BonusInfos/BonusInfo", false, true, GC.getBonusInfoReplacements());
	LoadGlobalClassInfo(GC.getUnitCombatInfo(), "CIV4UnitCombatInfos", "Units", "Civ4UnitCombatInfos/UnitCombatInfos/UnitCombatInfo", false, true);

	//TB Promotion Line Mod begin
	LoadGlobalClassInfo(GC.getPromotionLineInfo(), "CIV4PromotionLineInfos", "Units", "Civ4PromotionLineInfos/PromotionLineInfos/PromotionLineInfo", false,true);
Moving UnitCombats to just above PromotionLines (I read through all the classes and judged from a little memory and a little research where I wasn't sure and found it could be moved here so it's confirming to see you found the same result.) and then moving Bonus infos up a few shifts so it comes up before UnitCombats. (Bonuses are pretty much the core information profile for a Culture definition.) This seems to load just fine. I forgot about clearing the cache to make sure though.
No, it's not good. It must be after this.
Code:
ArrangeTGA(GC.getReligionInfo(), "CIV4ReligionInfo");

I have actually something like this.
Code:
	ArrangeTGA(GC.getReligionInfo(), "CIV4ReligionInfo");
/************************************************************************************************/
/* TGA_INDEXATION                          END                                                  */
/************************************************************************************************/
	LoadGlobalClassInfo(GC.getUnitCombatInfo(), "CIV4UnitCombatInfos", "Units", "Civ4UnitCombatInfos/UnitCombatInfos/UnitCombatInfo", false, true);
	//TB Promotion Line Mod begin
	LoadGlobalClassInfo(GC.getPromotionLineInfo(), "CIV4PromotionLineInfos", "Units", "Civ4PromotionLineInfos/PromotionLineInfos/PromotionLineInfo", false,true);
	//TB Promotion Line Mod begin
	LoadGlobalClassInfo(GC.getPromotionInfo(), "CIV4PromotionInfos", "Units", "Civ4PromotionInfos/PromotionInfos/PromotionInfo", true, true, GC.getPromotionInfoReplacements());
	LoadGlobalClassInfo(GC.getRouteInfo(), "Civ4RouteInfos", "Misc", "Civ4RouteInfos/RouteInfos/RouteInfo", false, true, GC.getRouteInfoReplacements());


But do you think
Code:
DestroyFXml();
that comes up at the end of LoadBasicInfos()
Check the beginning of CvXMLLoadUtility::LoadPreMenuGlobals() . ;)

or
Code:
OutputDebugString("Begin cached load region\n");
which now comes up before UnitCombats rather than after, would have any possible negative impact for such a move?
This is just an information note. And it is probably not actual for a long time. -- You have more data which are not already cached loaded between it and OutputDebugString("End cached load region\n"); . We should remove those notes.



Why would the international test scores be worthless? If a country has more students retaining what they learned from school, their students should be putting more of it in long-term memory.
Because with money you can twist any test. Moreover, I was never very high in test, but I can solve problems of complexity which scares even a national professor (the highest scientific degree in my country) specialized in this domain on my university. Or, my IT institute was below top 10 in the national IT ranking, but somehow our students have been occupying top places in European contests. Students from only one another institute have been taking better places. Actually, the technical university from the same city was higher. But we (when I was still a student) could not even believe, that the education level in an IT institute can be so low. We were ashamed, that people with so poor skills and knowledge get the same MSc as we do.

I've looked into it, and found out the US doesn't do as bad as a lot of people claim.


I can't verify if the person who set this up was accurately accounting for the differences because of the government shutdown. XD. He gave a link, though, so it's unlikely he totally BS'd Note: There's also differences that might not be accounted for on this chart. For example, Germany's younger generation increasingly isn't white.

Also, I've seen articles mention that the scores are misleading.

From HuffingtonPost:

"Analyses of PISA scores show that white and economically privileged students in the U.S. outperform all other groups internationally -- a fact that is often used to claim that the consequences poverty and diversity are keeping many American students behind, and dragging down the country's composite scores."

http://articles.latimes.com/1998/mar/15/opinion/op-29081

"Aggregate scores also hide the fact that large subgroups in bigger nations may be performing at stellar levels. A 1992 international achievement test similar to TIMSS showed that while the overall U.S. score was low, American Asians did better than any group in the world, wealthier U.S. urban residents placed fourth, and white U.S. students fifth."

I also find it striking that Canada does well when they certainly don't have an academic culture, and their education system is in lockstep with the US.
I do not have time for repeating myself countless times. In such tests the advantage or sum scores are useless. What is representative is the median and it is pretty low in the USA. Besides, as I mentioned, there is the money factor.

And I hope you are not trying to say, that richer social classes are more intelligent. Actually most of the most intelligent guys were from the middle class. In my institute we have some students from rich families. And after doing small reminding, I must say I can't recall even one who passed the first year of Master studies. -- Maybe that's the reason, why we are not too high in rankings. :D
 
Top Bottom