Index | FAQ | Search | Memberlist | Usergroups | Profile | Log in to check your private messages | Log in | Register

camera turn

| 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 |

Posted: Wed Feb 17, 2010 7:59 pm Post subject: 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.
_________________
http://int21h.ic.cz/users/BOby/portal.html

Back to top |

Error Inside3D Staff Joined: 05 Nov 2004 Posts: 558 Location: VA, USA

Posted: Thu Feb 18, 2010 3:34 am Post subject: |

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 |

siska.robert Joined: 17 Feb 2010 Posts: 9 Location: Czech Republic |

Posted: Thu Feb 18, 2010 10:59 am Post subject: 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... _________________
http://int21h.ic.cz/users/BOby/portal.html

Back to top |

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

Posted: Thu Feb 18, 2010 12:01 pm Post subject: |

Look at the intermission camera code in client.qc

Back to top |

siska.robert Joined: 17 Feb 2010 Posts: 9 Location: Czech Republic |

Posted: Thu Feb 18, 2010 2:08 pm Post subject: |

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 |

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

Posted: Thu Feb 18, 2010 2:50 pm Post subject: |

Yes, it sets the players viewport manually.

Back to top |

siska.robert Joined: 17 Feb 2010 Posts: 9 Location: Czech Republic |

Posted: Fri Feb 19, 2010 12:52 pm Post subject: |

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 |

Spike Joined: 05 Nov 2004 Posts: 944 Location: UK |

Posted: Fri Feb 19, 2010 1:36 pm Post subject: |

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 |

siska.robert Joined: 17 Feb 2010 Posts: 9 Location: Czech Republic |

Posted: Fri Feb 19, 2010 2:09 pm Post subject: |

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 |

Spike Joined: 05 Nov 2004 Posts: 944 Location: UK |

Posted: Fri Feb 19, 2010 4:10 pm Post subject: |

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 |

siska.robert Joined: 17 Feb 2010 Posts: 9 Location: Czech Republic |

Posted: Fri Feb 19, 2010 6:48 pm Post subject: |

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 |

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

Posted: Sun Feb 21, 2010 3:38 am Post subject: |

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 |

siska.robert Joined: 17 Feb 2010 Posts: 9 Location: Czech Republic |

Posted: Sun Feb 21, 2010 11:37 am Post subject: |

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 |

Display posts from previous:

| 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