Understanding Player Angles by Spike

Jul 24 2021

  1. user wiggles the mouse – this updates csqc’s view_angles global.
  2. client generates a periodic input frame – this updates csqc’s input_angles global (also updated by getinputframe etc… as well as every frame because dp compat)
  3. that gets sent to the server – which is shown in the ssqc’s input_angles global (yay for consistent names for shared pmove logic).
  4. PlayerPreThink compat is annoying – the ssqc sets player.v_angle to the same value as itsinput_angles
  5. the pmove stuff does its thing – and sets player.angles with 1/3rd because it doesn’t expect the qc to be using bones or stuff to represent view angles instead.
  6. The server networks entities to each client, which finally allows the csqc to see the angles in CSQC_Ent_Update or deltalisten or via getentity.
  7. addentity/addentities makes a copy of the entity for the renderer to use when drawing its scene, this copy of the angle is not normally visible to the qc at all (though can potentially come back in the form of portals).

If you use fixangles in the ssqc then that sends a message to the client to update that view_angles global, replacing it completely.if you use fixangles in the ssqc then that sends a message to the client to update that view_angles global, replacing it completely. This means you have a lag time matching that of a reliable-round-trip between when the ssqc tries to change the angle and when it actually happens. So you have half-a-trip in which any angle changes will be reverted.

===============
Jul 23 22:41:22 OneManClan rough rough concept: https://pastebin.com/tyksqH4k
Jul 23 22:41:52 OneManClan ^ on the right track/ballpark?
Jul 23 22:58:06 OneManClan ugh, line 7 should read “Are we NOT standing on a rotating_plat?”
Jul 23 23:08:02 Spoike why does distance matter?
Jul 23 23:12:34 OneManClan um.. isnt it needed to work out the angle? [my trig is worse than u can imagine]
Jul 23 23:12:36 Spoike imagine how weird physics would have to be if the centre of the planet rotated at a different speed than its surface. that’s the sort of thing you only get with rubber bands…
Jul 23 23:13:55 Spoike sure the VELOCITY from rotation on the surface of a planet is much faster than the velocity at its rotational center (0, by definition…)
Jul 23 23:14:20 Spoike but the ANGLE change is consistent throughout the entire body.
Jul 23 23:14:31 OneManClan hm, now that i picture it in my mind… yes.. I see..
Jul 23 23:15:11 Spoike the ground entity’s movetype_push behaviours will move riders around for you already.
Jul 23 23:15:25 OneManClan im picturing 2 people standign on a .. what are they called.. w the horses in fair grounds
Jul 23 23:15:53 Spoike carousels?
Jul 23 23:16:34 OneManClan yea
Jul 23 23:16:41 Spoike a full rotation is 360 degrees, whether you’re at the edge or the middle.
Jul 23 23:17:26 OneManClan ‘merry go round’ <- i went blank (ffs)
Jul 23 23:18:38 Spoike carousel.
Jul 23 23:18:47 OneManClan ok, so the angle or the player can just increment w the angle of the rotating plat
Jul 23 23:19:31 OneManClan yea a carousel (is that the ‘formal’ name)?
Jul 23 23:19:51 Spoike player_yaw_angle += player.groundentity.angles_y – player.lastgroundyaw; player.lastgroundyaw=player.groundentity.angles_y;
Jul 23 23:20:23 Spoike except that like I said this needs to be done in csqc because otherwise you’re fighting over which copy of the player’s yaw angle you’re even talking about.
Jul 23 23:23:56 OneManClan doesnt the csqc get told by ssqc what the players .angles are?
Jul 23 23:24:40 OneManClan oh u mean the local players angles
Jul 23 23:33:21 Spoike the ssqc doesn’t have the mouse.
Jul 23 23:33:45 Spoike that’s clientside stuff
Jul 23 23:52:15 OneManClan ah, yes..
Jul 23 23:53:18 OneManClan this why my ‘making a player spin’ doesnt use self.angles
Jul 23 23:53:22 OneManClan stuffcmd(self, “cl_yawspeed 10000;+left\n”); //
Jul 23 23:54:36 OneManClan hm, and SV_RunClientCommand isnt the place to do it?
Jul 23 23:56:29 OneManClan I thought input_angles ‘forced’ the client to face this way or that
Jul 24 00:01:22 Spoike input != view
Jul 24 00:20:33 OneManClan ahh
Jul 24 00:22:04 OneManClan so how does this work with looking at *other players* on the carousel?
Jul 24 00:27:33 eukara that stuffcmd is cursed
Jul 24 00:38:30 Spoike eukara: at least it includes a \n
Jul 24 00:40:07 Spoike OneManClan: the other player’s csqc will also be changing their view angles. those view angles will be networked to the server, your client will see that player’s angles change…
Jul 24 00:40:23 Spoike yes there’ll be more lag on it than there would be if the server was doing it.
Jul 24 00:41:02 OneManClan csqc view changes are networked to the server?
Jul 24 00:42:15 eukara v_angle is a thing
Jul 24 00:42:39 eukara so you’d think…
Jul 24 00:44:19 OneManClan .vector v_angle; // i have this in csqc_headers.h .. so I assume its not an inherrant ‘part of CSQC’
Jul 24 00:44:39 OneManClan ie its not in csqcsysdefs
Jul 24 00:45:06 eukara v_angle is used i ssqc, it contains the clients view angles.
Jul 24 00:45:21 eukara in CSQC you have the view_angles global
Jul 24 00:45:47 eukara CSQC isn’t really fussed about the v_angle field
Jul 24 00:51:29 * Spoike1 (~David@host86-186-163-94.range86-186.btcentralplus.com) has joined
Jul 24 00:51:30 * Ishmael gives channel operator status to Spoike1
Jul 24 00:51:30 * Ishmael gives voice to Spoike1
Jul 24 00:51:45 * Spoike has quit (Ping timeout: 180 seconds)
Jul 24 01:00:08 Spoike OneManClan: angles… from the perspective of the various parts of qc…
Jul 24 01:00:08 Spoike 1) user wiggles the mouse – this updates csqc’s view_angles global.
Jul 24 01:00:08 Spoike 2) client generates a periodic input frame – this updates csqc’s input_angles global (also updated by getinputframe etc… as well as every frame because dp compat)
Jul 24 01:00:08 Spoike 3) that gets sent to the server – which is shown in the ssqc’s input_angles global (yay for consistent names for shared pmove logic).
Jul 24 01:00:08 Spoike 4) PlayerPreThink compat is annoying – the ssqc sets player.v_angle to the same value as itsinput_angles.
Jul 24 01:00:08 Spoike 5) the pmove stuff does its thing – and sets player.angles with 1/3rd because it doesn’t expect the qc to be using bones or stuff to represent view angles instead.
Jul 24 01:00:08 Spoike 6) The server networks entities to each client, which finally allows the csqc to see the angles in CSQC_Ent_Update or deltalisten or via getentity.
Jul 24 01:00:10 Spoike 7) addentity/addentities makes a copy of the entity for the renderer to use when drawing its scene, this copy of the angle is not normally visible to the qc at all (though can potentially come back in the form of portals).
Jul 24 01:01:39 Spoike if you use fixangles in the ssqc then that sends a message to the client to update that view_angles global, replacing it completely.
Jul 24 01:02:36 Spoike this means you have a lag time matching that of a reliable-round-trip between when the ssqc tries to change the angle and when it actually happens.
Jul 24 01:03:53 Spoike so you have half-a-trip in which any angle changes will be reverted.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>