Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. "Read more...":https://support.plan.io/news/187

Feature #662023

closed

Store remaining turn timeout in savegame

Added by Andreas Røsdal almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Server
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

Store remaining turn timeout in savegame, and restore the remaining turn timeout when loading that savegame.
This has been requested by participants in the 250-player LongTurn game on Freeciv-web.


Files

PhaseSecondsSave.patch (659 Bytes) PhaseSecondsSave.patch Marko Lindqvist, 2017-05-25 02:37 PM
PhaseSecondsSave-2.patch (735 Bytes) PhaseSecondsSave-2.patch Marko Lindqvist, 2017-05-25 02:42 PM
0030-Use-phase_seconds-from-the-savegame.patch (3.81 KB) 0030-Use-phase_seconds-from-the-savegame.patch Marko Lindqvist, 2017-06-03 12:39 PM
andreas_T81_2017-07-11-21_14.sav.xz (513 KB) andreas_T81_2017-07-11-21_14.sav.xz Andreas Røsdal, 2017-07-11 09:18 PM
0003-Use-phase_seconds-from-the-savegame.patch (4.56 KB) 0003-Use-phase_seconds-from-the-savegame.patch Marko Lindqvist, 2017-07-11 09:40 PM

Related issues

Blocks Freeciv - Task #656466: S3_0 datafile format freeze (d3f)ClosedMarko Lindqvist2019-10-05

Actions
Blocks Freeciv - Feature #660202: Update scenarios to S3_0 formatClosedMarko Lindqvist

Actions
Actions #1

Updated by Marko Lindqvist almost 6 years ago

  • Sprint/Milestone set to 3.0.0
Actions #2

Updated by Marko Lindqvist almost 6 years ago

  • Blocks Task #656466: S3_0 datafile format freeze (d3f) added
Actions #3

Updated by Marko Lindqvist almost 6 years ago

Better to store time since turn start than remaining time, for handling later changes to timeout setting correctly. This includes the case where there was no timeout set before saving, but it gets set after savegame has been loaded.

Actions #4

Updated by Marko Lindqvist almost 6 years ago

Actions #5

Updated by Marko Lindqvist almost 6 years ago

Saving part (to get savegame format updated already)

Actions #6

Updated by Marko Lindqvist almost 6 years ago

- Fixed crash when timer is not initialized (saving outside phase)

Actions #7

Updated by Marko Lindqvist almost 6 years ago

Untested patch for value loading + using part

Actions #8

Updated by Marko Lindqvist over 5 years ago

Marko Lindqvist wrote:

Untested patch for value loading + using part

Andreas, can you test if it works?

Actions #9

Updated by Andreas Røsdal over 5 years ago

I tried applying the patch to Freeciv-web, but the patching failed.
This was rejected:

if (game.server.phase_timer != NULL) {
secfile_insert_int(saving->file,
- timer_read_seconds(game.server.phase_timer),
+ timer_read_seconds(game.server.phase_timer)
+ + game.server.additional_phase_seconds,
"game.phase_seconds");
}

I'm currently on vacation, so I will not be able to do any actions on this. Any help with this would be much appreciated.

Actions #10

Updated by Marko Lindqvist over 5 years ago

Andreas Røsdal wrote:

I tried applying the patch to Freeciv-web, but the patching failed.

First patch/part is already in. Maybe you tried to reapply it?

Actions #11

Updated by Andreas Røsdal over 5 years ago

I suggest that you please commit this to git, and I will test it once it is there. It seems likely to work, and took some effort to test. Thanks for fixing this.

Actions #12

Updated by Marko Lindqvist over 5 years ago

So I guess this has to wait until I have time to setup some basic testing to know it doesn't break anything.

Actions #13

Updated by Andreas Røsdal over 5 years ago

Tested by first applying PhaseSecondsSave-2.patch, then 0030-Use-phase_seconds-from-the-savegame.
Now the patch applies without any problems.

Tested loading one of the LongTurn savegames, which is attached. The savegame now contains phase_seconds=153.

However, when loading the savegame, the timeout starts at exactly 23 hours still. I therefore don't think the patch correctly loads and sets the remaining timeout when loading the game.

Actions #14

Updated by Marko Lindqvist over 5 years ago

It was just the client display of remaining timeout that was still wrong.

Actions #15

Updated by Andreas Røsdal over 5 years ago

I think this works OK now.

Actions #16

Updated by Jacob Nevins over 5 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF