[BNW] Nasty CTD

Infixo

Deity
Joined
Jan 9, 2016
Messages
4,015
Location
Warsaw
I am testing a mod and I have a nasty CTD that I'm trying to locate and fix. Could use some help since I am out of ideas. The mod is not complicated, updates buildings and units, few policies, and has 5 Lua functions registered with GameEvents. Database validity checks are ok, all objects work as intended, the gameplay is ok.
I call it 'nasty' because:
  • It happens on AI turn during Firetuner's autoplay but if I do this turn manually it doesn't happen. I don't even have to do any action as human player i.e. I put all units on sleep or alert and it's ok.
  • But when I tigger auto-play again, CTD happens in 1 or 2 turns. It works like clockwork.
  • Also, after analyzing 6 of them, I cannot see any similarities in terms of gameplay situation. However, it happens in the very specific spot in terms of internal game processes (see later).
  • They happen with various Civs, sometimes even in the same game. I.e. CivA crashes, after reload and doing some manual turns, CivB may crash.
  • They happen on various turns, even with the same game, when I do some turns manually, I can postpone it. The game crashes somewhere around T280-T320, basically at the beginning of Industrial Era, if I start game in Ancient Era. If I start e.g. in Renaissance, it happens little later, like at the end of Industrial Era.
  • It's not related to Lua. I commented out all Lua functions and it still happens.
The logs doesn's say much. Here is some analysis.

Example. CTD on turn 300. Turn 299 ok, Turn 300 Poland ok, then Netherlands crashed. From the logs:
  • GrandStrategy went ok.
  • TechAI went ok.
  • most of DiplomacyAI went ok, some was done for Poland but not for Netherlands
  • CustomMods and PlayerHomelandAI show that Netherlands' turn was not completed [BTW, anyone knows exactly what these logs are for?]
  • All other logs either show nothing from turn 300 or only show completed Poland and no Netherlands entries.
Out of the 2 I've concluded only this:
  • Netherlands was at war with Mongolia and took Kabul at turn 299
  • In CustomMods there's part about choosing construction projects in cities (ok) and there's no part about choosing next attack target
  • PlayerHomelandAI shows that Netherlands chose new combat classes for Kabul (naval) and there's no part with unit movements
It looks as if after taking Kabul the AI was thinking what to do next and where to move units and it crashed.
OR maybe I'm reading those two logs wrong. If they are OK then the problem might lie with DiplomaticAI modules - they are partially processed.

Last thing - the CTD always happens in the same place when looking into CustomMods.csv log. Previous Civ entries finish, and new Civ entries start with <turn, civ, city is the best city to construct building> entries. And that's all - there's no section <distance map between cities> and attacks info.

Well, that's all. Any idea what is going on? Not expecting the solution, rather looking for ideas what should I check, what might cause this, or did you encounter anything similar?

[I've posted logs from last CTD, Zulus at turn 293 if anyone would like to get deeper]
 

Attachments

  • Crash Zulus T293.zip
    8.4 MB · Views: 107
Last edited:
Top Bottom