Thread: [GD-General] Sports Game Replay
Brought to you by:
vexxed72
From: Brett B. <res...@ga...> - 2005-01-25 01:19:21
|
Hiya, I think this is as good place as any to post this... We're just starting a new sports game project, and we have been asked to provide replays of the action. We have done many sports games before, but oddly none had a replay feature (was never requested before by publisher). Anyways, can anybody provide any tips or insights into things we need to watch out for or methods to support this feature? The game needs to run on the PS2 so memory and IO is limited. Our characters use virtual controllers for all the movement so is it naive to just compress and store controller inputs for everything and then rerun the simulation with that? Cheers, -bb |
From: Kent Q. <ken...@co...> - 2005-01-25 13:19:13
|
It's not naive, but it's not trivial to get right. You have to make sure you record and play back ALL forms of input -- which is basically anything that can affect your performance. This includes exact timing and random number generation. One way of doing it is to feed all your input through a queue and include timing information in the input stream. It might be easier to think of the timing information as delay messages on the input stream, rather than tagging each event with a time. (Makes it easier to stretch timing or pause by increasing the delay messages without affecting the relationship between other objects.) One of the difficulties we ran into when we tried this was repeatability of the detailed collision data. We ended up forcing the position of all movable objects in the world to something like 4 or 5 digits of precision every frame. It kept minor changes in floating point bits from blowing up and affecting future actions ("the butterfly effect"). Depending on the size of your world, this may be harder. You also have to have fixed-framerate physics. Don't expect to adjust your physics time tick size from frame to frame. If you decide to do slow-motion and want it to look smooth, don't try to run your physics at a higher frame rate in the world -- run the physics at the same rate but interpolate between frames. Kent At 08:35 PM 1/24/2005, you wrote: >Hiya, >I think this is as good place as any to post this... > >We're just starting a new sports game project, and we have been asked to >provide replays of the action. We have done many sports games before, but >oddly none had a replay feature (was never requested before by publisher). >Anyways, can anybody provide any tips or insights into things we need to >watch out for or methods to support this feature? > >The game needs to run on the PS2 so memory and IO is limited. Our >characters use virtual controllers for all the movement so is it naive to >just compress and store controller inputs for everything and then rerun the >simulation with that? > >Cheers, >-bb > > > >------------------------------------------------------- >This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting >Tool for open source databases. Create drag-&-drop reports. Save time >by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. >Download a FREE copy at http://www.intelliview.com/go/osdn_nl >_______________________________________________ >Gamedevlists-general mailing list >Gam...@li... >https://lists.sourceforge.net/lists/listinfo/gamedevlists-general >Archives: >http://sourceforge.net/mailarchive/forum.php?forum_id=557 ---- Kent Quirk CTO, CogniToy |
From: Stephen C. <sc...@in...> - 2005-02-11 06:51:22
|
For the football game I worked on we actually kept game state for each frame instead of recreating it from stored inputs. The downside, as you might expect, was memory cost. The advantage was that we could easily allow the player to jog the replay forward or backward a any speed instead of just presenting a canned replay shot. Interpolating between frames gave a pretty good smooth slow-motion effect, too. Since it was a football game with discrete downs we only needed to keep a single play's worth of data making this approach viable. It all depends on your requirements. Stephen ----- Original Message ----- From: "Kent Quirk" <ken...@co...> To: <gam...@li...> Sent: Tuesday, January 25, 2005 5:17 AM Subject: Re: [GD-General] Sports Game Replay > It's not naive, but it's not trivial to get right. > > You have to make sure you record and play back ALL forms of input -- which > is basically anything that can affect your performance. This includes exact > timing and random number generation. One way of doing it is to feed all > your input through a queue and include timing information in the input > stream. It might be easier to think of the timing information as delay > messages on the input stream, rather than tagging each event with a time. > (Makes it easier to stretch timing or pause by increasing the delay > messages without affecting the relationship between other objects.) > > One of the difficulties we ran into when we tried this was repeatability of > the detailed collision data. We ended up forcing the position of all > movable objects in the world to something like 4 or 5 digits of precision > every frame. It kept minor changes in floating point bits from blowing up > and affecting future actions ("the butterfly effect"). Depending on the > size of your world, this may be harder. > > You also have to have fixed-framerate physics. Don't expect to adjust your > physics time tick size from frame to frame. If you decide to do slow-motion > and want it to look smooth, don't try to run your physics at a higher frame > rate in the world -- run the physics at the same rate but interpolate > between frames. > > Kent > > > > At 08:35 PM 1/24/2005, you wrote: > >Hiya, > >I think this is as good place as any to post this... > > > >We're just starting a new sports game project, and we have been asked to > >provide replays of the action. We have done many sports games before, but > >oddly none had a replay feature (was never requested before by publisher). > >Anyways, can anybody provide any tips or insights into things we need to > >watch out for or methods to support this feature? > > > >The game needs to run on the PS2 so memory and IO is limited. Our > >characters use virtual controllers for all the movement so is it naive to > >just compress and store controller inputs for everything and then rerun the > >simulation with that? > > > >Cheers, > >-bb > > > > > > > >------------------------------------------------------- > >This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > >Tool for open source databases. Create drag-&-drop reports. Save time > >by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > >Download a FREE copy at http://www.intelliview.com/go/osdn_nl > >_______________________________________________ > >Gamedevlists-general mailing list > >Gam...@li... > >https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > >Archives: > >http://sourceforge.net/mailarchive/forum.php?forum_id=557 > > ---- > Kent Quirk > CTO, CogniToy > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=557 |
From: Jamie F. <ja...@qu...> - 2005-01-25 13:20:05
|
That is the standard way to do it (of course, you only need to record the player inputs, everything else should drop out of the simulation; certainly this is the way we did it in Driver), although it can be a bit of a nightmare to get it working and keep it working. If you can spare the memory, you can add extra data to help keep the thing looking like a replay even when it fails, but that may or may not really help (and will almost certainly cover any bugs in the proper replay code). Things to watch out for: - If you have time delta dependent code, you need to replicate the deltas as well. - Initialize all class members properly, or you'll get different behaviour on replay. - Make sure you test multiple game cycles from early on, i.e. frontend -> game -> frontend -> game. - It's one of the areas which is amenable to automated unit and regression testing. - Random numbers can be bad. If you're using them, make sure you reinitialize with the right seed. Hmmm, that's about all that floats to the top of my brain at the mo. Jamie Brett Bibby wrote: > Hiya, > I think this is as good place as any to post this... > > We're just starting a new sports game project, and we have been asked to > provide replays of the action. We have done many sports games before, but > oddly none had a replay feature (was never requested before by publisher). > Anyways, can anybody provide any tips or insights into things we need to > watch out for or methods to support this feature? > > The game needs to run on the PS2 so memory and IO is limited. Our > characters use virtual controllers for all the movement so is it naive to > just compress and store controller inputs for everything and then rerun the > simulation with that? > > Cheers, > -bb > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=557 |
From: Wismerhill <wi...@ch...> - 2005-01-25 13:24:11
|
Brett Bibby ecrivit le 25/01/2005 02:35 : > Hiya, > I think this is as good place as any to post this... > > We're just starting a new sports game project, and we have been asked to > provide replays of the action. We have done many sports games before, but > oddly none had a replay feature (was never requested before by publisher). > Anyways, can anybody provide any tips or insights into things we need to > watch out for or methods to support this feature? > > The game needs to run on the PS2 so memory and IO is limited. Our > characters use virtual controllers for all the movement so is it naive to > just compress and store controller inputs for everything and then rerun the > simulation with that? Have you read http://www.gamasutra.com/features/20040204/wagner_01.shtml ? It's on PS2 too. |
From: Brett B. <res...@ga...> - 2005-01-26 00:04:44
|
From: "Wismerhill" <wi...@ch...> > Have you read > http://www.gamasutra.com/features/20040204/wagner_01.shtml ? It's on > PS2 too. Doh! I will thanks. From: "Jamie Fowlston" <ja...@qu...> > Things to watch out for: > > - If you have time delta dependent code, you need to replicate the > deltas as well. > - Initialize all class members properly, or you'll get different > behaviour on replay. > - Make sure you test multiple game cycles from early on, i.e. frontend > -> game -> frontend -> game. > - It's one of the areas which is amenable to automated unit and > regression testing. > - Random numbers can be bad. If you're using them, make sure you > reinitialize with the right seed. Awesome, thanks! From: "Kent Quirk" <ken...@co...> > You also have to have fixed-framerate physics. Don't expect to adjust your > physics time tick size from frame to frame. If you decide to do slow-motion > and want it to look smooth, don't try to run your physics at a higher frame > rate in the world -- run the physics at the same rate but interpolate > between frames. Good point, thanks! |
From: Jamie F. <ja...@qu...> - 2005-01-26 11:15:22
|
One more thing: save the results of the game before you play the replay, don't rely on the replay to give you exactly the same results (even though it should :) You don't want the user to lose a game as a result of a broken replay of a game they won. Jamie Brett Bibby wrote: > From: "Wismerhill" <wi...@ch...> > >>Have you read >>http://www.gamasutra.com/features/20040204/wagner_01.shtml ? It's on >>PS2 too. > > > Doh! I will thanks. > > From: "Jamie Fowlston" <ja...@qu...> > >>Things to watch out for: >> >>- If you have time delta dependent code, you need to replicate the >>deltas as well. >>- Initialize all class members properly, or you'll get different >>behaviour on replay. >>- Make sure you test multiple game cycles from early on, i.e. frontend >>-> game -> frontend -> game. >>- It's one of the areas which is amenable to automated unit and >>regression testing. >>- Random numbers can be bad. If you're using them, make sure you >>reinitialize with the right seed. > > > Awesome, thanks! > > From: "Kent Quirk" <ken...@co...> > >>You also have to have fixed-framerate physics. Don't expect to adjust your >>physics time tick size from frame to frame. If you decide to do > > slow-motion > >>and want it to look smooth, don't try to run your physics at a higher > > frame > >>rate in the world -- run the physics at the same rate but interpolate >>between frames. > > > Good point, thanks! > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting > Tool for open source databases. Create drag-&-drop reports. Save time > by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc. > Download a FREE copy at http://www.intelliview.com/go/osdn_nl > _______________________________________________ > Gamedevlists-general mailing list > Gam...@li... > https://lists.sourceforge.net/lists/listinfo/gamedevlists-general > Archives: > http://sourceforge.net/mailarchive/forum.php?forum_id=557 |