Hee hee, yes, trying to retrofit a "control-stream" replay onto a game that
used a compressed-state-stream replay is a real pain We had to do that when
we wrote Nascar Heat for the PS2, because a state-based replay is completely
impractical for a console system, unless you only need 5 seconds of
replay... it's a good demonstration of chaotic principles, as an error in
the tenth decimal place will quickly propogate and the player car ends up
against a wall with the tires spinning and the wheel waggling purposefully
back and forth. When we wrote Heat for the Xbox, we were able to use a
state-based replay using the hard-disk, which is nice because than you can
shuttle back and forth and all that nice stuff.
> if your sim is completely deterministic (ie the same input will always
> produce the same simulation) then saving out the user inputs is definitely
> the best way since the data is quite small. However ensuring that your sim
> is deterministic can be quite difficult, (random number generators need
the
> same seed, all simulation data needs to be tied to the simulation rate
> rather than the render speed, you'll need a fixed simulation rate rather
> than variable).
> In my sim I save out the inputs and random number seed, mainly as a debug
> tool but I will also extend it to replays some day. I always get an exact
> replay, but this is only beacuse I had this approach in mind from the
> beginning. If you try to fit this into your sim retrospectively, this can
be
> a complete b*****d (I know from experience). If it doesn't play back
> exactly, it's very difficult to debug when the replayed version first
> diverges from the original version.
> Another approach is similar to one we used on a football sim I worked on a
> couple of years ago. We saved out all "interesting" data (ie player
> positions position, player animation states, ball position) every frame,
and
> that was used for the replay. The problem is that the data can get quite
> large (we only had sufficient memory for the previous 10 secs of the
game).
> Of the 2 approaches, I prefer the first, since it can also be used as a
> debug tool and can also be extended to a networked multiplayer game (since
> the system is deterministic, the same inputs on the different machines
will
> produce the same game state - you only need to pass around user inputs).
But
> like I said, it can be difficult to implement at first.
> Mike
> > Did any one of you already implent replays in your car sim?
> > Currently I'm asking myself which variables to save in a replay file
> > to keep it small and fast but of course near to the original.
> > I thought of saving the game inputs and every 1/10 sec or so the
> > positions & velocities of the cars. What do you think about a replay
> > implentation?
> > Ciao!
> > Roppi