camera turn
Moderator: InsideQC Admins
13 posts
• Page 1 of 1
camera turn
Hello.
I would like to implement camera turn. Like you turn your head behind, to look ho's chasing you, but still walk the same direction.
Similar thing is in Duke3D.
The biggest problem will be probably to make player walk in different direction that he's looking to. Any suggestions?
Thanks.
I would like to implement camera turn. Like you turn your head behind, to look ho's chasing you, but still walk the same direction.
Similar thing is in Duke3D.
The biggest problem will be probably to make player walk in different direction that he's looking to. Any suggestions?
Thanks.
-

siska.robert - Posts: 58
- Joined: Wed Feb 17, 2010 7:51 pm
- Location: Czech Republic
hmm, you could set the player punchangle_x and punchnangle_z to something stupid, then when it's done, set them to 0 again. that's a hack-ass way to do it!
-

Error - InsideQC Staff
- Posts: 865
- Joined: Fri Nov 05, 2004 5:15 am
- Location: VA, USA
punchangle
It looks great (moving the v_* models)! But when punchangle is changed, player goes into that direction - that's what I want to avoid. Maybe modifing the movement buttons is the way, but I don't know where is this controlled from...
-

siska.robert - Posts: 58
- Joined: Wed Feb 17, 2010 7:51 pm
- Location: Czech Republic
could you please be more specific? The only intermission-related camera controlling I found, is in execute_changelevel...Is that what you meant?
-

siska.robert - Posts: 58
- Joined: Wed Feb 17, 2010 7:51 pm
- Location: Czech Republic
I still don't know, how to do it... Viewport (view_ofs) is just about position in 3d, not about angles, IMHO. The most obvious seems to be setting v_angle, but that is used for computing shooting and walking direction. It would be easy to adjust w_fire functions according to change in v_angle, but the walking would be still problem.
Or: Wouldn't creating a new camera help?
Or: Do you know any mods, which use something similar?
thanks for answers!
Or: Wouldn't creating a new camera help?
Or: Do you know any mods, which use something similar?
thanks for answers!
-

siska.robert - Posts: 58
- Joined: Wed Feb 17, 2010 7:51 pm
- Location: Czech Republic
You can force the client's view angle to match their angle by using fixangles. However, by doing so, you'll change their v_angle and thus the direction they move in.
Intermission code locks the client's angles, and prevents them from changing them, but you can't turn it off without a map change, and it would stop them from ever aiming again, certainly they can't look freely while its active.
Using DP, you could provide a replacement SV_PlayerMove function or whatever its called (the annoying one that screws over prediction), I can't remember the exact name. Anyway, its some extension that invokes the QC to carry out the velocity changes each movement frame. You could adjust the angles in there, and change the direction that the player moves in. Be warned, however, that you would still need to use fixangles if you wish to turn the player automatically, and doing so will induce a slight stutter, which will be much more noticable with latency. But it could work well if the button only prevents changing the effective movement angles, without fixangle at all. But whatever you do with this, it will break prediction.
A fairly minimal CSQC could do it by overriding the player's input angles at input frame generation, based on a stat or some such, basically stop it from changing, the player is then free to look around (can adjust the player's view angles when its first activated/deactivated too).
Alternatively with CSQC, you could add 90/180 degrees to the view angle when setting up the view properties for the current frame, which is more likely to work in DP, but is a fair amount more code. With this, the player can still change thier direction of motion, they're just moving backwards.
Intermission code locks the client's angles, and prevents them from changing them, but you can't turn it off without a map change, and it would stop them from ever aiming again, certainly they can't look freely while its active.
Using DP, you could provide a replacement SV_PlayerMove function or whatever its called (the annoying one that screws over prediction), I can't remember the exact name. Anyway, its some extension that invokes the QC to carry out the velocity changes each movement frame. You could adjust the angles in there, and change the direction that the player moves in. Be warned, however, that you would still need to use fixangles if you wish to turn the player automatically, and doing so will induce a slight stutter, which will be much more noticable with latency. But it could work well if the button only prevents changing the effective movement angles, without fixangle at all. But whatever you do with this, it will break prediction.
A fairly minimal CSQC could do it by overriding the player's input angles at input frame generation, based on a stat or some such, basically stop it from changing, the player is then free to look around (can adjust the player's view angles when its first activated/deactivated too).
Alternatively with CSQC, you could add 90/180 degrees to the view angle when setting up the view properties for the current frame, which is more likely to work in DP, but is a fair amount more code. With this, the player can still change thier direction of motion, they're just moving backwards.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
well, it is way more difficult, than i though it was...
Possibly, I could get it working in DP or via csqc, but I'm pretty conservative in modding - i want my mods work on classic id's engine and it's derivations (winquake, sdlquake...)
Thanks for answers to my question - more will definitely come:)
Possibly, I could get it working in DP or via csqc, but I'm pretty conservative in modding - i want my mods work on classic id's engine and it's derivations (winquake, sdlquake...)
Thanks for answers to my question - more will definitely come:)
-

siska.robert - Posts: 58
- Joined: Wed Feb 17, 2010 7:51 pm
- Location: Czech Republic
the alternative is to roll your own player physics.
All I can say to that is... gah. walkmove is not really suitable.
All I can say to that is... gah. walkmove is not really suitable.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
-

siska.robert - Posts: 58
- Joined: Wed Feb 17, 2010 7:51 pm
- Location: Czech Republic
Wouldn't the camera writebyte work for this? Or will that still change the player's forward direction?
If you wish to use DP, tweaking the player's movement code to be 180 degrees off while his view is backwards should be pretty easy. At least if I remember right...
If you wish to use DP, tweaking the player's movement code to be 180 degrees off while his view is backwards should be pretty easy. At least if I remember right...
When my computer inevitably explodes and kills me, my cat inherits everything I own. He may be the only one capable of continuing my work.
- Wazat
- Posts: 771
- Joined: Fri Oct 15, 2004 9:50 pm
- Location: Middle 'o the desert, USA
WriteAngle changes forward direction too. In normal quake, movement is probably engine-driven...
And about DP: I just don't like the idea:) Nowadays, the levels and mods are often aimed for DP (or similar) and don't work in classic quake engine - as the owner of 400MHz/64Mr, I'm naturally pissed off:)
And about DP: I just don't like the idea:) Nowadays, the levels and mods are often aimed for DP (or similar) and don't work in classic quake engine - as the owner of 400MHz/64Mr, I'm naturally pissed off:)
-

siska.robert - Posts: 58
- Joined: Wed Feb 17, 2010 7:51 pm
- Location: Czech Republic
13 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest