News:

Simutrans.com Portal
Our Simutrans site. You can find everything about Simutrans from here.

Lost the ability to load savegames

Started by Ves, January 15, 2018, 11:02:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Ves

It appears that I have lost the ability to load any savegames, including the demo.sve in the paksetfolder. I have had to delete that in order to make the game startup at all, but this very much hinders my possibilities to work on some of the bugs that I have to do.
This is also true for the nightly version. I have to delete the demo.sve in order to start the game.

Since I have not heard about this anywhere in the forum, am I alone with this problem?
In which case, here are some details of what I have noticed. And please hold on to your hat and scarf, the results are very complicated.... :

* Fresh on, downloading the nightly without touching anything other than "singleuser_install = 1". Open the game, press "Pak128.Britain-Ex" and the pak starts loading. Upon finished loading, the select language appears. "English" is pressed, and the game continue with "Loading Map" and the according progress bar. But when the progress bar is complete, the game crashes and a window appears that it has stopped working.

* When deleting the demo.sve (along with all autosaves) the game starts loading a random generated map. Pressing "load game" opens the (very empty) menu with savegames.

* If I open msvs2015 and attempt a debug build, this is the call stack:
> Simutrans-Extended-debug.exe!std::_String_val<std::_Simple_types<char> >::_Myptr() Line 512 C++
Simutrans-Extended-debug.exe!std::_String_alloc<std::_String_base_types<char,std::allocator<char> > >::_Myptr() Line 567 C++
Simutrans-Extended-debug.exe!std::basic_string<char,std::char_traits<char>,std::allocator<char> >::c_str() Line 1728 C++
Simutrans-Extended-debug.exe!gui_loadsave_table_row_t::get_pak_extension() Line 35 C++
Simutrans-Extended-debug.exe!gui_file_table_pak_column_t::get_text(const gui_table_row_t & row) Line 289 C++
Simutrans-Extended-debug.exe!gui_file_table_pak_column_t::compare_rows(const gui_table_row_t & row1, const gui_table_row_t & row2) Line 273 C++
Simutrans-Extended-debug.exe!gui_table_row_list_t::compare_items(const gui_table_row_t * item1, const gui_table_row_t * item2) Line 332 C++
Simutrans-Extended-debug.exe!list_tpl<gui_table_row_t>::qsort(int l, int r) Line 389 C++
Simutrans-Extended-debug.exe!list_tpl<gui_table_row_t>::sort() Line 471 C++
Simutrans-Extended-debug.exe!gui_table_t::sort_rows() Line 281 C++
Simutrans-Extended-debug.exe!savegame_frame_t::list_filled() Line 312 C++
Simutrans-Extended-debug.exe!savegame_frame_t::fill_list() Line 291 C++
Simutrans-Extended-debug.exe!savegame_frame_t::infowin_event(const event_t * event) Line 488 C++
Simutrans-Extended-debug.exe!create_win(int x, int y, gui_frame_t * gui, wintype wt, int magic) Line 655 C++
...... etcetcetc....

The top three are greyed out.

* I can save a new game and reload it without problems.

* I can connect to the servergame without troubble (If I first delete the demo.sve so the game can start), however the game crashes after a while, and the server seems to loose the progress I did. Have attemptet this for a few days.


I initially wrote alot more steps, but when double checking, it suddently started or stopped working and it appears to be a bit random. The points above seemed quite consistent, thoug.

jamespetts

As on the other thread, I think that this is a bug fixed in the latest commits and will be available in the next nightly.
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.

Ves

I still cannot load savegames when I am self compiling. I had some issues yesterday when trying to set it up thoug, the compiler threw some random errors, which sometimes resolved them self, sometimes I had to do some editing in the settings (after search on google).

jamespetts

Can you load saved games with the binaries from the server?
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.

Ves

Yes, the downloaded nightly loads the demo.sve as well as I can open the window with other saves. The saves are stored locally (singleuser_install=1), in the same fashion as the compiler version. I copyed the entire save-folder from the "compiler"-version and putted in the nightly version and the window opens fine.

jamespetts

What do you mean by "open the window" here?
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.

Ves

