The International Simutrans Forum

Development => Patches & Projects => Incorporated Patches and Solved Bug Reports => Topic started by: arbitraryname on December 17, 2021, 06:11:01 PM

Title: Save file won't load and crashes application
Post by: arbitraryname on December 17, 2021, 06:11:01 PM
Not sure if this is the right place to post, but I have one save file which crashes Simutrans when I try to load it. All other save files load fine. Previous save files of the same game load fine also, and I didn't do anything unusual when saving this latest version of the game. Would someone be able to have a look?

The save file can be found here https://drive.google.com/file/d/1bw2O4JzH16d7Y9UldOFAKnu25DkL_v8R/view?usp=sharing
I'm using simutrans version 122.0 and the latest version of Pak128.Britain
Title: Re: Save file won't load and crashes application
Post by: Dwachs on December 17, 2021, 10:10:34 PM
The file loads fine with current nightly. The pak128.Britain version on my computer might not be up-to-date, but no problems.
Title: Re: Save file won't load and crashes application
Post by: ceeac on December 18, 2021, 07:25:31 AM
The crash was already fixed in r9700. However, valgrind still complained about uninitialized values when opening the save, this should be fixed now (r10295), too.

EDIT: Running the save in a local server causes a desync immediately after connection:

--- heavy-server-0002.sve
+++ heavy-client-0002.sve
@@ -14613716,22 +14613716,22 @@
   <i16>400</i16>
   <i16>125</i16>
   <koord>
    <i16>129</i16>
    <i16>485</i16>
   </koord>
   <i32>58</i32>
   <i8>0</i8>
   <i8>0</i8>
   <![CDATA[Passagiere]]>
-  <i16>625</i16>
-  <i16>0</i16>
+  <i16>628</i16>
+  <i16>125</i16>
   <koord>
    <i16>364</i16>
    <i16>611</i16>
   </koord>
   <i32>22</i32>
   <i8>0</i8>
   <i8>0</i8>
   <![CDATA[Passagiere]]>
   <i16>492</i16>
   <i16>125</i16>
@@ -14613956,22 +14613956,22 @@
   <i16>141</i16>
   <i16>125</i16>
   <koord>
    <i16>516</i16>
    <i16>801</i16>
   </koord>
   <i32>12</i32>
   <i8>0</i8>
   <i8>0</i8>
   <![CDATA[Passagiere]]>
-  <i16>801</i16>
-  <i16>0</i16>
+  <i16>215</i16>
+  <i16>125</i16>
   <koord>
    <i16>397</i16>
    <i16>593</i16>
   </koord>
   <i32>31</i32>
   <i8>0</i8>
   <i8>0</i8>
   <![CDATA[Passagiere]]>
   <i16>389</i16>
   <i16>125</i16>


Seems like 2 ware_t packets take different routes on the client and on the server.
Title: Re: Save file won't load and crashes application
Post by: Dwachs on December 18, 2021, 11:27:10 AM
Cannot reproduce the desync :/
Title: Re: Save file won't load and crashes application
Post by: ceeac on December 19, 2021, 11:15:58 AM
I managed to reproduce it when starting the server with -pause and server_frames_per_step=1 and for some reason when frames_per_second=60 (frames_per_second=5 does not produce a desync).
Title: Re: Save file won't load and crashes application
Post by: Dwachs on December 19, 2021, 11:55:55 AM
With these settings I get desyncs as well.
Title: Re: Save file won't load and crashes application
Post by: prissi on December 19, 2021, 01:37:31 PM
Does frames_per_second=60 work with a normal savegame? Given the actual timer resolution, I wonder if these are accurate enough for network games. I think very few people used ever values higher than 25.
Title: Re: Save file won't load and crashes application
Post by: ceeac on December 19, 2021, 02:53:50 PM
Yes. In addition, starting the server without the -pause switch does not cause a desync.
Title: Re: Save file won't load and crashes application
Post by: Dwachs on December 20, 2021, 08:30:48 PM
Found and fixed in r10304