Page 1 of 1

Intermission Demo playback fix?

Posted: Sun Jul 13, 2014 12:53 am
by Baker
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?)

Re: Intermission Demo playback fix?

Posted: Tue Sep 09, 2014 6:44 pm
by ericw
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.

Re: Intermission Demo playback fix?

Posted: Tue Sep 09, 2014 11:14 pm
by Baker
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.

Re: Intermission Demo playback fix?

Posted: Thu Sep 11, 2014 2:38 am
by qbism
Is this similar to the bug with savegames facing the wrong direction when loaded?