Opened 9 years ago

Last modified 3 years ago

#3261 new enhancement

Visual Replay - session panel (pause / fast forward / rewind) — at Initial Version

Reported by: elexis Owned by:
Priority: Nice to Have Milestone: Backlog
Component: Core engine Keywords:
Cc: Krinkle Patch:

Description

While a game is replayed (see #9), the following elements should be displayed in a panel:

  • Button: play / pause
  • Dropdown: replay speed
  • Scrollbar (time axis, optionally markers to jump to different positions)
  • 2 Labels (current time and total duration of the game)
  • Button: open file selection menu (see #3258)

As of r16665, the play/pause function is already implemented. Different game speeds as well (see game_speeds.json, you can't change them ingame yet.)

The most effort would be in implementing the rewind feature (jumping to different places in the replay). This might be done in another ticket, if the other features described above are implemented.

There is the time-warp mode in the developers overlay that frequently serializes the simulation state. Savegames also work on loading the serialized simulation state. Rewinding would require the same method. However, since serializing the whole simulation state takes quite some processing time and memory, serialization should only happen a few times, like every 5 minutes of the match.

An unzipped savegame takes about 10-30MB, but it can be stored using zip compression with about 1 to 8 compression ratio. My 12 largest compressed savegames consume 19,3MB of disk space. This means it should be feasible to save every 5 minutes.

There are three ideas when to serialize the simulation state:

  • While playing the actual game. (Might have too big performance impact)
  • Before the replay starts. It should be done non-visually then, similar to the -replay -ooslog command line option.
  • While replaying the game. Each time a checkpoint is reached, the game would have to serialize.

Philip also suggested that templates shouldn't be in the simulation state, in order to further increase the performance and space complexity of serialization.


The total duration of the game can be computed currently by multiplying the turn length with the total number of turns. In future versions of the game, the turn length might change dynamically though. However if that serialization described above is done, data like that can be extracted from the state of the last turn, saved to a file and enrich the visual replay experience.

Change History (0)

Note: See TracTickets for help on using tickets.