Log files : Constant crashing when attempting to load save games

Question

King
Joined
Mar 12, 2008
Messages
950
Ive noticed that when i try to load a save game when im already in a game, or exit to main menu, the game will typically crash to desktop. No error message and i cant see anything in database or lua log files...are there any other log files i should be checking?
 
this is fairly common depending on which mods you are running and what kind of files they have within them. I found that Info Addict would generally behave this way. Not sure if there are other 'prime culprit' mods that might be causing this.
 
Ah thanks. I didnt delete anything from a main table, so thats fine, but i am running info addict. Is there anything i can do to make infoaddict crash the game less?
 
Other than to stop using it, no not really. I seem to remember the author of that mod specifically mentioned (perhaps in the mod comments on Steam?) that not completely exiting the game from a game-in-progress was causing this sort of problem for many players, and there didn't seem to be much he could do about it. It only seems to cause the problem as I recall when you have a game loaded and running and you try to either (a) load a saved game (b) exit to the main menu.
 
Im confused, how else are you supposed to load a save game if not loading it or exiting to the main menu first?
 
It only seems to cause the problem as I recall when you have a game loaded and running and you try to either (a) load a saved game (b) exit to the main menu.
I guess I should have been a bit more clear and said already have a game set-up and running (or a saved-game loaded and running)

Im confused, how else are you supposed to load a save game if not loading it or exiting to the main menu first?
The problem only seems to occur when you are already fully in a game.

(1) It does not generally occur because of InfoAddict when you start CIV5 from your desktop, go through the MODS menu, and then select either SET-UP GAME or LOAD SAVED GAME.

(2) At that point, after you push the START YOUR JOURNEY or CONTINUE YOUR JOURNEY button, is where InfoAddict can cause the crash issue if you then go directly to the MENU, and then select either LOAD SAVED GAME (with a game already in-progress) or EXIT TO MAIN MENU (with a game already in-progress).

(1) and (2) are different conditions. InfoAddict causing this sometimes (or all the time for some players) seems to be related to the way InfoAddict needs to initialize itself when the mod is activated. Pre-existing data within the InfoAddict "system" seems to cause problems. I think it is related to the same reasons that the mod author specifically mentions that in order to get InfoAddict to work properly you must have InfoAddict activated as mod when you first start a new game through the SET-UP GAME menu.
 
We used to have lots of problems from loading without exiting in Éa or using the Restart Game button. Then I saw a post that tipped me off that MapModData isn't cleared out in these cases. That's a pretty serious problem since we rely on that "super-global" table a lot (and at least some other mods do too -- I don't know specifically about InfoAddict).

The fix was easy. I just added this in mod init code:
Code:
for k, v in pairs(MapModData) do
	MapModData[k] = nil
end
After that, Éa players have reported no problems loading from within a game or using Restart Game.


Edit: the original problem we had wasn't CTD specifically. But that could happen depending on what a specific mod is doing with the data in MapModData.
 
LeeS : Yea, but i meant, if you are already in a game, how else can you load a save game without going to the load save game menu or exiting to the main menu first?

Pzyryk : How would you add that code to another mod though? Is there a way to do that?
 
LeeS : Yea, but i meant, if you are already in a game, how else can you load a save game without going to the load save game menu or exiting to the main menu first?
You exit to windows, and then fire CIV5 back up. This and the fact that for me InfoAddict seemed to be a real processor/memory hog is one reason why I stopped using an otherwise pretty cool mod.
 
Pzyryk : How would you add that code to another mod though? Is there a way to do that?
Good question, but I don't really know the answer. Actually, a better question is: How do I make that code run before any other mod uses MapModData? It doesn't matter what mod runs it because all mods share this table. If your mod replaces (for example) AssignStartingPlots.lua, then you can be sure that that code runs before other mod's code is loaded. But that's not a very good answer.

It kind of depends on when that mod modifies/uses MapModData. If it is altered/used during mod loading, then you would have to clean up MapModData before the other mod loads (and my solution above is the only thing I can think of). If the other mod only uses MapModData after the game starts, then you could run that code in your mod's main block (i.e., outside of a function) and that would work.

Really, the burden should be on the modder that uses MapModData. Any mod that uses this table extensively but does not clear it out on loading is broken (since it breaks loading from within a game and possibly also Restart Game function).

To be complete, I should say that it isn't really necessary to "empty it out" completely. It's just necessary to reset values that the mod uses. For example, if you have some value MapModData.bMyModSomethingHappened, then you really need to assign that to false in your init code. Some modders will rely on the "nil working like false" property and not init that value expecting it to be nil (equivalent to false) at game start. But it may not be if the player loads a game from within a game.
 
I did notice that if i used tactical view instead of strategic view, i wouldnt crash when loading save games within a game...anyone elee noticed that?

Paz : Hypothethically could you make a new mod to do nothing except clear the MapModData?
 
Top Bottom