Page 1 of 2

autosaves setting question

Posted: Sun Jan 16, 2022 12:15 am
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.

Re: autosaves setting question

Posted: Sun Jan 16, 2022 8:47 am
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) ?

Re: autosaves setting question

Posted: Sun Jan 16, 2022 9:14 pm
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.

Re: autosaves setting question

Posted: Wed Jan 26, 2022 5:03 am
by cazfi

Re: autosaves setting question

Posted: Sat Jan 29, 2022 7:53 pm
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.

Re: autosaves setting question

Posted: Sun Jan 30, 2022 8:26 am
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)

Re: autosaves setting question

Posted: Mon Jan 31, 2022 4:00 pm
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.

Re: autosaves setting question

Posted: Mon Jan 31, 2022 6:23 pm
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.

Re: autosaves setting question

Posted: Tue Feb 01, 2022 1:56 am
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

Re: autosaves setting question

Posted: Tue Feb 01, 2022 2:54 am
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