Inside3D!
     

camera turn

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
siska.robert



Joined: 17 Feb 2010
Posts: 9
Location: Czech Republic

PostPosted: Wed Feb 17, 2010 7:59 pm    Post subject: camera turn Reply with quote

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.
_________________
http://int21h.ic.cz/users/BOby/portal.html
Back to top
View user's profile Send private message Visit poster's website
Error
Inside3D Staff


Joined: 05 Nov 2004
Posts: 558
Location: VA, USA

PostPosted: Thu Feb 18, 2010 3:34 am    Post subject: Reply with quote

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!
_________________
Inside3D : Knowledge Is Power
Darkplaces Documentation Wiki
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
siska.robert



Joined: 17 Feb 2010
Posts: 9
Location: Czech Republic

PostPosted: Thu Feb 18, 2010 10:59 am    Post subject: punchangle Reply with quote

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...
_________________
http://int21h.ic.cz/users/BOby/portal.html
Back to top
View user's profile Send private message Visit poster's website
c0burn



Joined: 05 Nov 2004
Posts: 158
Location: Liverpool, England

PostPosted: Thu Feb 18, 2010 12:01 pm    Post subject: Reply with quote

Look at the intermission camera code in client.qc
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
siska.robert



Joined: 17 Feb 2010
Posts: 9
Location: Czech Republic

PostPosted: Thu Feb 18, 2010 2:08 pm    Post subject: Reply with quote

could you please be more specific? The only intermission-related camera controlling I found, is in execute_changelevel...Is that what you meant?
_________________
http://int21h.ic.cz/users/BOby/portal.html
Back to top
View user's profile Send private message Visit poster's website
c0burn



Joined: 05 Nov 2004
Posts: 158
Location: Liverpool, England

PostPosted: Thu Feb 18, 2010 2:50 pm    Post subject: Reply with quote

Yes, it sets the players viewport manually.
Back to top
View user's profile Send private message Visit poster's website AIM Address MSN Messenger
siska.robert



Joined: 17 Feb 2010
Posts: 9
Location: Czech Republic

PostPosted: Fri Feb 19, 2010 12:52 pm    Post subject: Reply with quote

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!
_________________
http://int21h.ic.cz/users/BOby/portal.html
Back to top
View user's profile Send private message Visit poster's website
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Fri Feb 19, 2010 1:36 pm    Post subject: Reply with quote

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.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
siska.robert



Joined: 17 Feb 2010
Posts: 9
Location: Czech Republic

PostPosted: Fri Feb 19, 2010 2:09 pm    Post subject: Reply with quote

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:)
_________________
http://int21h.ic.cz/users/BOby/portal.html
Back to top
View user's profile Send private message Visit poster's website
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Fri Feb 19, 2010 4:10 pm    Post subject: Reply with quote

the alternative is to roll your own player physics.
All I can say to that is... gah. walkmove is not really suitable.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
siska.robert



Joined: 17 Feb 2010
Posts: 9
Location: Czech Republic

PostPosted: Fri Feb 19, 2010 6:48 pm    Post subject: Reply with quote

you mean like bind new impulses to some function that would move player around?
_________________
http://int21h.ic.cz/users/BOby/portal.html
Back to top
View user's profile Send private message Visit poster's website
Wazat



Joined: 15 Oct 2004
Posts: 732
Location: Middle 'o the desert, USA

PostPosted: Sun Feb 21, 2010 3:38 am    Post subject: Reply with quote

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...
_________________
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.
Back to top
View user's profile Send private message MSN Messenger
siska.robert



Joined: 17 Feb 2010
Posts: 9
Location: Czech Republic

PostPosted: Sun Feb 21, 2010 11:37 am    Post subject: Reply with quote

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:)
_________________
http://int21h.ic.cz/users/BOby/portal.html
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group