autosaves setting question

Various topics about the game, the website, or anything else Freeciv related that doesn't fit elsewhere.
Dino the Dinosore
Hardened
Posts: 171
Joined: Sun Dec 31, 2017 3:41 am

autosaves setting question

Post by Dino the Dinosore »

I'd like to turn off the auto saves of every turn globally, but I can't get that to work. When I change the setting in Game Settings - Internal and do the Save button I see a message in the chat log "Saved settings to file ~/.freeciv/freeciv-client-rc-3.0", but when I look that file doesn't contain the string "autosaves", and when I quit and restart the setting has reverted to the default "TURN|GAMEOVER|QUITIDLE|INTERRUPT". I tried manually adding 'autosaves="GAMEOVER|QUITIDLE|INTERRUPT"' to the freeciv-client-rc-3.0 file, but again it reverts to the default when starting. Is this a bug or am I missing something?
This is 3.0.0b3, haven't tried while running 2.6.5.
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: autosaves setting question

Post by cazfi »

Tried this on master (3.2 development version).

I just adjusted the setting in the client UI, clicked "Save", and closed the dialog.

Chat had:
Saved settings to file /home/cazfi/.freeciv/freeciv-client-rc-3.2
cazfi: 'set autosaves "GAMEOVER|QUITIDLE|INTERRUPT"'
Console: 'autosaves' has been set to "Game over", "No player connections", and "Server interrupted" (GAMEOVER|QUITIDLE|INTERRUPT).
Note the order of the messages! Apparently when you click just "Save" without Applying the changes first, the old (still in effect) settings get saved.

When I first applied the changes and then saved, it properly appeared to freeciv-client-rc-3.2

I can't reproduce the part that it would revert to the default when you start the client. For me it's properly in effect.
Did you add it to the correct section (server) ?
Dino the Dinosore
Hardened
Posts: 171
Joined: Sun Dec 31, 2017 3:41 am

Re: autosaves setting question

Post by Dino the Dinosore »

Thanks, you are correct - doing Apply and then Save works. And yes the file has to have it in the server section.
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: autosaves setting question

Post by cazfi »

Dino the Dinosore
Hardened
Posts: 171
Joined: Sun Dec 31, 2017 3:41 am

Re: autosaves setting question

Post by Dino the Dinosore »

Poking at this some more in 3.0.0b3, I'm seeing a bug with some of the supplied rulesets. I did the apply and save, and my freeciv-client-rc-3.0 file contains autosaves="GAMEOVER|QUITIDLE|INTERRUPT". Start the client, choose "Start New Game", from next dlog choose "More Game Options" and under Internal tab see that "New turn" checkbox is not checked. Cancel the dlog, and then choose a ruleset and press Start. Default & civ2civ3 rulesets work as expected , but for the classic, experimental & sandbox rulesets, once the game is started "New turn" autosaves happen, and when you look at the "Remote Server" options Internal tab the "New turn" checkbox is checked.

This would be understandable if those rulesets had, in their game.ruleset file [settings] section,
"autosaves" "TURN|GAMEOVER|QUITIDLE|INTERRUPT"
But they don't.

Same thing seen in 2.6.4.
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: autosaves setting question

Post by cazfi »

Dino the Dinosore wrote:see that "New turn" checkbox is not checked. Cancel the dlog, and then choose a ruleset and press Start. Default & civ2civ3 rulesets work as expected , but for the classic, experimental & sandbox rulesets, once the game is started "New turn" autosaves happen
Likely because server resets settings before loading a new ruleset (so that the settings from the old ruleset will not remain with the new ruleset). If you don't change the ruleset, but keep on using default = civ2civ3, there's no such reset.
Maybe client just doesn't send server settings again when ruleset is changed, or does it at wrong time (before the reset)

In general this "server settings saved on client side for single-player games" is known to be full of issues (thanks for reminding about it, I don't use it myself and we don't have many tickets about it, so I had sort of forgotten about it). One workaround for the time being is to create my_options.serv -file (one can do that from current server settings by "/write my_options.serv"), which should then be available as one of the "ruleset" options, in versions earlier than freeciv-3.2 (in 3.2 the detection of the rulesets is no longer tied to the .serv files)
nef
Elite
Posts: 324
Joined: Mon Jun 25, 2018 5:01 pm

Re: autosaves setting question

Post by nef »

This problem of not actually saving server options for any ruleset other than default has been discussed many times in the past (including by me) but as I recall all such complaints were ignored. Being underwhelmed by this I just made it a habit of placing options in the settings section of game.ruleset or, as suggested, some .serv file. Figuring out the names can be a chore and /w file is a way to deal with this but it would help if it worked. Depending on the way fc is installed the 'data' directory may be protected and the write will fail. Options like this should go where options should go - in the client`s directory; not the server`s.

Another easy way to deal with this is to trick the server into thinking your ruleset is the default. All you have to do is edit default.serv.
nef
Elite
Posts: 324
Joined: Mon Jun 25, 2018 5:01 pm

Re: autosaves setting question

Post by nef »

nef wrote: Options like this should go where options should go - in the client`s directory; not the server`s.
And it should be the client that does this thus avoiding the timing problem identified in the ticket.
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: autosaves setting question

Post by cazfi »

nef wrote:This problem of not actually saving server options for any ruleset other than default has been discussed many times in the past (including by me) but as I recall all such complaints were ignored.
And where is that bug report ticket you're reported?

I opened a new one now: https://osdn.net/projects/freeciv/ticket/43747
cazfi
Elite
Posts: 3069
Joined: Tue Jan 29, 2013 6:54 pm

Re: autosaves setting question

Post by cazfi »

cazfi wrote:I opened a new one now: https://osdn.net/projects/freeciv/ticket/43747
I have a mostly working patch for that one, but it's of limited use as other bugs in the area interfere, e.g., https://osdn.net/projects/freeciv/ticket/43748
Post Reply