Sorry, I mean with the nightlies, I can open the "load game" window and load a savegame without any problems.
On my self compiled builds, the game crashes when I try to open the "load game" dialog. When the button is pressed, the game freezes for a brief moment and then exits itself with a error window.

Almost as if its the "load game" window itself that is the problems, and not the savegames within (which I thought initially).
A quick test:
Creating a new game and close the game so it generates an autosave. Upon restarting the game, the autosave is loaded. But as soon as I press load game (either by shortcut, or in the menu or start screen) the game crashes.

jamespetts

This is a different problem entirely, I think. It is odd that your self-compiled build should differ. Can you produce a backtrace?
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.

Ves

I think I need some help with how to do that..

jamespetts

At the command line, type "gdb simutrans-extended" (in the path where the executable is located). This will start the debugger interface. At the resulting prompt, type "run". Simutrans-Extended will then start. Do what you need to do in Simutrans-Extended to reproduce the crash. When it occurs, on the command line (still in the debugger), type "backtrace". Copy and past the resulting output to this thread.
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.

Ves

So, installed the programs needed and this is the results:

What I did:
When the game opens, I select the pakset. When the new game dialog is shown I press the "load game"
Using commit: 7c327719466df5e7242ffaacf670b5613463aea0

Backtrace in a release build:
Starting program: C:\Users\Victor\Documents\GitHub\simutrans-experimental\simutrans/Simutrans-Extended.exe
[New Thread 7464.0x19b0]
[New Thread 7464.0x1940]
[New Thread 7464.0xd1c]
[New Thread 7464.0xd18]
[New Thread 7464.0xe3c]
[New Thread 7464.0xd10]
[New Thread 7464.0xd20]
[New Thread 7464.0xd4c]
[New Thread 7464.0xe60]
[New Thread 7464.0xd50]
[New Thread 7464.0xd44]
[New Thread 7464.0xd64]
[New Thread 7464.0xd68]
[New Thread 7464.0xd7c]
[New Thread 7464.0xd38]
[New Thread 7464.0xd78]
[New Thread 7464.0xd6c]
[New Thread 7464.0xd54]
[New Thread 7464.0xf3c]
[New Thread 7464.0x16b8]
[New Thread 7464.0x948]
[New Thread 7464.0x25d8]
[New Thread 7464.0x19e8]
[New Thread 7464.0x1528]
[New Thread 7464.0x1640]
[New Thread 7464.0x175c]
[New Thread 7464.0x176c]
[New Thread 7464.0x1688]
[New Thread 7464.0x2ec]
[New Thread 7464.0x2220]
[New Thread 7464.0x18dc]
[New Thread 7464.0x1a20]
[New Thread 7464.0x1788]
[New Thread 7464.0x1aec]
[New Thread 7464.0x1b00]
[New Thread 7464.0x1878]
[New Thread 7464.0x1e1c]
[New Thread 7464.0x2528]
[New Thread 7464.0x23c0]
[New Thread 7464.0x1c80]
[New Thread 7464.0x938]
[New Thread 7464.0x24d4]

Program received signal SIGSEGV, Segmentation fault.
0x0056f83f in ?? ()
(gdb)


Backtrace in debug build:
Starting program: C:\Users\Victor\Documents\GitHub\simutrans-experimental\simutrans/Simutrans-Extended.exe
[New Thread 5744.0xa34]
[New Thread 5744.0x2358]
[New Thread 5744.0x11a8]
[New Thread 5744.0x808]
[New Thread 5744.0x6f4]
[New Thread 5744.0x1aec]
[New Thread 5744.0x1c80]
[New Thread 5744.0x18dc]
[New Thread 5744.0x19e8]
[New Thread 5744.0x938]
[New Thread 5744.0x1788]
[New Thread 5744.0x1e1c]
[New Thread 5744.0x176c]
[New Thread 5744.0x1878]
[New Thread 5744.0x1b00]
[New Thread 5744.0x19b0]
[New Thread 5744.0x175c]
[New Thread 5744.0x16b8]
[New Thread 5744.0x948]
[New Thread 5744.0x25d8]
[New Thread 5744.0x2528]
[New Thread 5744.0x1940]
[New Thread 5744.0x2510]
[New Thread 5744.0x2644]
[New Thread 5744.0x2438]
[New Thread 5744.0x1f58]
[New Thread 5744.0xf64]
[New Thread 5744.0x1f90]
[New Thread 5744.0x23e0]
[New Thread 5744.0x20f0]
[New Thread 5744.0x394]
[New Thread 5744.0x278c]
[New Thread 5744.0x1fc8]
[New Thread 5744.0x5a0]
[New Thread 5744.0x1cbc]
[New Thread 5744.0x1408]
[New Thread 5744.0x2664]
[New Thread 5744.0x2484]
[New Thread 5744.0x26f8]
[New Thread 5744.0x18d0]
[New Thread 5744.0x202c]
[New Thread 5744.0x994]

