AND2 and SVN Bug Reports - A New Dawn 2 ONLY

So... About Movement Limits: The bug has reappeared while doing my own little modmod changing only XML stuff. I have loaded a save file and the game asked for a recalc so I did so. But ML was nowhere
Civ4ScreenShot0658.JPG
Than I saved the game again, quit, reload and it was back
Civ4ScreenShot0658.JPG
See the tile with the sign on it.

Maybe this behavior has something related to recalc?
 

Attachments

  • Civ4ScreenShot0659.JPG
    Civ4ScreenShot0659.JPG
    198 KB · Views: 195
What kind of tile are you seeing with flood plains? I think all plains and desert tiles adjacent to rivers are automatically supposed to be flood plains, and that doesn't go away when you settle a city there.

I mean desert and plains atleast and tiles where wasnt flood plains before razing city. It adds flood plains..
No of course not all plains and desert tiles suppose to be automaticly flood plains, atleast not BTS nor ROM or ROM-AND before.. I havent seen this earlier, than lets say 1075..

Its true that ROM-AND it was changed so that building city wont erase flood plains as it does in normal BTS but razing city should not add flood plains.
 
I don't know if it is only me or intended behavior but combat with barbarians not produce slaves even tough enslavement is set to 50% in my own modmod. Is that intended? :confused:
Civ4ScreenShot0329.JPG
There was a turn when around 20 barbarian units (not animals) attacked me in a row, killed them all but no slave was created.
 
An other thing:
Is OverrideResourceBuilding tag proved to work fine? Because it doesn't work for me.

I modified a couple of melee units to have <OverrideResourceBuilding>BUILDING_MERCENARY_CAMP</OverrideResourceBuilding> you don't need metal to train mercenaries as they bring their own weapons. But it doesn't work.
Civ4ScreenShot0670.JPG
As you see there is a Mercenary Camp but I still cannot train Spearmen.
Spoiler XML code of Spearman :

