View Full Version : Allocating zero or less memory in... ?


thomas.berubeg
Sep 06, 2007, 04:32 PM
http://static2.filefront.com/images/personal/t/thomasberubeg/89243/goodgzxsrf.jpg
what does this mean? it happened during the removal of all normal techs in favor of a new tech tree for the arda mod. any ideas on how to fix this? please?

Mercury314
Sep 06, 2007, 05:52 PM
I do not know exactly, but likely this was caused by other files (civics, buildings, units, etc) referencing techs that no longer exist.

There is a disable value you can set to 1 for techs which disables them. You can also move them to very far away in the techtree by changing the X and Y coordinates.

In any case, that may not be the solution, but maybe it will help!

c.fe
Sep 06, 2007, 06:49 PM
I did a bit of code-diving and found the following:

CvCivicInfo::read(XML...) does the following six calls:

pXML->SetVariableListTagPair(&m_pabHurry, "Hurrys", sizeof(GC.getHurryInfo((HurryTypes)0)), GC.getNumHurryInfos());
pXML->SetVariableListTagPair(&m_pabSpecialBuildingNotRequired, "SpecialBuildingNotRequireds", sizeof(GC.getSpecialBuildingInfo((SpecialBuildingT ypes)0)), GC.getNumSpecialBuildingInfos());
pXML->SetVariableListTagPair(&m_pabSpecialistValid, "SpecialistValids", sizeof(GC.getSpecialistInfo((SpecialistTypes)0)), GC.getNumSpecialistInfos());

pXML->SetVariableListTagPair(&m_paiBuildingHappinessChanges, "BuildingHappinessChanges", sizeof(GC.getBuildingClassInfo((BuildingClassTypes )0)), GC.getNumBuildingClassInfos());
pXML->SetVariableListTagPair(&m_paiBuildingHealthChanges, "BuildingHealthChanges", sizeof(GC.getBuildingClassInfo((BuildingClassTypes )0)), GC.getNumBuildingClassInfos());
pXML->SetVariableListTagPair(&m_paiFeatureHappinessChanges, "FeatureHappinessChanges", sizeof(GC.getFeatureInfo((FeatureTypes)0)), GC.getNumFeatureInfos());

Now, SetVariableListTagPair has the strange(?) property to show an error message if the fourth parameter is zero or less. Looking at the GC.getNum... calls I would guess that you removed not only all technologies but something more like buildings or specialists.
What I think is strange is that it would really not be necessary for setVariableListTagPair to give an error as long as the tag is empty... If you are changing the SDK files you could try to change the line 1969 in CvXMLLoadUtilitySet.cpp from
if (0 > iInfoBaseLength)
{ ...
to
if (0 >= iInfoBaseLength)
{ ...
But I don't guarantee that this will work (and I don't even know if I'm right with my initial assumption).

thomas.berubeg
Sep 07, 2007, 02:26 PM
I haven't changed anything besides XML. (i have gotten rid of some buildings, but no specialists,...)

c.fe
Sep 08, 2007, 05:29 PM
I haven't changed anything besides XML. (i have gotten rid of some buildings, but no specialists,...)

If you didn't delete all buildings and you didn't delete the entries in CIV4SpecialBuildingInfos.xml then I'm clueless.

thomas.berubeg
Sep 08, 2007, 09:10 PM
i deleted some in CIVspecialbuildings... but not all.

primordial stew
Sep 09, 2007, 01:21 AM
Do you have logging enabled?

; Enable the logging system
LoggingEnabled = 1

in My Documents\My Games\Warlords\CivilizationIV.ini

and then look in xml.log. This should point to where the parsing failed.

Typically only the 1st failure is valid since 1 bad tag confuses the parsing, so everything after is hosed too.

thomas.berubeg
Sep 09, 2007, 08:51 AM
I'll do that, thanks