Program received signal SIGSEGV, Segmentation fault.
0x0056f83f in ?? ()
(gdb)


This appears to be quite some sparse information, did I do it right?

jamespetts

You do not appear to have compiled with debug symbols enabled. May I ask what options that you used to compile the debug build?
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.

Ves

I am using the MSVS2015, and I only change the dropdown menu from "release" to "debug". I tried to read up on it online, but came to no easy conclusion at the time...

jamespetts

Ahh, I think that I might have posted some of the above instructions in the mistaken belief that you were compiling on Linux - my apologies. May I ask what project file that you are using?
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.

Ves

I am using this file:

Simutrans-Extended.vcxproj

jamespetts

Do you only see the "debug" and "release" configurations, or do you see a great number of different configurations?
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.

Ves

This is the options given:



Further down on the dropdown list is the options for:

"Release (SDL)"
"Release (single threaded)"
"Release SDL"
and
"Configuration Manager"

jamespetts

May I suggest trying "Debug (open GL)" with x64? That is what I now use as default.
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.

Ves

It complains that it cannot find SDL.h when I set it to that. Now I have found those files online, but where should I put them? If I just "include" them, just like the OpenTTD files are included, nothing seems to happen.

jamespetts

You can put the files anywhere - but you then need to configure the project's properties to look for them in the place that you have put them. The .h files need to be pointed to as the "includes" folder, and the .lib files as the "libraries" folder.
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.

Ves

I struggle to get it working. I have created a new folder, similar to the OpenTTD -folder. I have then included both the two folders holding the files in the project properties, in the same fields as where it looks for the OpenTTD files. Did I have to do something else too?

jamespetts

May I ask what errors that you are now getting?
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.

Ves

I get the same error, "Cannot open include file: 'SDL.h': No such file or directory"

jamespetts

May I ask what your include folders are for this particular build configuration?
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.

Ves

This is how it looks like in MSVS 2015:



Obviously, the files also exist in those locations, and I can confirm that SDL.h indeed is located in the folder.

jamespetts

I am afraid that I am having trouble understanding what the difficulty can be in these circumstances. Are you sure that \SDL Library\ is only one level up from the directory in which the project file is located?
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.

Ves

OH NOO... I realize that Im changing the configurations for the "Debug" build, not the "Debug (openGL)" build!  :o :redx:

Quickly changing to the correct build and now it goes further!

However, now a new bunch of errors comes forward:

1>------ Build started: Project: Simutrans-Extended, Configuration: Debug (open GL) x64 ------
1>  C:\Users\Victor\Documents\GitHub\simutrans-experimental\revision.jse(9, 1) WshShell.Exec: The system cannot find the file specified.
1>
1>
1>loadsave.obj : error LNK2019: unresolved external symbol BZ2_bzReadOpen referenced in function "public: bool __cdecl loadsave_t::rd_open(char const *)" (?rd_open@loadsave_t@@QEAA_NPEBD@Z)
1>loadsave.obj : error LNK2019: unresolved external symbol BZ2_bzReadClose referenced in function "public: char const * __cdecl loadsave_t::close(void)" (?close@loadsave_t@@QEAAPEBDXZ)
1>loadsave.obj : error LNK2019: unresolved external symbol BZ2_bzRead referenced in function "private: int __cdecl loadsave_t::fill_buffer(int)" (?fill_buffer@loadsave_t@@AEAAHH@Z)
1>loadsave.obj : error LNK2019: unresolved external symbol BZ2_bzWriteOpen referenced in function "public: bool __cdecl loadsave_t::wr_open(char const *,enum loadsave_t::mode_t,char const *,char const *,char const *,char const *)" (?wr_open@loadsave_t@@QEAA_NPEBDW4mode_t@1@0000@Z)
1>loadsave.obj : error LNK2019: unresolved external symbol BZ2_bzWrite referenced in function "private: void __cdecl loadsave_t::flush_buffer(int)" (?flush_buffer@loadsave_t@@AEAAXH@Z)
1>loadsave.obj : error LNK2019: unresolved external symbol BZ2_bzWriteClose referenced in function "public: char const * __cdecl loadsave_t::close(void)" (?close@loadsave_t@@QEAAPEBDXZ)
1>..\OpenTTD\win64\library\libbz2.lib : warning LNK4272: library machine type 'X86' conflicts with target machine type 'x64'
1>.\simutrans\Simutrans-Extended-debug.exe : fatal error LNK1120: 6 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