Code:
        <UnitInfo>
            <Class>UNITCLASS_SPEARMAN</Class>
            <Type>UNIT_SPEARMAN</Type>
            <UniqueNames/>
            <Special>NONE</Special>
            <Capture>NONE</Capture>
            <Combat>UNITCOMBAT_MELEE</Combat>
            <Domain>DOMAIN_LAND</Domain>
            <DefaultUnitAI>UNITAI_COUNTER</DefaultUnitAI>
            <Invisible>NONE</Invisible>
            <SeeInvisible>NONE</SeeInvisible>
            <Description>TXT_KEY_UNIT_SPEARMAN</Description>
            <Civilopedia>TXT_KEY_UNIT_SPEARMAN_PEDIA</Civilopedia>
            <Strategy>TXT_KEY_UNIT_SPEARMAN_STRATEGY</Strategy>
            <Advisor>ADVISOR_MILITARY</Advisor>
            <bAnimal>0</bAnimal>
            <bFood>0</bFood>
            <bNoBadGoodies>0</bNoBadGoodies>
            <bOnlyDefensive>0</bOnlyDefensive>
            <bNoCapture>0</bNoCapture>
            <bQuickCombat>0</bQuickCombat>
            <bRivalTerritory>0</bRivalTerritory>
            <bMilitaryHappiness>1</bMilitaryHappiness>
            <bMilitarySupport>1</bMilitarySupport>
            <bMilitaryProduction>1</bMilitaryProduction>
            <bPillage>1</bPillage>
            <bSpy>0</bSpy>
            <bSabotage>0</bSabotage>
            <bDestroy>0</bDestroy>
            <bStealPlans>0</bStealPlans>
            <bInvestigate>0</bInvestigate>
            <bCounterSpy>0</bCounterSpy>
            <bFound>0</bFound>
            <bGoldenAge>0</bGoldenAge>
            <bInvisible>0</bInvisible>
            <bFirstStrikeImmune>0</bFirstStrikeImmune>
            <bNoDefensiveBonus>0</bNoDefensiveBonus>
            <bIgnoreBuildingDefense>0</bIgnoreBuildingDefense>
            <bCanMoveImpassable>0</bCanMoveImpassable>
            <bCanMoveAllTerrain>0</bCanMoveAllTerrain>
            <bFlatMovementCost>0</bFlatMovementCost>
            <bIgnoreTerrainCost>0</bIgnoreTerrainCost>
            <bNukeImmune>0</bNukeImmune>
            <bPrereqBonuses>0</bPrereqBonuses>
            <bPrereqReligion>0</bPrereqReligion>
            <bMechanized>0</bMechanized>
            <bSuicide>0</bSuicide>
            <bHiddenNationality>0</bHiddenNationality>
            <bAlwaysHostile>0</bAlwaysHostile>
            <bWorkerTrade>0</bWorkerTrade>
            <bMilitaryTrade>0</bMilitaryTrade>
            <UnitClassUpgrades>
                <UnitClassUpgrade>
                    <UnitClassUpgradeType>UNITCLASS_PIKEMAN</UnitClassUpgradeType>
                    <bUnitClassUpgrade>1</bUnitClassUpgrade>
                </UnitClassUpgrade>
            </UnitClassUpgrades>
            <UnitClassTargets/>
            <UnitCombatTargets/>
            <UnitClassDefenders/>
            <UnitCombatDefenders/>
            <FlankingStrikes/>
            <UnitAIs>
                <UnitAI>
                    <UnitAIType>UNITAI_RESERVE</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
                <UnitAI>
                    <UnitAIType>UNITAI_COUNTER</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
                <UnitAI>
                    <UnitAIType>UNITAI_CITY_COUNTER</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
                <UnitAI>
                    <UnitAIType>UNITAI_ATTACK_CITY</UnitAIType>
                    <bUnitAI>1</bUnitAI>
                </UnitAI>
            </UnitAIs>
            <NotUnitAIs/>
            <Builds/>
            <ReligionSpreads/>
            <CorporationSpreads/>
            <GreatPeoples/>
            <Buildings/>
            <ForceBuildings/>
            <HolyCity>NONE</HolyCity>
            <ReligionType>NONE</ReligionType>
            <StateReligion>NONE</StateReligion>
            <PrereqReligion>NONE</PrereqReligion>
            <PrereqCorporation>NONE</PrereqCorporation>
            <PrereqBuilding>NONE</PrereqBuilding>
            <OverrideResourceBuilding>BUILDING_MERCENARY_CAMP</OverrideResourceBuilding>
            <PrereqTech>TECH_BRONZE_WORKING</PrereqTech>
            <TechTypes/>
            <BonusType>NONE</BonusType>
            <PrereqBonuses>
                <BonusType>BONUS_COPPER</BonusType>
                <BonusType>BONUS_IRON</BonusType>
                <BonusType>BONUS_OBSIDIAN</BonusType>
            </PrereqBonuses>
            <ProductionTraits/>
            <Flavors/>
            <iAIWeight>10</iAIWeight>
            <iCost>35</iCost>
            <iHurryCostModifier>0</iHurryCostModifier>
            <iAdvancedStartCost>100</iAdvancedStartCost>
            <iAdvancedStartCostIncrease>0</iAdvancedStartCostIncrease>
            <iMinAreaSize>-1</iMinAreaSize>
            <iMoves>1</iMoves>
            <bNoRevealMap>0</bNoRevealMap>
            <iAirRange>0</iAirRange>
            <iAirUnitCap>0</iAirUnitCap>
            <iDropRange>0</iDropRange>
            <iNukeRange>-1</iNukeRange>
            <iWorkRate>0</iWorkRate>
            <iBaseDiscover>0</iBaseDiscover>
            <iDiscoverMultiplier>0</iDiscoverMultiplier>
            <iBaseHurry>0</iBaseHurry>
            <iHurryMultiplier>0</iHurryMultiplier>
            <iBaseTrade>0</iBaseTrade>
            <iTradeMultiplier>0</iTradeMultiplier>
            <iGreatWorkCulture>0</iGreatWorkCulture>
            <iEspionagePoints>0</iEspionagePoints>
            <TerrainImpassables/>
            <FeatureImpassables/>
            <TerrainPassableTechs/>
            <FeaturePassableTechs/>
            <iCombat>4</iCombat>
            <iCombatLimit>100</iCombatLimit>
            <iAirCombat>0</iAirCombat>
            <iAirCombatLimit>0</iAirCombatLimit>
            <iXPValueAttack>6</iXPValueAttack>
            <iXPValueDefense>3</iXPValueDefense>
            <iFirstStrikes>0</iFirstStrikes>
            <iChanceFirstStrikes>0</iChanceFirstStrikes>
            <iInterceptionProbability>0</iInterceptionProbability>
            <iEvasionProbability>0</iEvasionProbability>
            <iWithdrawalProb>0</iWithdrawalProb>
            <iCollateralDamage>0</iCollateralDamage>
            <iCollateralDamageLimit>0</iCollateralDamageLimit>
            <iCollateralDamageMaxUnits>0</iCollateralDamageMaxUnits>
            <iCityAttack>0</iCityAttack>
            <iCityDefense>0</iCityDefense>
            <iAnimalCombat>0</iAnimalCombat>
            <iHillsAttack>0</iHillsAttack>
            <iHillsDefense>0</iHillsDefense>
            <TerrainNatives/>
            <FeatureNatives/>
            <TerrainAttacks/>
            <TerrainDefenses/>
            <FeatureAttacks/>
            <FeatureDefenses/>
            <UnitClassAttackMods/>
            <UnitClassDefenseMods/>
            <UnitCombatMods>
                <UnitCombatMod>
                    <UnitCombatType>UNITCOMBAT_MOUNTED</UnitCombatType>
                    <iUnitCombatMod>100</iUnitCombatMod>
                </UnitCombatMod>
            </UnitCombatMods>
            <UnitCombatCollateralImmunes/>
            <DomainMods/>
            <BonusProductionModifiers>
            </BonusProductionModifiers>
            <iBombRate>0</iBombRate>
            <iBombardRate>0</iBombardRate>
            <SpecialCargo>NONE</SpecialCargo>
            <iSpecialCargoSpace>0</iSpecialCargoSpace>
            <DomainCargo>NONE</DomainCargo>
            <iCargo>0</iCargo>
            <iTotalCargo>0</iTotalCargo>
            <iConscription>4</iConscription>
            <iCultureGarrison>4</iCultureGarrison>
            <iExtraCost>0</iExtraCost>
            <iAsset>2</iAsset>
            <iPower>6</iPower>
            <UnitMeshGroups>
                <iGroupSize>3</iGroupSize>
                <fMaxSpeed>1.75</fMaxSpeed>
                <fPadTime>1</fPadTime>
                <iMeleeWaveSize>3</iMeleeWaveSize>
                <iRangedWaveSize>0</iRangedWaveSize>
                <UnitMeshGroup>
                    <iRequired>3</iRequired>
                    <EarlyArtDefineTag>ART_DEF_UNIT_SPEARMAN</EarlyArtDefineTag>
                </UnitMeshGroup>
            </UnitMeshGroups>
            <FormationType>FORMATION_TYPE_DEFAULT</FormationType>
            <HotKey/>
            <bAltDown>0</bAltDown>
            <bShiftDown>0</bShiftDown>
            <bCtrlDown>0</bCtrlDown>
            <iHotKeyPriority>0</iHotKeyPriority>
            <FreePromotions/>
            <LeaderPromotion>NONE</LeaderPromotion>
            <iLeaderExperience>0</iLeaderExperience>
            <TrainCondition>
                <Not>
                    <Has>
                    <GOMType>GOM_CIVIC</GOMType>
                    <ID>CIVIC_BANDITS</ID>
                    </Has>
                </Not>
            </TrainCondition>
        </UnitInfo>

