Skip to main content
Topic: [Bug] Crash on loading saved games (r2218 and above) (Read 3767 times) previous topic - next topic

[Bug] Crash on loading saved games (r2218 and above)

Whenever (more or less) I load a saved game in r2218 and above, I get the following or a similar error:

Code: [Select]
FATAL ERROR: planquadrat_t::rdwr()
Error while loading game: Unknown ground type '-104'
PRESS ANY KEY

I looked into the area of code affected with the debugger, and it did not seem to be related to any of the areas of code on which I have been working (simcity.cc/h and simhalt.cc/h), and so I do not think that it is anything that I have done with my patched version. The problem appears to originate from data corruption in the unzipping process somehow, which is odd, since there is nothing in the log about that being changed recently, and yet load and save worked fine for me until to-day.

I did try at one stage saving a new game, and loading that seemed to work, until I upgraded again to r2221, when loading even that failed. Starting a new game does not appear to be affected (in Pak64 nightly), but I get a similar error, oddly, when starting Pak96 Comic (but did not when I was running r2219). I have to say, this is a very confusing one.

Edit: here is the exact error that I get when starting with Pak96 (not loading a game, just after selecting Pak96 from the Pak selector):

Code: [Select]
FATAL ERROR: dingliste_t::laden()
During loading: Unknown object type '0'
PRESS ANY KEY
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

 

Re: [Bug] Crash on loading saved games (r2218 and above)

Reply #1
For me, it is working nice.

A suggestion: to discard a side-effect of a patch, you can checkout a fresh copy in another directory and try the offending file there.

Re: [Bug] Crash on loading saved games (r2218 and above)

Reply #2
change svaegame format to xml_zipped will give you a much nicer error message near the real error.

Re: [Bug] Crash on loading saved games (r2218 and above)

Reply #3
Ahh, I've solved the problem - it was one of my patches after all. I had added parameters to the city history array, and evidently increased the size of a certain part of the saved game in bytes by doing so. It seems that the save/load routines do not automatically calculate the size of the various parts of the files, so all of the data stored after the city history array effectively became corrupted. This can be marked as solved. Thank you both for your help :-)
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Re: [Bug] Crash on loading saved games (r2218 and above)

Reply #4
FOr that purpose we have the if(file->get_version()<xxx) code all over the program.

Re: [Bug] Crash on loading saved games (r2218 and above)

Reply #5
One day, somebody should write code that automatically checks the size of various parts of the files...
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.