News:

The Forum Rules and Guidelines
Our forum has Rules and Guidelines. Please, be kind and read them ;).

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

Started by jamespetts, January 07, 2009, 12:08:36 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

jamespetts

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


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):


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.

isidoro

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.

prissi

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

jamespetts

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.

prissi

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

jamespetts

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.