Did I do something wrong? :confused:

Can my bugs be caused by renaming the mod folder from Rise of Mankind - A New Dawn to Chronicles of Mankind? I don't think it should matter.
 
An other thing:
Is OverrideResourceBuilding tag proved to work fine? Because it doesn't work for me.

I modified a couple of melee units to have <OverrideResourceBuilding>BUILDING_MERCENARY_CAMP</OverrideResourceBuilding> you don't need metal to train mercenaries as they bring their own weapons. But it doesn't work.
View attachment 517552
As you see there is a Mercenary Camp but I still cannot train Spearmen.

Did I do something wrong? :confused:

Can my bugs be caused by renaming the mod folder from Rise of Mankind - A New Dawn to Chronicles of Mankind? I don't think it should matter.

I don't think it works properly at the moment. The tag is currently applied to Fast Battleship in conjunction with Omnifactory. If I set up a coastal city with an Omnifactory but remove Omnifactory's Steel and Oil Products resources, then I can't build a Fast Battleship when I have all techs except Advanced Warmachines. Both resources are red-tagged if I turn on "show untrainable units".
 
I had a look in the debugger and found the following issue:

CvPlot::canTrain(...) fails to check for the unit's OverrideResourceBuilding tag being set. This feature was never implemented for the OR requirement, only the AND requirement.

I've implemented it and it works correctly now

@Zeta Nexus I checked that your xml works just fine with my fix :)
 
Last edited:
So... About Movement Limits: The bug has reappeared while doing my own little modmod changing only XML stuff. I have loaded a save file and the game asked for a recalc so I did so. But ML was nowhere
View attachment 517488
Than I saved the game again, quit, reload and it was back
View attachment 517488
See the tile with the sign on it.

