AND2 and SVN Bug Reports - A New Dawn 2 ONLY

Hey guys, can someone please test this for me on your game? I'm not able to build a submarine unless I have both Oil Products AND Uranium, which is plainly wrong. I don't know how long this problem has been around, and I suppose it happens with other units as well. Thank you.

Edit: Damn, I think it's always that code for OverrideResourceBuilding. I'm trying to fix it again.
 
Last edited:
Something is very wrong with movement limits.
I started a new game and it worked. After reloading it, ML is gone and I cannot get it back on.
I tried clearing the cache, deleting the ini files, turning Terrain Damage on and off but I'm clueless (and frustrated).
 
What I found out so far is, that the game does not save (?) ML into the save file. ML is on according to F8 screen but in reality it isn't. Any idea what can cause it?
To make things even stranger ML does work on my Win10 tablet (but it's only good to do some modding at work but not for real playing).
Any ideas? :confused:
 
I really have no clue about what's causing that ML problem. I experienced it myself from time to time. And I'm pretty sure ML is being saved, although for some reason sometimes it's not being saved correctly and for a while (don't ask me why), it looks like it's not possible to switch it on again, even in a different game.
 
Maybe you could ask for help from f1rpo and Nightinggale? They seem to be both talented and helpful.
I may may partially solved this issue back when I performed a code review of AND2. Will have a look through the diffs and my notes. I fixed at least one assert that was related to this.
 
Last edited:
I may may partially solved this issue back when I performed a code review of AND2. Will have a look through the diffs and my notes. I fixed at least one assert that was related to this.
BTW, if you are already touching the dll maybe you could merge your port district too? So 45 and Vokarya can add it to the mod the way they want.
 
I'll look at devolution fixes probably today or tomorrow, and I'll release a new dll with my own fixes today or tomorrow. Then after some testing I'll release devolution fixes as well.
 
I just noticed a glitch with a couple of units; BBM and Plague Bringer have a hidden prerequisite, uranium. They don't require uranium by themselves but since they're considered nukes, you can't build them unless you build First Nuclear Test, which requires uranium. I think we should find a workaround for this, but I'm not sure it's so easy.
 
It seems starting in the modern era with "No Transhuman Era" enabled causes the game to crash as soon as you end your turn.

At least on my end this bug happens 100 percent of the time so hopefully it will be easy to reproduce.
 
Last edited:
Confirming, the CTD is caused by attempting to divide by 0 (where's Chuck Norris when you need him :p )

Steps to reproduce: Just start any custom game in the Transhuman age, then end the first turn.

CvGame::doTurn()

iEraCount is 0 since both eEndEra and eStartEra equal 7 (transhuman)

Code:
 EraTypes eStartEra = getStartEra();
 EraTypes eEndEra = (EraTypes)(isOption(GAMEOPTION_NO_FUTURE) ? GC.getInfoTypeForString("ERA_MODERN") : GC.getNumEraInfos() - 1);
int iEraCount = eEndEra - eStartEra;
//Assuming we divide turns evenly per era
float fExpectedEra = (float)((getElapsedGameTurns() / (float)(iEstimateEndTurn / iEraCount)) + eStartEra);

I suppose the easy fix is to assume that there will always be at least 1 era left, even in a transhuman start.
 
Last edited:
fExpectedEra is only written to a logfile in doTurn. In other words, the same formula is used elsewhere, namely in CvTeam::getResearchCost,
Code:
if (GC.getGameINLINE().isModderGameOption(MODDERGAMEOPTION_REALISTIC_TIMESCALE)) {
    // ...
   float fExpectedEra = (GC.getGameINLINE().getElapsedGameTurns() /
         (fEstimateEndTurn / iEraCount)) + eStartEra;
I assume that will also crash.
 
Never experienced such a crash because I think nobody ever tried the mod that way (it's not designed nor balanced for later starts). I'll fix it in the next update, thanks.
 
Another minor glitch I noticed awhile back is negative Combat Mods don't display right in game with combat odds.
So a entry like this won't display right:
Code:
            <UnitCombatMods>
                <UnitCombatMod>
                    <UnitCombatType>UNITCOMBAT_HELICOPTER</UnitCombatType>
                    <iUnitCombatMod>-250</iUnitCombatMod>
                </UnitCombatMod>
            </UnitCombatMods>

I noticed this when making grenadiers ineffective against helicopters. In game the defense modifier is displayed in green text saying "+250% vs. Helicopter Units"
when viewing combat odds, but in reality they are getting a penalty. Not a huge deal since the meter still gives accurate predictions.
 
Last edited:
Hope the devs don't mind the double post but I also noticed that "BUILDINGCLASS_CORPORATE_ENCLAVE" is using a nonexistent "economy" AI flavor.
Should probably be changed to gold.
 
Hi Guys,

I'm not sure if this is the correct place to report this, but i'm hoping somebody can shed some light on this weird behaviour:

  • 1933 Winter: I'm in a war with Shaka where his strength ratio to mine is approx 1.7ish. We end the end turn and the turn takes an exceedingly long time (10-15 mins), during which he manages to sink my transport fleet.
  • 1933 Summer: Following the long end-of-turn from 1933 Winter and sinking of my fleet, Shaka's strength ratio to me is now ~30.0, the "power" graph shows an huge single turn growth for Shaka, and a stack of ~2200 eemy Mech. Inf. has appeared on my front line.

I've returned to the previous save and used world builder to inspect Shaka's empire, these Mech. Inf. don't existn anywhere and the power graph indicates a gigantic single turn increase in power; its like they are created magically during Shaka's turn. I've observed this earlier in the game where Shaka has had single turn influxes of gold and units. Once he was granted 25000 gold mysteriously in the very early game, and once he was granted a huge influx of units (power ratio went from approx 0.8 to 7.0-8.0 in a single turn). While I found this odd, neither time Shaka was engaged with me in any way so I able mostly ignore it.

Saves attached; hopefully somebody can explain why this is happening.
 

Attachments

Hi Guys,

I'm not sure if this is the correct place to report this, but i'm hoping somebody can shed some light on this weird behaviour:

  • 1933 Winter: I'm in a war with Shaka where his strength ratio to mine is approx 1.7ish. We end the end turn and the turn takes an exceedingly long time (10-15 mins), during which he manages to sink my transport fleet.
  • 1933 Summer: Following the long end-of-turn from 1933 Winter and sinking of my fleet, Shaka's strength ratio to me is now ~30.0, the "power" graph shows an huge single turn growth for Shaka, and a stack of ~2200 eemy Mech. Inf. has appeared on my front line.

I've returned to the previous save and used world builder to inspect Shaka's empire, these Mech. Inf. don't existn anywhere and the power graph indicates a gigantic single turn increase in power; its like they are created magically during Shaka's turn. I've observed this earlier in the game where Shaka has had single turn influxes of gold and units. Once he was granted 25000 gold mysteriously in the very early game, and once he was granted a huge influx of units (power ratio went from approx 0.8 to 7.0-8.0 in a single turn). While I found this odd, neither time Shaka was engaged with me in any way so I able mostly ignore it.

Saves attached; hopefully somebody can explain why this is happening.

Never happened to me before, I'll check the save when I have some time. Which revision are you using?
 
Back
Top Bottom