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...

Feature #662023

Store remaining turn timeout in savegame

Added by Andreas Røsdal almost 4 years ago. Updated almost 4 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.

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)Closed2019-10-05

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>
Blocks Freeciv - Feature #660202: Update scenarios to S3_0 formatClosed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Marko Lindqvist almost 4 years ago

  • Sprint/Milestone set to 3.0.0

#2 Updated by Marko Lindqvist almost 4 years ago

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

#3 Updated by Marko Lindqvist almost 4 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.

#4 Updated by Marko Lindqvist almost 4 years ago

#5 Updated by Marko Lindqvist almost 4 years ago

Saving part (to get savegame format updated already)

#6 Updated by Marko Lindqvist almost 4 years ago

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

#7 Updated by Marko Lindqvist almost 4 years ago

Untested patch for value loading + using part

#8 Updated by Marko Lindqvist almost 4 years ago

Marko Lindqvist wrote:

Untested patch for value loading + using part

Andreas, can you test if it works?

#9 Updated by Andreas Røsdal almost 4 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.

#10 Updated by Marko Lindqvist almost 4 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?

#11 Updated by Andreas Røsdal almost 4 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.

#12 Updated by Marko Lindqvist almost 4 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.

#13 Updated by Andreas Røsdal almost 4 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.

#14 Updated by Marko Lindqvist almost 4 years ago

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

#15 Updated by Andreas Røsdal almost 4 years ago

I think this works OK now.

#16 Updated by Jacob Nevins almost 4 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF