Forum

Intermission Demo playback fix?

Discuss programming topics for the various GPL'd game engine sources.

Moderator: InsideQC Admins

Intermission Demo playback fix?

Postby Baker » Sun Jul 13, 2014 12:53 am

There is an issue in FitzQuake 0.85, JoeQuake and ProQuake --- which means any engine derived from one of these. Original Quake is not affected, appears related to support shorts for angles for players, instead of original Quake "byte angles".

Record a demo: play e1m1 and go through exit teleporter. Intermission is up. Let it sit a few seconds, and make note of what the view looks like then type "stop".

Play back your demo. Notice that at intermission, the camera is not looking where it should! If you used protocol 15, playing it back in WinQuake or GLQuake will be correct, therefore it the interpretation of read messages.

Now for me, this is fixing it:

BEFORE: FitzQuake 0.85 example
Code: Select all
      case svc_setangle:
         for (i=0 ; i<3 ; i++)
            cl.viewangles[i] = MSG_ReadAngle ();


AFTER: After a lot of inspection, I added the following which resolves the issue with every demo I have played back.

Code: Select all
      case svc_setangle:
         for (i=0 ; i<3 ; i++)
            cl.viewangles[i] = MSG_ReadAngle ();

         // Baker addition ...
         if (cls.demoplayback)
         {
            VectorCopy (cl.viewangles, cl.mviewangles[0]);
            VectorCopy (cl.mviewangles[0], cl.mviewangles[1]);
            VectorCopy (cl.mviewangles[0], cl.lerpangles);
            cl.mviewangles[0][0] = cl.mviewangles[1][0] = cl.lerpangles[0] = -cl.lerpangles[0];
         }


mviewangles are the current and previous network received viewangles, as I understand it.

It looks like angles from svc_setangle have a negative pitch (maybe all angle messages from the server do?)
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Intermission Demo playback fix?

Postby ericw » Tue Sep 09, 2014 6:44 pm

Thanks for sharing this Baker.

I'd like to understand what's going on better though. I can reproduce it using only winquake 1.09 (record demo, map e1m1, noclip to the exit, then play the demo. intermission camera is pointing at the wrong angle), so it looks like a bug in the original code. Weirdly, one recording attempt produced a demo that plays back correctly (every time I play that particular demo file). So there appears to be some randomness to it at recording time.
ericw
 
Posts: 92
Joined: Sat Jan 18, 2014 2:11 am

Re: Intermission Demo playback fix?

Postby Baker » Tue Sep 09, 2014 11:14 pm

It is an interesting question for sure.

I independently discovered the solution, then I found Bengt Jardrup had a similar fix in his engine to the problem (of course written like 8 years ago or so). I've recorded and played back numerous demos including ones recorded in other engines and I have found to situation where the above fix doesn't work.

But I'm not sure of the exact cause, but it only seems to affect engines which can read short angles. Might be similar to the APSP1 func_train issue in that sense.

Has to be something wrong with reading the data, but could be something with QuakeC that only reveals itself in this odd circumstance or something about how demo recording works.
The night is young. How else can I annoy the world before sunsrise? 8) Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
User avatar
Baker
 
Posts: 3666
Joined: Tue Mar 14, 2006 5:15 am

Re: Intermission Demo playback fix?

Postby qbism » Thu Sep 11, 2014 2:38 am

Is this similar to the bug with savegames facing the wrong direction when loaded?
User avatar
qbism
 
Posts: 1236
Joined: Thu Nov 04, 2004 5:51 am


Return to Engine Programming

Who is online

Users browsing this forum: No registered users and 1 guest