Dedi Mutliplayer not saving map locally

Arrange meetings with other people to play MP, announce your servers.
User avatar
MindlessMe
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Aug 29, 2015 11:55 pm
Contact:

Dedi Mutliplayer not saving map locally

Post by MindlessMe »

I am hosting a multiplayer headless server on a dedicated server host, and for some odd reason it is not saving the game on that box. Instead it is saving the game on my local machine. In order to keep the map updated I am having to upload the file to the dedicated server every time I finish playing. Is there something I am missing here?
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: Dedi Mutliplayer not saving map locally

Post by Oxyd »

Can you post the log from the server? Also, can you check that the saves directory is actually writeable by the server?
User avatar
MindlessMe
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Aug 29, 2015 11:55 pm
Contact:

Re: Dedi Mutliplayer not saving map locally

Post by MindlessMe »

Oxyd wrote:Can you post the log from the server? Also, can you check that the saves directory is actually writeable by the server?
When you say log are you talking about a text log made by the game server or a screenshot of the command prompt? It looks like the save directory is definitely writable. I attempted to login, make an alteration, then click save. When the game came back up the changes were there. It looks like I could be exiting the game without clicking save on my end? So does that mean the game server will not actually save progress without the players physically clicking save? Does the headless server work with save interval commands and things of that nature?
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: Dedi Mutliplayer not saving map locally

Post by Oxyd »

MindlessMe wrote:
Oxyd wrote:Can you post the log from the server? Also, can you check that the saves directory is actually writeable by the server?
When you say log are you talking about a text log made by the game server or a screenshot of the command prompt? It looks like the save directory is definitely writable. I attempted to login, make an alteration, then click save. When the game came back up the changes were there. It looks like I could be exiting the game without clicking save on my end? So does that mean the game server will not actually save progress without the players physically clicking save? Does the headless server work with save interval commands and things of that nature?
I mean the text file.

Clicking save in the GUI should only save it for you and no one else, not even for the server. However, the server should be making autosaves just like anyone else. Also, there is a Factorio console command – /c game.server_save() – that will make the server save the game.
User avatar
MindlessMe
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Aug 29, 2015 11:55 pm
Contact:

Re: Dedi Mutliplayer not saving map locally

Post by MindlessMe »

Oxyd wrote:
MindlessMe wrote:
Oxyd wrote:Can you post the log from the server? Also, can you check that the saves directory is actually writeable by the server?
When you say log are you talking about a text log made by the game server or a screenshot of the command prompt? It looks like the save directory is definitely writable. I attempted to login, make an alteration, then click save. When the game came back up the changes were there. It looks like I could be exiting the game without clicking save on my end? So does that mean the game server will not actually save progress without the players physically clicking save? Does the headless server work with save interval commands and things of that nature?
I mean the text file.

Clicking save in the GUI should only save it for you and no one else, not even for the server. However, the server should be making autosaves just like anyone else. Also, there is a Factorio console command – /c game.server_save() – that will make the server save the game.
That is interesting, and odd considering it is saving the changes when I connect to the server again. Would that command have to be entered every time I want it to save or can it be set to save with an interval? Also, is there a variable I can add to the server startup that will make it save periodically?
(e.g.

Code: Select all

+server.saveinterval "90"
)

Thanks for getting back with me on this so quickly. We have been enjoying the game and really just looking for the best way to make multiplayer an even more awesome experience.
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: Dedi Mutliplayer not saving map locally

Post by Oxyd »

You have to run server_save manually each time you want it.

But like I said, the server should have autosaves just like everyone else. You can set the autosave interval by passing the --autosave-interval parameter, e.g.

Code: Select all

./factorio --start-server map --autosave-interval 5
to autosave every five minutes. If you don't use --autosave-interval, it will default to an autosave every 2 minutes. In other words, it should be saving automatically already.
MindlessMe wrote:it is saving the changes when I connect to the server again.
Do you mean you connect to the server and then it saves?
User avatar
MindlessMe
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Aug 29, 2015 11:55 pm
Contact:

Re: Dedi Mutliplayer not saving map locally

Post by MindlessMe »

Oxyd wrote:You have to run server_save manually each time you want it.

But like I said, the server should have autosaves just like everyone else. You can set the autosave interval by passing the --autosave-interval parameter, e.g.

Code: Select all

./factorio --start-server map --autosave-interval 5
to autosave every five minutes. If you don't use --autosave-interval, it will default to an autosave every 2 minutes. In other words, it should be saving automatically already.
MindlessMe wrote:it is saving the changes when I connect to the server again.
Do you mean you connect to the server and then it saves?
Sorry for the confusion. If I login to the server, make a change, then click save via the menu it actually saves to the server. I can save it, exit, reload, and the changes I just made show up. My friend notices that the game is saving to his local machine as well, and is labeled as an autosave. We are in the middle of Diablo 3 Season 4 so I will look into altering some things in a few and report back. I am going to attempt changing the save file info and a few other small things before I declare anything major. Thanks again.
User avatar
MindlessMe
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Aug 29, 2015 11:55 pm
Contact:

