Kromster80 / kam_remake

"KaM Remake" is an RTS game remake written in Delphi from scratch.
http://www.kamremake.com
GNU Affero General Public License v3.0
358 stars 90 forks source link

Replays should allow to rewind and fast-forward #41

Open vqw opened 9 years ago

vqw commented 9 years ago

The game does not allow us to set demo time arbitrary but we should try to introduce it. Watching replays is painful without possibility to go back or to fast go forward.

I can inspect the code and try to implement this for future release.

Kromster80 commented 9 years ago

Placing TKMEdit will not magically add the required functionality.

TehPlayer14 commented 9 years ago

Unless there would be a spectator bot that could record whole map or each player view

Kromster80 commented 9 years ago

Replays work a little bit different than that.

There's the initial game state (savegame.bas) and a list of all player commands (savegame.rpl) that guide the games state.

With this system to get to the 60min timestamp the replay needs to go through 60_60_10 ticks of the game and apply all the commands in the order. Which is a LOT of processing for the CPU.

Another case is when you want to rewind back (e.g. from 60min to 50min). The game has no mechanism of recording previous states or reverse-applying them. So with the current design the replay needs to start anew and fast forward to 50min.

vqw commented 9 years ago

This is what I was thinking about - restarting replay and fast forwarding (x 10000) in the case of rewinding back and only FF when going forward. During this operation we can stop rendering etc.

Still the CPU will be heavy loaded but maybe we can optimize it in some cases.

Kromster80 commented 9 years ago

This feature needs more planning before starting to work on it.