Maybe this behavior has something related to recalc?

Might be connected to recalc then, I'll have a look when I have time.

I had a look in the debugger and found the following issue:

CvPlot::canTrain(...) fails to check for the unit's OverrideResourceBuilding tag being set. This feature was never implemented for the OR requirement, only the AND requirement.

I've implemented it and it works correctly now

Uh, never noticed. I remember I tried that tag and it was working, but maybe something got lost in the update. I'll fix it in the next update. Thanks for pointing it out.
 
There is a another serious issue with the AND requirement as well:

Assert Failed
File: CvCity.cpp
Line: 18082
Expression: eIndex >= 0
Message: eIndex expected to be >= 0
----------------------------------------------------------

Triggers when pCity->getNumRealBuilding() is called with NO_BUILDING. We have to add a check for kUnit.getOverrideResourceBuilding() being valid (i.e. != NO_BUILDING) .
 
Last edited:
By the way, I've been running a debug build and I am seeing several dozen different assertions firing. Some are quite serious, like issues with the training \ building \ plot yield cache which could potentially seriously confuse the AI. I've fixed maybe half a dozen so far (not too bad for a single day of debugging the code base though :p)
 
Last edited:
Might be connected to recalc then, I'll have a look when I have time.
Again, in a later case of recalc this same issue did not reoccur :dunno:

Uh, never noticed. I remember I tried that tag and it was working, but maybe something got lost in the update. I'll fix it in the next update. Thanks for pointing it out.
Could it be also changed so that it checks not for a building <Type> but for a <BuildingClass>? So it would be working with a UB replacement too.
...or make <OverrideResourceBuilding> a list where you can define more building types. Whichever is easier.
 
What kind of tile are you seeing with flood plains? I think all plains and desert tiles adjacent to rivers are automatically supposed to be flood plains, and that doesn't go away when you settle a city there.

I tested it now and looks like razing city adds floodplains only desert and plains (not grass) tiles on river shore. It should add only city ruins. Im sure that this is wasnt happening few revisions ago, im still in 1079 my self.
 
I don't know if it is only me or intended behavior but combat with barbarians not produce slaves even tough enslavement is set to 50% in my own modmod. Is that intended? :confused:
View attachment 517551
There was a turn when around 20 barbarian units (not animals) attacked me in a row, killed them all but no slave was created.

IIRC it's intended. Enslavement ratio is lower when fighting Barbarian units if I'm not mistaken.
 
By the way, I've been running a debug build and I am seeing several dozen different assertions firing. Some are quite serious, like issues with the training \ building \ plot yield cache which could potentially seriously confuse the AI. I've fixed maybe half a dozen so far (not too bad for a single day of debugging the code base though :p)

Would you mind posting your changes here so I can check and upload them in the next update (adding you to the credits page of RAND, of course)? Or you might want to become part of team? About assertions, I know there are some bugs, some are very old, even before I started working on RAND 6 years ago, but to tell the truth I didn't bother to fix them as they were not crippling the game from what I see, so I sticked with "if it's not broken, don't fix it". But we might carefully try to fix those assertions and see what happens. Let me know. :)
 
Why?
And how much less?

I checked the code, no, behaviour is the same for barbarians and other units. Only animals cannot be enslaved because there's the hunt mechanic for that. And sea units because there's war prizes for that. IIRC anyway, if you change the enslavement ratio, make sure you recalc or reload by quitting the game completely before checking if the modified enslavement ratio applies.
 
I checked the code, no, behaviour is the same for barbarians and other units. Only animals cannot be enslaved because there's the hunt mechanic for that. And sea units because there's war prizes for that. IIRC anyway, if you change the enslavement ratio, make sure you recalc or reload by quitting the game completely before checking if the modified enslavement ratio applies.
I had lot's of recalcs followed by many fights with barbarians but never ever enslaved any in my current game. Now I am not at the stage of fighting wars with other civs so I cannot tell if the 50% chance is really 50% chance or not. Will report when I know more...
 
Are you now unable to abandon cities? Have just taken a barbarian city and unable to raze it (it asks to occupy or be released to the Babylonians - minor civ, the original Zulu owners are long dead and the Babylonians turned up next door)

Trying to raze and get told its only possible in cheat mode?
 
City razing has changed, you need to pillage the city to Zero population WHILE it is in anarchy. Each pillage, has a chance to reduce population by 1 pop, and extend the length of anarchy.

No you can't "Auto Raze" a city, only pillage it till zero population, then it will be 'razed'
 
Back
Top Bottom