Quick CSQC question
Moderator: InsideQC Admins
15 posts
• Page 1 of 1
Quick CSQC question
Hi guys,
I'm trying to roll the player's view around the view angle and can't seem to find any examples of this being done. Would I be correct in assuming that it isn't possible using SVQC and would have to be done using CSQC?
I am completely at a loss with CSQC (aside from altering the HUD) and was hoping someone could point me in the right direction.
Thanks
I'm trying to roll the player's view around the view angle and can't seem to find any examples of this being done. Would I be correct in assuming that it isn't possible using SVQC and would have to be done using CSQC?
I am completely at a loss with CSQC (aside from altering the HUD) and was hoping someone could point me in the right direction.
Thanks
- soxinthebox
- Posts: 6
- Joined: Mon Aug 24, 2009 12:22 am
in your CSQC_UpdateView function, or some child function, call setviewprop(VF_ANGLES, replacementangles) in order to change the angle of the view (same method as moving the view around on the screen or in 3d space, just different property names).
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
I wouldn't be so sure it's not possible server side, although, I've never looked. If not possible on vanilla, I be quite surprised if there's not an extension for it.
I'll let you know if I find anything.
I'll let you know if I find anything.
- Karatorian
- Posts: 31
- Joined: Tue Aug 17, 2010 4:26 am
- Location: Rindge, NH, USA
self.angles = foo;
self.fixangles = TRUE;
note that this also affects v_angles (with some lag), and thus feeds back into angles too. Does work with any engine though.
self.fixangles = TRUE;
note that this also affects v_angles (with some lag), and thus feeds back into angles too. Does work with any engine though.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
- Code: Select all
msg_entity = self;
WriteByte (MSG_ONE,SVC_SETANGLE);
WriteAngle (MSG_ONE,self.v_angle_x);
WriteAngle (MSG_ONE,self.v_angle_y);
WriteAngle (MSG_ONE,self.v_angle_z + 20);
Rolls your view 20 degrees to the left. This is in ssqc, no csqc needed. Especially since the default (mouse) controls have no effect on roll, you shouldn't have to worry about updating the angle.. its a 1 time deal.
- GiffE
- Posts: 170
- Joined: Sun Oct 08, 2006 3:39 pm
- Location: USA, CT
Urrrr, except the solutions mentioned are not practical in any way unless you're setting the camera angle once and for all 
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
- Sajt
- Posts: 1215
- Joined: Sat Oct 16, 2004 3:39 am
GiffE wrote:
- Code: Select all
msg_entity = self;
WriteByte (MSG_ONE,SVC_SETANGLE);
WriteAngle (MSG_ONE,self.v_angle_x);
WriteAngle (MSG_ONE,self.v_angle_y);
WriteAngle (MSG_ONE,self.v_angle_z + 20);
Rolls your view 20 degrees to the left. This is in ssqc, no csqc needed. Especially since the default (mouse) controls have no effect on roll, you shouldn't have to worry about updating the angle.. its a 1 time deal.
Cheers I'll give that a go later tonight. I was hoping to bind it to an impulse so I could change the view at will.
- soxinthebox
- Posts: 6
- Joined: Mon Aug 24, 2009 12:22 am
Sajt wrote:Urrrr, except the solutions mentioned are not practical in any way unless you're setting the camera angle once and for all
Why aren't they practical? You could abstract it and send the update every frame in PlayerPostThink or something. Or is there something I'm missing?
- Karatorian
- Posts: 31
- Joined: Tue Aug 17, 2010 4:26 am
- Location: Rindge, NH, USA
So the client gets a "snap" from the server every server frame (which does not equal every client frame). Now his view angles stutter and lag (I think). SVC_SETANGLE or fixangle aren't meant to be used every frame. You could use SVC_SETANGLE per frame, maybe (for something like a Duke3D security camera that automatically yaws left and right), but you'd want to zero the client's mouse sensitivity and yaw/pitchspeed cvars first, and it would still be choppy and laggy. Well, at least I THINK it doesn't get lerped...
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
- Sajt
- Posts: 1215
- Joined: Sat Oct 16, 2004 3:39 am
Well, if I recall correctly, the server framerate is usually 72 fps. That's actually faster than what I usually get client-side (yes, I know my hardware sucks), so it should be as smooth (on my setup) as anything else in the world.
On the other hand, I can see how it would be a problem, in some situations, if it doesn't get interpolated. It seems kinda odd that it wouldn't though. Has it just been overlooked because it hasn't been traditionally used in Quake and mods?
So, I guess CSQC would lead to more consistent results.
On the other hand, I can see how it would be a problem, in some situations, if it doesn't get interpolated. It seems kinda odd that it wouldn't though. Has it just been overlooked because it hasn't been traditionally used in Quake and mods?
So, I guess CSQC would lead to more consistent results.
- Karatorian
- Posts: 31
- Joined: Tue Aug 17, 2010 4:26 am
- Location: Rindge, NH, USA
I think sys_ticrate is how often the server sends updates to the client, and it's either 10fps or 20fps by default in NetQuake.
Anyway, someone can try the server-side method and get back to us on how it worked out. If it were me, though, I wouldn't even try. (What is this for, anyway?)
Anyway, someone can try the server-side method and get back to us on how it worked out. If it were me, though, I wouldn't even try. (What is this for, anyway?)
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
- Sajt
- Posts: 1215
- Joined: Sat Oct 16, 2004 3:39 am
Sajt wrote:Anyway, someone can try the server-side method and get back to us on how it worked out.
RuneQuake rune of weirdness has (had) that.
Actually the Rune of Weirdness dates back to original Artifact Quake.
That being said, for years if you got the weirdness effect, if would screw up your angles for the rest of the game. Sometime rather recent in history, maybe in the last 4 years or far more recently, either that particular effect was dropped due to the angles issue or fixed.
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
Well alternatively you could in csqc:
In Update View, and have it initiated by a temp entity. That would allow you to "roll to ideal" instead of just jerking to the angle.
- Code: Select all
R_SetView(VF_ANGLES_Z,20);
In Update View, and have it initiated by a temp entity. That would allow you to "roll to ideal" instead of just jerking to the angle.
- GiffE
- Posts: 170
- Joined: Sun Oct 08, 2006 3:39 pm
- Location: USA, CT
I gave the code a go which did roll the view like I wanted but I couldn't really figure out how to consistently roll it the correct way. For instance if I rolled 180 the view wouldn't necessarily flip over and I couldn't consistently produce the same results. Does QC not use 360 degrees of rotation?
Cheers for the help so far
Just messing with the engine and seeing if I could flip the view 180 without rotating the map. Walking on the ceiling is the aim, then later the walls which will be more neat if I could rotate the view to match.
Cheers for the help so far
Sajt wrote: If it were me, though, I wouldn't even try. (What is this for, anyway?)
Just messing with the engine and seeing if I could flip the view 180 without rotating the map. Walking on the ceiling is the aim, then later the walls which will be more neat if I could rotate the view to match.
- soxinthebox
- Posts: 6
- Joined: Mon Aug 24, 2009 12:22 am
15 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest