Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3581 closed defect (fixed)

[PATCH] Visual Replay - simulation continues after end

Reported by: elexis Owned by: elexis
Priority: Should Have Milestone: Alpha 19
Component: Core engine Keywords: patch
Cc: Patch:

Description (last modified by elexis)

Once the replay ends, the simulation continues internally. With AIs it becomes noticable as they continue the game as if nothing has happened.

You can easily reproduce it by replaying the attached file with only one turn, clicking "no" on the exit question and then see the AI continue to build stuff.


The cause of this bug, i.e. the turn manager continuing after the end exists since #9 / r16727, but it never got apparent until both #3309 and #3566 were fixed. Presumably the last mock turn with a duration 0 prevented the game from continuing.

When I apply this attachment:visual_replay_a18_megapatch.patch:ticket:9 to my a18 and replay that file, the units continue with their current animation but all keep standing on ground, despite the turn manager doing more turns.

Attachments (2)

commands.txt (1.2 KB ) - added by elexis 8 years ago.
t3581_stop_simulation_after_replay_v1.patch (4.1 KB ) - added by elexis 8 years ago.

Download all attachments as: .zip

Change History (8)

by elexis, 8 years ago

Attachment: commands.txt added

comment:1 by elexis, 8 years ago

Description: modified (diff)
Keywords: patch review added
Milestone: BacklogAlpha 19
Summary: Visual Replay - simulation continues after end[PATCH] Visual Replay - simulation continues after end

The problem is that main.cpp calling Frame() in a loop, calling g_Game->Update() as long as the game exists and was started, calling m_TurnManager->Update() every time which always increases the turnnumber by 1.

So the simple solution is to move the m_FinalReplayTurn from ReplayTurnManager to the parent class NetTurnManager, so that the parent class function Update() knows about potentially finite games.

comment:2 by Stan, 8 years ago

Owner: set to elexis

comment:3 by wraitii, 8 years ago

Resolution: fixed
Status: newclosed

In 17265:

Stop processing turns after a replay finishes. Patch by elexis. Fixes #3581

The animations continue because we currently have no easy way to stop interpolating. My suggestion would be to implement a network synchronised pause and use something like that.

comment:4 by leper, 8 years ago

Keywords: review removed

comment:5 by elexis, 8 years ago

I'm glad the simulation doesn't continue anymore. The stats will not change anymore and one can check the state of the game at the end.

But some things can still be improved:

  • animations should stop too
  • would be nice if changing the perspective still works after the end (see also #3168)

comment:6 by elexis, 8 years ago

In 17709:

Stop the animations at the end of visual replays, refs #3581.

Note: See TracTickets for help on using tickets.