The crash has been banished! v85 now stable

Rhye

's and Fall creator
Joined
May 23, 2001
Messages
9,895
Location
Japan / Italy / Germany
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.

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:
Excellent work, can't wait to play the latest version. Does this mean that there may be more features in the future.
 
Excellent work, can't wait to play the latest version. Does this mean that there may be more features in the future.

I'm referring to the incomplete stuff: first of all historical victories and stability. But there is even more than that. All of which has been halted because I gave priority to that crash, as it was spoiling the game.
 
Incredible!! As someone else who's wrestled with crashes, amazing job tracking it down!! In particular, I used to have Barbarian Cities as a part of my mod, but disabled them because I too suspected them of crashes, even with the Pantheon/Religion fix in place. I guess I can re-add them :)

Also, I don't really post here that often, but I still come by from time to time to check progress. Congrats on all the development! Mod is looking great!
 
Incredible!! As someone else who's wrestled with crashes, amazing job tracking it down!! In particular, I used to have Barbarian Cities as a part of my mod, but disabled them because I too suspected them of crashes, even with the Pantheon/Religion fix in place. I guess I can re-add them :)

Also, I don't really post here that often, but I still come by from time to time to check progress. Congrats on all the development! Mod is looking great!

Jiska, always great to hear from you!
 
Nicely done with that investigation, narrowing it down farther and farther until finding the culprit. As a programmer, I know how annoying those sorts of non-reproducible, seemingly random bugs are. All the more so when there's third-party code without the source involved in the problem.

I might have to play another game of Civ V now that I know RFC for Civ V is so far along. I think it was about two years ago when I last ventured into the Civ V forums, somehow I saw this in the Similar Threads today and I'm glad I did. I played so many RFC for Civ IV games back in the day... don't think I ever got a historic victory but it was fun, and probably my most-played mod.
 
Due to the holidays my experiences with v.85 a little late:

I played as Portugal, Austria, England, East as well as West Rome and at the moment I´m trying my luck with Arabia. With Austria and England I played into the 20th century and the contemporary era. No crashes so far. The only thing I had was that in my game with Arabia the rilgions overview is saying that there are no world religions. Save-game is attached!

Just a view things I noticed:

As East Rome I almost had no contact with barbarians. Probably the Persian Empire blocked some for me but as they were my friends I was able to fully concentrate on then huns and could easily defend myself. As West Rome barbarian hordes appeared often and made it necessary to leave garrisons in Gaul and Spain and it was not so easy to form a invasion force for Carthage or Greece

Playing the Portugese I first noticed that is not possible to build uo trading routes with cargo ships through the street of Gibraltar and found it confirmed in my games with the Roman Empires, Austria and now Arabia that I trading routes can´t lead out of the Mediterranean. Is that intentional?

The minor civ Mediterranean Cities has no border growth

I think it was already mentioned: in my opinion nothern Italy´s stability map should be fixed at least for the Roman Empire. It is orange for every civ

Corea science seems to be overpowered: the are ahead in every game and build almost every wonder before someone else could even research the necessary techs.

One funny thing: In my game as Arabia the huns razed all cities but Cairo, Jerusalem (city states) and Constantinople (still Eastern Roman Empire) in Europe, Persia and India! You can see the still empty India and almost emtpy Persia (I found the city on the southern coast of the caspian sea only after the Ottomans have spawned) in the save game I attached.
 

Attachments

  • Harun al-Rashid_0416 AD-1556.Civ5Save
    1.3 MB · Views: 15
RnF85 Play experience: I must be missing something really fundamental here !?
I have about 12 year's Civ experience, so I am familiar with normal Civ5 routine.
Are there known Mod conflicts ... I use several.
PROBLEMs:
[*] Unable to move Bowman except by "Auto-Explore" ... Same is true for other units.
Using <M> + Left-click at "1" or Right-click at desired destination does nothing ;(
https://steamcommunity.com/sharedfiles/filedetails/?id=2861406891
[*] Turn 0 ... No Production units, etc. available ... No output results shown for Food, Gold, etc., although there is output evident {from Palace} when Autoplay is engaged ... NO City Name on label ... Same held true for many "Auto" turns.
https://steamcommunity.com/sharedfiles/filedetails/?id=2861406910
[*] Checking what is going on in capital {NO NAME in widget} using InGame Editor, Palace was the only building, but this was not shown in City Screen. I inserted Granary & Monument to see whether they would register {they did not}.
Palace was providing only output ... WHAT are those “Dummy ..” items ??
https://steamcommunity.com/sharedfiles/filedetails/?id=2861406929
[*] After several turns, City Screen still shows NO Buildings {not even Palace} ...
Even after InGame Editor insertion of Granary & Monument !!
https://steamcommunity.com/sharedfiles/filedetails/?id=2861406940
[*] <F2> Economics panel - Outputs shown but only ZERO's shown in City Screen ? ...
2 gold Expense for Buildings but NO Buildings other than Palace - & even Palace doesn't show in City Screen.
https://steamcommunity.com/sharedfiles/filedetails/?id=2861406949
[*] Turn 17: Only Production is "1. FINISHED" ... Nothing is available under any category - Clicking yields nothing. Same has been true since turn 0 ... Only game progress is by “Autoplay”.
https://steamcommunity.com/sharedfiles/filedetails/?id=2861406956
 
dangerous waters disappear when in a city borders. Trade route should be possible then.
How can I download this mod? I look forward to trying it, I love RFC and its related modmods for Civ 4.
 
Top Bottom