<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>MotoGP: replays</title><link>http://blogs.msdn.com/shawnhar/archive/2009/03/20/motogp-replays.aspx</link><description>MotoGP had the ability to store and replay race events, and could save replays to disk. Players used this to view races after they finished, and in timetrial mode to race against a &amp;quot;ghost bike&amp;quot; that was playing back their previous best lap.</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>GENF20</title><link>http://blogs.msdn.com/shawnhar/archive/2009/03/20/motogp-replays.aspx#9494526</link><pubDate>Sat, 21 Mar 2009 06:38:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9494526</guid><dc:creator>evantgel</dc:creator><description>&lt;p&gt;Thanks for article.MotoGP is my favorite.&lt;/p&gt;
</description></item><item><title>re: MotoGP: replays</title><link>http://blogs.msdn.com/shawnhar/archive/2009/03/20/motogp-replays.aspx#9494605</link><pubDate>Sat, 21 Mar 2009 07:11:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9494605</guid><dc:creator>Ultrahead</dc:creator><description>&lt;p&gt;&amp;quot;Solution: don’t have any bugs!&amp;quot;&lt;/p&gt;
&lt;p&gt;Lol!&lt;/p&gt;
</description></item><item><title>mistery</title><link>http://blogs.msdn.com/shawnhar/archive/2009/03/20/motogp-replays.aspx#9500827</link><pubDate>Mon, 23 Mar 2009 12:35:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9500827</guid><dc:creator>ApellA</dc:creator><description>&lt;p&gt;Now I'm really curious of what that last sollution might be.&lt;/p&gt;
</description></item><item><title>Keyframes are useful for debugging</title><link>http://blogs.msdn.com/shawnhar/archive/2009/03/20/motogp-replays.aspx#9535636</link><pubDate>Tue, 07 Apr 2009 12:56:13 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9535636</guid><dc:creator>gfoot</dc:creator><description>&lt;p&gt;The keyframes were really useful for debugging the purely input-based part of the replay system. &amp;nbsp;While you're playing back the replay without the user jumping back and forth, you can just ignore the keyframe data - the input recording should have already got the physics into the right state. &amp;nbsp;But while you're there, in debug builds, you might as well check that the keyframe state matches the current physics state. &amp;nbsp;If it doesn't, you can report numerically exactly which bits of state didn't&lt;/p&gt;
&lt;p&gt;match, and these give valuable clues to which bit of the system is not being deterministic.&lt;/p&gt;
&lt;p&gt;Due to the butterfly effect you often find that by the time you reach the next keyframe pretty much all of the state is wrong, but you can set the keyframe interval very low to catch the errors sooner (at the expense of only being able to store about ten seconds of replay data) and hopefully you then find that only one member is wrong (e.g. mWheelieAmount) and you then know exactly what's causing the inconsistency.&lt;/p&gt;
&lt;p&gt;In fact I think we actually did restore keyframes when we reached them anyway, even though it shouldn't make a significant difference. &amp;nbsp;I don't remember exactly, but I think this actually &amp;quot;fixed&amp;quot; some bugs. &amp;nbsp;I guess there are a few possible explanations, but I never thought of one that actually made sense in the end.&lt;/p&gt;
&lt;p&gt;If I was implementing this kind of system again, there's one particular thing I would have wanted to do - and that's segregate the physics state into constant data, primary inter-frame state, derived state, and possibly temporaries (which were only necessary to communicate between methods during the course of the frame). &amp;nbsp;Then you can mostly ignore constant data (just make sure it gets set up consistently next time the game runs), store the inter-frame state in keyframes, and recompute derived state after restoring keyframes. &amp;nbsp;Crucially you also get the obvious option to zero out the derived state before recomputing it, and to zero out the temporaries at the start of every frame.&lt;/p&gt;
&lt;p&gt;All of a sudden you can be a lot more confident that the physics engine isn't storing data in places it shouldn't, that storing a keyframe is writing the right data, and that your bugs are going to be reproducible (rather than depending on the state you switched from and to when you restored the last keyframe). &amp;nbsp;The hardest bugs to diagnose were the ones where you can to skip to a keyframe where the bike was flat on the ground from a state where the bike was doing a wheelie.&lt;/p&gt;
</description></item></channel></rss>