The International Simutrans Forum

 

Author Topic: Automatic savegame location possible to change?  (Read 207 times)

0 Members and 1 Guest are viewing this topic.

Offline Bobylein

  • *
  • Posts: 3
  • Languages: DE, EN
Automatic savegame location possible to change?
« on: January 15, 2020, 02:06:35 AM »
Hi, I love what you are doing and how complex it makes Simutrans!

Right now I am in the process of setting up a Simutrans server via Docker, it all works except saving, as the server saves into its main directory which I don't want to add to a persistent volume as it would cause more problems. I understand that in the standard version the savegames are saved inside the save directory?

Is there any command to change the savegame location in extended to use the save folder instead of the main working directory?

I already tried to set singleuser_install to 0, it still insists on using the working directory.

Offline Freahk

  • *
  • Posts: 450
  • Languages: DE, EN
Re: Automatic savegame location possible to change?
« Reply #1 on: January 15, 2020, 02:37:54 AM »
If you refer to the server<port>-network.sve, It should be saved in ~/simutrans by default (singleuser_install=0)
In case of singleuser_install=1 it will be stored in the same directory where the binary is located.

I don't think you can tell simutrans to save this anywhere else. You could watch the file and copy it over when it's changed or use some kind of cow filesystem

Offline Bobylein

  • *
  • Posts: 3
  • Languages: DE, EN
Re: Automatic savegame location possible to change?
« Reply #2 on: January 15, 2020, 11:33:57 AM »
Yea I figured that out from the config but my binary is in ~/simutrans-dir/ and I am using singleuser_install=0, still the savegames get saved inside the binary directory.

Gonna try your suggestion with copying it and look into cow filesystems, thanks for the help!

Offline Freahk

  • *
  • Posts: 450
  • Languages: DE, EN
Re: Automatic savegame location possible to change?
« Reply #3 on: January 15, 2020, 12:26:23 PM »
Afaik docker makes use of CoW anways to overlay the image with the writable container, so using this should be the way to go here.
I guess this mechanism is what you refered to as "add to a persistent volume", but I am not quite sure.

If your binary is located in ~/simutrans, for sure changing singleuser_install won't make any difference, as your install dir is simply the same as the ~/simutrans dir.

Offline Bobylein

  • *
  • Posts: 3
  • Languages: DE, EN
Re: Automatic savegame location possible to change?
« Reply #4 on: January 15, 2020, 01:45:30 PM »
Quote
If your binary is located in ~/simutrans, for sure changing singleuser_install won't make any difference, as your install dir is simply the same as the ~/simutrans dir.
Yea, that's why I said that I put the Binary into ~/simutrans-dir/

Quote
I guess this mechanism is what you refered to as "add to a persistent volume", but I am not quite sure.

Right, the problem would obviously be, that docker saves the entire folder in a volume which is far from ideal, that's why I extended the bash script that starts the server, to copy the savegames into a mounted volume every minute. Now I can also do direct backups without using the docker interface.

If anyone is interested, I gonna upload the container to git sometime soon (just need to make it less horrible) and then post the link here

Offline Freahk

  • *
  • Posts: 450
  • Languages: DE, EN
Re: Automatic savegame location possible to change?
« Reply #5 on: January 15, 2020, 01:56:13 PM »
Why is overlaying the whole dir with a writable layer far from ideal?

Also note, that you should be able to overlay single files, instead of whole directories with a layer mount.

Btw. how does your server handle automatic nightly updates if the game install dir is not persistent? Do you mount the underlying game installation layer persistently to run the updater?