The International Simutrans Forum

 

Author Topic: Game wont load.  (Read 334 times)

0 Members and 1 Guest are viewing this topic.

Offline thegamer7893 england

  • *
  • Posts: 780
  • Languages: EN
Game wont load.
« on: June 19, 2019, 05:02:20 PM »
Hi, when I go to open the latest nightly build of Simutrans Extended, it shows a message displaying fatal error. Picture below.


Offline ACarlotti

  • *
  • Posts: 451
Re: Game wont load.
« Reply #1 on: June 19, 2019, 05:20:58 PM »
Thanks for reporting. This has been diagnosed in https://forum.simutrans.com/index.php/topic,15716.msg180463.html#msg180463; just waiting now for James to incorporate the fix.
In the meantime you could probably work around this by deleting or temporarily moving simutrans-extended.xml (in the same directory as the save directory); this might affect any settings you have saved to that file, but most important things are overwritten by settings in simuconf.tab anyway.

Offline Matthew

  • *
  • Posts: 165
  • Languages: EN, some ZH, DE & SQ
Re: Game wont load.
« Reply #2 on: June 19, 2019, 07:08:15 PM »
Yesterday, I was about to run the Nightly Updater and thought, "I'll check the forum first, just in case anything's broken." I saw ACarlotti's message and felt like I'd just missed stepping into a puddle. I don't know what timezone you're in, Mr (?) Carlotti, but it's a good thing that you were around to check the nightly as soon as it hit the server! Thank you.

So the last good copies of the .exes and extended-settings are available here if anyone wants them. I don't think they will help if you want to play the online games though, since there'll be a mismatch.

Offline wlindley us

  • Devotee
  • *
  • Posts: 965
    • Hacking for fun and profit since 1977
  • Languages: EN, DE
Re: Game wont load.
« Reply #3 on: June 19, 2019, 07:28:21 PM »
The format of ~/simutrans/settings-extended.xml has changed.  Despite this ostensibly being a text format, any change in the internal structure results in a mismatch of the binary format, giving a crash like this.

If it were a proper XML format, instead of having records like `<i8>3</i8>` (some un-named 8-bit integer value; all values in the file must be in precisely the correct order; otherwise boom, crash) it would have values like `<default_mountain_height>3</default_mountain_height>`.  The whole point of XML is to prevent these kind of fatal errors.  Along with other poorly-documented binary formats (I have been repeated admonished Do Not Attempt To Write A Program That Reads The .dat Format, a curiously anti-Free-Software attitude), Simutrans needs a lot of work on its I/O.

Solution:  Remove ~/simutrans/settings-extended.xml  (adjust accordingly if you're on Windows)
« Last Edit: June 19, 2019, 08:17:56 PM by wlindley »

Offline ACarlotti

  • *
  • Posts: 451
Re: Game wont load.
« Reply #4 on: June 19, 2019, 09:39:44 PM »
it's a good thing that you were around to check the nightly as soon as it hit the server!
Actually, I run local builds, so probably tested this an hour or two before it became the new nightly. (I then realised I'd built the wrong version for my intended testing because the server was still on an older version).

The XML format is just an XML-ised version of the binary save format, and the same load/save code is used for both the settings and for savegames. The XML file probably easier to manually edit the binary format, but that file is not intended to be manually edited - all settings intended to be configured in a file are in simuconf.tab.

As for "poorly-documented binary formats" - basically the best documentation for this is generally going to be the code (although in the case of the .pak files there is enough extra structure that some external help text could be written for parts of it). If documentation were provided separately to the code, then it would probably soon become inaccurate as features were added to the code. There's nothing to stop someone writing some documentation and trying to maintain it, but personally I'd probably look at the code first if I needed to know what something did.

I don't see anything inherently wrong with writing a program to read any file formats in use; you'd just need to accept taht for the binary (or xml-ised binary) formats you'd likely need to base the parser upon a copy of the relavant parts of the main source code, and be willing to update it whenever the sve or pak object versions are changed.
« Last Edit: June 19, 2019, 09:52:17 PM by ACarlotti »

Offline thegamer7893 england

  • *
  • Posts: 780
  • Languages: EN
[Will the bug be fixed?] Game wont load.
« Reply #5 on: June 21, 2019, 09:48:36 AM »
Hi, when I go to open the latest nightly build of Simutrans Extended, it shows a message displaying fatal error. Picture below.



This bug has still not been fixed.

Offline jamespetts gb

  • Simutrans-Extended project coordinator
  • Moderator
  • *
  • Posts: 18619
  • Cake baker
    • Bridgewater-Brunel
  • Languages: EN
Re: Game wont load.
« Reply #6 on: June 22, 2019, 10:59:04 AM »
My apologies for the difficulty. This error was caused by an change to the format of ~/simutrans/settings-extended.xml without properly incrementing the saved game version. The fix has now been incorporated. A workaround is to delete ~/simutrans/settings-extended.xml (your settings, such as language, will be reset). However, if you delete ~/simutrans/settings-extended.xml to get it to work with the current version with the error, you will need to do this again when the fixed version becomes available.