Conceptually, how does replay work in a game? Ask Question

Conceptually, how does replay work in a game? Ask Question

I was kind of curious as to how replay might be implemented in a game.

Initially, I thought that there would be just a command list of every player/ai action that was taken in the game, and it then 're-plays' the game and lets the engine render as usual. However, I have looked at replays in FPS/RTS games, and upon careful inspection even things like the particles and graphical/audible glitches are consistent (and those glitches are generally inconsistent).

So How does this happen. In fixed camera angle games I though it might just write every frame of the whole scene to a stream that gets stored and then just replays the stream back, but that doesn't seem like enough for games that allow you to pause and move the camera around. You'd have to store the locations of everything in the scene at all points in time (No?). So for things like particles, that's a lot of data to push which seems like a significant draw on the game's performance whilst playing.

ベストアンサー1

最初の考えは正しいと思います。リプレイを作成するには、ユーザーから受信したすべての入力 (受信したフレーム番号とともに) と、乱数ジェネレーターの初期シードを保存します。ゲームをリプレイするには、保存したシードを使用して PRNG をリセットし、ゲーム エンジンに同じ入力シーケンス (フレーム番号に同期) を供給します。多くのゲームでは、フレーム間の経過時間に基づいてゲームの状態が更新されるため、各フレームの長さも保存する必要がある場合があります。

おすすめ記事