Changing the target to a win32 build (and changing the corresponding settings) makes it indeed compile!
Only the SDL2.dll is needed.
Having downloaded SDL2.dll, it now complaints with a sign:
"The procedure entry point SDL_GetDisplayDPI could not be located in the dynamic link library"
What do you make of that?

jamespetts

The unresolved external symbol errors suggest that you do not have the correct bzip libraries specified; can you check whether you have changed the settings for these in the "Debug (open GL)" 64-bit configuration to point to the correct (64-bit) bzip libraries, too?
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.

Ves

#28
I seem to recall problems with this file some time ago, although that was the 32-bit version. The way we solved that then was that I got a copy from you. This time, however, I found it separately from the internet and downloaded it along with putting libbz.dll into the target directory, and now the game compiles but I simply get a sign telling me:
"The application was unable to start correctly (0xc000007b). Click OK to close the application."

Lastly, how do I sync with your Github now when I have altered the "Simutrans-Extended.vcxproj" file by doing those additions? It wont let me sync due to it thinking it will overwrite the file.
Gosh, I feel stuck  :o


edit:
So, it seems as the nightly build DO crash also, but only on random occasions. Currently, I cannot load a game at all with the nightly build.
I have uploaded my entire save folder to Github and the files are located here: https://github.com/VictorErik/saved-games/tree/master/master/Random%20savegame%20crash
To reproduce (as good as it might go), make a backup of your entire "save" folder and move to a secure place. Then empty the folder and fill in with all my savegames. Now the game should hopefully crash when you press the "load game" button. I seemed to narrow it down to the file called "Gsö-Gsoe - Test.sve" and was quite sure that it was the case that the game could not read the "ö" sign, but during testing the "load game" dialog loaded fine when that file was the only save. And then during the further testing it worked great having all files in the save folder. And then it crashes.. and then it works.. Very strange everything.

Incidentally, if you get the "load game" dialog to appear, load the game called "My_fair_Lady_12-passenger-classes.sve". After the game has loaded the game will crash in 5 seconds.

jamespetts

The "The application was unable to start correctly (0xc000007b). Click OK to close the application." error is due to a missing .dll file: you need to download the 64-bit version of SDL2.dll from the SDL2 website.

I will have a look at the crashes reported in the saved game presently.

Edit: I am afraid that I cannot find the files to which you refer on Github. Are you sure that you have uploaded them?
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.

Ves

Im still uploading the savegame folder, its quite big!

I did download the 64-bit version of that dll, since a previous error sign told me to do that. This sign comes after I have done that.

Edit:
NOW it came online: https://github.com/VictorErik/saved-games/tree/master/master/Random%20savegame%20crash

jamespetts

#31
Thank you for uploading that: I will look into that in a moment.

In relation to your trouble in running your self-compiled build, may I suggest using Dependency Walker to work out what dependencies that you are missing?

Edit: I have found and fixed a specific bug that caused that particular saved game to crash - would you be able to re-test? I should be most grateful.
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.

Ves

In order to be able to start coding a little again, I think I will revert my setup to what is working (normal debug/release 32-bit).
That savegame loads fine now without any crashing, thanks!

Did you have any luck in identifying what was crashing the game when pressing "load game"?


jamespetts

Since I have never been able to reproduce this, I am afraid that I do not have any reasonable way of diagnosing this issue. I am glad that you have managed to get compiling working again, however.
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.