Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3566 closed defect (fixed)

[PATCH] Visual Replay - everything invisible after replay

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

Description

Reproduce:

  1. Replay any commands.txt
  2. Wait for it to finish
  3. After being asked if you want to exit, click no

Notice all buildings and units have become invisible.

This issue has become visible after r17159 but is in fact caused by the visual replay function executing one turn too much, i.e. a turn that doesn't actually exist in the replay.

Since the turn doesn't exist, m_TurnLength of that turn will be zero in the NetTurnManager, cauing m_DeltaSimTime to be zero too.

See also #3527.


This issue is easy to fix, but the more important question to me seems:

Why do buildings and trees disappear then?

It seems this is caused by the call to CSimulation2Impl::Interpolate.

Those things should not be interpolated, as their position never changes (performance issue). (Can be done in another ticket).

Attachments (3)

t3566_correct_finalReplayTurn_v1.patch (624 bytes ) - added by elexis 8 years ago.
commands.txt (1.4 KB ) - added by elexis 8 years ago.
Replay with only one turn for fast testing.
t3566_correct_finalReplayTurn_v1.1.patch (626 bytes ) - added by elexis 8 years ago.
Fail, thx for noticing Stan.

Download all attachments as: .zip

Change History (7)

by elexis, 8 years ago

Attachment: commands.txt added

Replay with only one turn for fast testing.

comment:1 by Josh, 8 years ago

Keywords: review removed

Why --currentTurn instead of currentTurn - 1?

comment:2 by Stan, 8 years ago

That's the same patch ?

by elexis, 8 years ago

Fail, thx for noticing Stan.

comment:3 by JoshuaJB, 8 years ago

Owner: set to JoshuaJB
Resolution: fixed
Status: newclosed

In 17180:

Fix #3566 by fixing an off-by-one error in the final replay turn logic. Patch by elexis.

comment:4 by Josh, 8 years ago

Keywords: patch removed

The patch was good and fixed the issue, but it exposed another bug in the replay logic. At the end of reading the commands file, the normal simulation logic takes over and keeps running. This means that eg. the AI keeps expanding, your units keep running under UnitAI, etc. Please create a new ticket to address this issue. The fix should be pretty simple.

Thanks!

Note: See TracTickets for help on using tickets.