Re: Dedi Mutliplayer not saving map locally

Post by MindlessMe »

MindlessMe wrote:
Oxyd wrote:You have to run server_save manually each time you want it.

But like I said, the server should have autosaves just like everyone else. You can set the autosave interval by passing the --autosave-interval parameter, e.g.

Code: Select all

./factorio --start-server map --autosave-interval 5
to autosave every five minutes. If you don't use --autosave-interval, it will default to an autosave every 2 minutes. In other words, it should be saving automatically already.
MindlessMe wrote:it is saving the changes when I connect to the server again.
Do you mean you connect to the server and then it saves?
Sorry for the confusion. If I login to the server, make a change, then click save via the menu it actually saves to the server. I can save it, exit, reload, and the changes I just made show up. My friend notices that the game is saving to his local machine as well, and is labeled as an autosave. We are in the middle of Diablo 3 Season 4 so I will look into altering some things in a few and report back. I am going to attempt changing the save file info and a few other small things before I declare anything major. Thanks again.
Alright so here is what I have done:

I deleted all save files from the dedicated server.
Deleted all save files from my computer.
Dropped the save file(SAVE1) onto the dedicated server.


Results:

After wiping and starting with the latest save(SAVE1) the game is saving at regular intervals, but is saving to autosave files and not the original save file(SAVE1). It is also saving the autosave files to my local machine(Server is running on a dedi), which is not an issue since it allows me a backup. Even though the client is not using the original save file(SAVE1) it seems to be loading up the latest autosave when I exit and log back in. All in all it works out as long as the server doesn't decide to use the original save file like it did before.

Before cleaning up the saves it would always revert back to SAVE1 and not load the latest autosave file. There was a possible conflict with the save files on the dedicated computer running the headless server and my local machine? I tried saving the game manually through the menu and it still seems to be fine. Saved the game using a random name and as SAVE1 and so far no issues. Not entirely sure what caused the conflict earlier, but it seems to be fixed.
Oxyd
Former Staff
Former Staff
Posts: 1428
Joined: Thu May 07, 2015 8:42 am
Contact:

Re: Dedi Mutliplayer not saving map locally

Post by Oxyd »

MindlessMe wrote:the game is saving at regular intervals, but is saving to autosave files and not the original save file(SAVE1).
That is correct. Autosaving doesn't – and never did – overwrite the original save.
MindlessMe wrote:It is also saving the autosave files to my local machine(Server is running on a dedi)
Also correct behaviour.
MindlessMe wrote:Even though the client is not using the original save file(SAVE1) it seems to be loading up the latest autosave when I exit and log back in.
I don't understand this. When you log into a server, it will send you the current map and your client will load it. You do not load any of the saves in your saves folder in this case.
MindlessMe wrote:All in all it works out as long as the server doesn't decide to use the original save file like it did before.
The server uses whatever save you tell it to use when you start it.
MindlessMe wrote:Before cleaning up the saves it would always revert back to SAVE1 and not load the latest autosave file.
So you would log out of the server, log back in and your changes were gone? That sounds horribly wrong. Or did you restart the server in between? If so, how exactly did you stop it and how exactly did you start it?
User avatar
MindlessMe
Burner Inserter
Burner Inserter
Posts: 6
Joined: Sat Aug 29, 2015 11:55 pm
Contact:

Re: Dedi Mutliplayer not saving map locally

Post by MindlessMe »

Oxyd wrote:
MindlessMe wrote:Even though the client is not using the original save file(SAVE1) it seems to be loading up the latest autosave when I exit and log back in.
I don't understand this. When you log into a server, it will send you the current map and your client will load it. You do not load any of the saves in your saves folder in this case.
Okay, thanks for the clarification on this. I am used to server clients that save directly to the original save file when they save periodically. Since the server doesn't save to the original save file during the interval save it threw me off.
Oxyd wrote:
MindlessMe wrote:All in all it works out as long as the server doesn't decide to use the original save file like it did before.
The server uses whatever save you tell it to use when you start it.
Knowing the server only pulls data on startup only helps, thanks!
Oxyd wrote:
MindlessMe wrote:Before cleaning up the saves it would always revert back to SAVE1 and not load the latest autosave file.
So you would log out of the server, log back in and your changes were gone? That sounds horribly wrong. Or did you restart the server in between? If so, how exactly did you stop it and how exactly did you start it?
Considering what you have told me regarding the save file and how/when it is accessed I am 100% sure it was my fault. I am pretty sure it was after the newest update and I took the server down without saving it properly. Since I didn't save it using the command line it was loading the save file we used to start the server before(roughly 4 hours earlier). Of course the game was actually saving with autosaves so I just loaded one of those on the dedi and no harm done. Since I know how the game handles save files I shouldn't have anymore issues with this.

Thanks a ton for explaining this. It goes a long way to ensure we keep playing. Keep up the great work!
Post Reply

Return to “Multiplayer”