Page 1 of 1

Assertion on save

Posted: 09 Apr 2005 19:38
by Maverick
Originally I believed this bug to be caused, or influenced, by bjarni's clone patch. After all, it was his patch that allowed me to reach this number of vehicles (thanks bjarni!).

Crash conditions: Create 10 ships from the ship depot to the south of where you first start (there are two ships already setup ready to clone from(or any other location), then save. It will assert on save.
OR
Create 3+ trains from the trains headed to the southern locations. I suggest you create them identically to the other trains running there, as these were the situations I created. On saving, an assertion will occur.

The savegame is below.
http://members.iinet.net.au/~cdebruyne/crashsave.rar



Suspects :
1. Simply the sheer number of vehicles
2. Too many trains/ships sharing a single set of orders
3. Savegame corruption

This savegame has been through nightlies 2144 through 2173. It has also been through various versions of the clone patch by bjarni.

Help? :(

Posted: 09 Apr 2005 20:59
by Darkvater
1. Building 10 ships from Pruningstone Ship Depot - save ok
2. Just build 27 passanger wagons and save:

Code: Select all

openttd: saveload.c:129: SlWriteSimpleGamma: Assertion `i < (1 << 14)' failed.
Conclusions:
- it would've been nice to say what assertion you get
- it would also been nice to tell exactly what to do or buy...eg experiment a bit to find out what is causing the problem. Your description was at best pretty vague.

The current maximum vehicle count in the game is 16384. Actually it's a bit more tricky cause the moment you have a vehicle with v->index >= 16384 this will crash.
All vehicles include all shadows, effects, etc. etc. Also most likely this will not be fixed before 0.4.0 :( Just don't build so many vehicles :P

Culprit - too many vehicles

Posted: 10 Apr 2005 03:02
by Maverick
Thanks DarkVater!

I'm kinda sad that it's the "end of the line" (boom boom tish), but hey.
Although a question : Why make the maximum number of trains 5'000 if the maximum vehicle limit is 16384? That's only 3.2 cars per train... :)

0.4.0 is coming with a fully variable vehicle limit yeah?

Posted: 10 Apr 2005 06:17
by Darkvater
Darkvater wrote:Also most likely this will not be fixed before 0.4.0 :(
Ok, now read this again ;). The problem is in the saveload code, as you've noticed you can build a ton of vehicles without saving your game. Changing the saveload code to accomodate this is that much work that it's unplausible to do just before the release.