Rhye
's and Fall creator
It took almost one year, but finally it's gone.
I'm talking about the crash that has been plaguing games after entering the Industrial era, particularly difficult to find because it's not reproducible: when you reload the savegame, it doesn't happen. Also no trace written in the logs.
Here's the story of how I did it.
As written in an earlier thread, first I tried to debug the DLL, with no luck as the source code is not shown at the moment of the crash.
Suspecting a cause related to memory management, first I tried to limit the number of units, then I even drew a smaller map. These were not the solution, but thanks to the lighter map it became much easier to autoplay and reload, trial-and-error, many times.
From a given savegame, deleting certain civs from the map (one by one, half of them, only Barbarians, only Minor civs) did not prove to be conclusive: in the end crashes were happening in any case.
Then I started reasoning on the time variable: why does it never happen until Renaissance?
So I tried to disable all techs from Industrial. And indeed crashes didn't happen. Reenabling some modern techs seemed also to be okay. But trying and trying again showed that Industrial techs were the culprit, in particular 3 of them, which I identified: Industrialization, Flight and Radar.
That's easy now! I thought. First I bet on the Airship. Disabled it: no luck, it crashes. Maybe it was the airport? Nope, same.
Finally the paradox: when these 3 techs are all 3 of them disabled it works. If I disable their contents (for example, Ironclad, Big Ben etc.) and I leave just the empty tech, it crashes...
This means there's something weird with those techs. In the XML all seems in order. And all the units and buildings contained, in fact, when moved out and assigned to another tech, don't seem to cause any issue.
The final proof: what if I replace one of those 3 techs with another one and change its name? So I disabled Flight, added Ballistics, renamed it Flight, and moved all the units and buildings inside it. Well, as long as the original Flight stays disabled, apparently it works...
So I thought that's the way to go. Replace all 3 of them with fake ones.
Before finalising this change, I recalled that I also necessarily had to update a few lines in the code, because Barbarians should never create airports. If they do, the DLL will crash because it would look for a capital that doesn't exist. Now, this is a fix that I made long ago, but now if I move all the contents of Flight into Ballistics I should also set Barbarians to never research Ballistics, right?
So I find the lines in the code and I see that I previously wrote specific instructions to make sure that every turn Barbarians don't have those dangerous techs, and I find:
barbarianPlayer [...] SetHasTech( [...]"TECH_RADAR", false )
barbarianPlayer:[...] SetHasTech( [...]"TECH_FLIGHT", false )
barbarianPlayer:[...] SetHasTech( [...]"TECH_INDUSTRIALIZATION", false )
Suspicious isn't it?
If I delete these instructions, the game crashes immediately, as aircrafts and airports will cause it to happen. But with these instructions, something weird apparently happens and it will crash later on without any sign in the log of the possible reason. Simply, when some other civ researches one of those 3 techs, something inexplicable goes wrong inside the DLL.
Then the fix to do was clear: Barbarians shall NOT EXIST in Industrial times and beyond. In particular, they should never hold any city. In Rhye's and Fall they usually do, and after Industrial Era they are simply renamed Terrorists.
So here's the fix: the Terrorists are set now as a separate new minor civ, and Barbarians are not allowed anymore to be created after Renaissance. All their cities are converted to Terrorist civ at a given time.
Done. Autoplay can last until 2100 and beyond.
This is now a quite stable release. It means that the next version we can resume expanding - the missing victories and stability management. For now you can enjoy this stage.
- revised rules for stability being labelled shaky or solid (temporary measure until the system to move points from one category to another is properly working)
- fixed wrong stability and respawn regions for Rome, Germany, Russia and Japan
- added a possible respawn for Rome and Constantinopolis city states in 1500
- increased barbarians in India
- removed wrong cattle placement in the ocean
- reduced maximum number of missile cruiser, destroyer, galleass, frigate and battleship
- updated city renames
- postponed starts of Russia, Germany, Kiev, Yax Mutal; anticipated Austrian start
- major civ respawns slightly more frequent
- gold rate per turn also counted in economic stability
- the Huns will not attack the Papal State
- minor Lisbon and Amsterdam will spawn even if the area is crowded
- customs houses cannot be build adjacent
- crash of Industrial Era resolved! As a consequence, the Terrorists will be a minor civ on its own rather than being a rename of Barbarians
I'm talking about the crash that has been plaguing games after entering the Industrial era, particularly difficult to find because it's not reproducible: when you reload the savegame, it doesn't happen. Also no trace written in the logs.
Here's the story of how I did it.
As written in an earlier thread, first I tried to debug the DLL, with no luck as the source code is not shown at the moment of the crash.
Suspecting a cause related to memory management, first I tried to limit the number of units, then I even drew a smaller map. These were not the solution, but thanks to the lighter map it became much easier to autoplay and reload, trial-and-error, many times.
From a given savegame, deleting certain civs from the map (one by one, half of them, only Barbarians, only Minor civs) did not prove to be conclusive: in the end crashes were happening in any case.
Then I started reasoning on the time variable: why does it never happen until Renaissance?
So I tried to disable all techs from Industrial. And indeed crashes didn't happen. Reenabling some modern techs seemed also to be okay. But trying and trying again showed that Industrial techs were the culprit, in particular 3 of them, which I identified: Industrialization, Flight and Radar.
That's easy now! I thought. First I bet on the Airship. Disabled it: no luck, it crashes. Maybe it was the airport? Nope, same.
Finally the paradox: when these 3 techs are all 3 of them disabled it works. If I disable their contents (for example, Ironclad, Big Ben etc.) and I leave just the empty tech, it crashes...
This means there's something weird with those techs. In the XML all seems in order. And all the units and buildings contained, in fact, when moved out and assigned to another tech, don't seem to cause any issue.
The final proof: what if I replace one of those 3 techs with another one and change its name? So I disabled Flight, added Ballistics, renamed it Flight, and moved all the units and buildings inside it. Well, as long as the original Flight stays disabled, apparently it works...
So I thought that's the way to go. Replace all 3 of them with fake ones.
Before finalising this change, I recalled that I also necessarily had to update a few lines in the code, because Barbarians should never create airports. If they do, the DLL will crash because it would look for a capital that doesn't exist. Now, this is a fix that I made long ago, but now if I move all the contents of Flight into Ballistics I should also set Barbarians to never research Ballistics, right?
So I find the lines in the code and I see that I previously wrote specific instructions to make sure that every turn Barbarians don't have those dangerous techs, and I find:
barbarianPlayer [...] SetHasTech( [...]"TECH_RADAR", false )
barbarianPlayer:[...] SetHasTech( [...]"TECH_FLIGHT", false )
barbarianPlayer:[...] SetHasTech( [...]"TECH_INDUSTRIALIZATION", false )
Suspicious isn't it?
If I delete these instructions, the game crashes immediately, as aircrafts and airports will cause it to happen. But with these instructions, something weird apparently happens and it will crash later on without any sign in the log of the possible reason. Simply, when some other civ researches one of those 3 techs, something inexplicable goes wrong inside the DLL.
Then the fix to do was clear: Barbarians shall NOT EXIST in Industrial times and beyond. In particular, they should never hold any city. In Rhye's and Fall they usually do, and after Industrial Era they are simply renamed Terrorists.
So here's the fix: the Terrorists are set now as a separate new minor civ, and Barbarians are not allowed anymore to be created after Renaissance. All their cities are converted to Terrorist civ at a given time.
Done. Autoplay can last until 2100 and beyond.
This is now a quite stable release. It means that the next version we can resume expanding - the missing victories and stability management. For now you can enjoy this stage.
Rhye’s and Fall v85 changelog
- increased overall tech cost and reduced growth- revised rules for stability being labelled shaky or solid (temporary measure until the system to move points from one category to another is properly working)
- fixed wrong stability and respawn regions for Rome, Germany, Russia and Japan
- added a possible respawn for Rome and Constantinopolis city states in 1500
- increased barbarians in India
- removed wrong cattle placement in the ocean
- reduced maximum number of missile cruiser, destroyer, galleass, frigate and battleship
- updated city renames
- postponed starts of Russia, Germany, Kiev, Yax Mutal; anticipated Austrian start
- major civ respawns slightly more frequent
- gold rate per turn also counted in economic stability
- the Huns will not attack the Papal State
- minor Lisbon and Amsterdam will spawn even if the area is crowded
- customs houses cannot be build adjacent
- crash of Industrial Era resolved! As a consequence, the Terrorists will be a minor civ on its own rather than being a rename of Barbarians
Last edited: