[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 488: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4787: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4789: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4790: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4791: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3922)
InsideQC Forums • View topic - Overhead camera?

Overhead camera?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Overhead camera?

Postby Mexicouger » Sun Sep 09, 2012 1:34 am

How would I go about creating a Straight top down camera without the _y angles of the player affecting it?
User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Re: Overhead camera?

Postby mankrip » Sun Sep 09, 2012 3:32 am

Set the .angles of the camera to the direction you want, and then set the .fixangle of the camera to TRUE. However, this only works in PlayerPreThink.

This must be done in every frame, and due to this it does have some impact on networked games. A solution that doesn't impact network performance would be to use CSQC, but that's beyond my current knowledge at the moment.

And another hint: When setting the camera's position, doing that in PlayerPostThink is better than doing it in PlayerPreThink. PlayerPreThink is run before the player's physics, so any position you set within it will be outdated when the player's physics run.

Another interesting detail is that the whole set of PlayerPreThink :arrow: player's physics :arrow: player's .think :arrow: PlayerPostThink functions is run before any other entities. So, even though setting a camera position in PlayerPostThink will make it follow the player's physics correctly, the player's position can still be changed by any other entity that comes after (e.g. the sliding platform over the first acid pool in E1M1: push the button, and run over the platform while it's still moving to see the camera lagging). Only the physics of the very last entity will be guaranteed to be not unpredictably changed by some other entity after it runs.
Ph'nglui mglw'nafh mankrip Hell's end wgah'nagl fhtagn.
==-=-=-=-=-=-=-=-=-=-==
/ /
User avatar
mankrip
 
Posts: 915
Joined: Fri Jul 04, 2008 3:02 am

Re: Overhead camera?

Postby Spike » Sun Sep 09, 2012 7:32 am

csqc can, but otherwise you can't without implementing the y angles serverside - an aproach that disables all mouse looking (you can reorient the player based upon the direction they are moving but this hurts aiming, or you can implement +turnleft etc serverside via impulses but this is lame).
Angles spammed by fixangles will be echoed back to the server in the v_angle field, and csqc is the only way to override that.
A one-function csprogs should be enough, just get some minimalistic csqc code and add in setviewprop(VF_ANGLES, myhardcodedviewangle); just before the renderscene() call. This won't be seen by the server - the angles the server sees are as normal, including mouse looking (yes, even pitch, setviewprop(VF_CL_VIEWANGLES_X, 0); can be used to force a pitch of 0 clientside - ignore the backwards names, the concept kinda got mixed up in DP).

my old gno mod does it somewhat easily without using csqc by locking the m_pitch cvar to 0, and avoiding the use of fixangles, this allows the client to freely change yaw but this will be shown onscreen. The player always faces upwards on the screen, but the camera position is provided via svc_setview, so could be positioned infront of the player to give better use of screen space. Pitch changes in areas with low ceilings are sent as required, but may revert changes to the y angle when they are sent - there's no solution to that other than of course csqc.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Re: Overhead camera?

Postby Mexicouger » Sun Sep 09, 2012 7:44 pm

User avatar
Mexicouger
 
Posts: 514
Joined: Sat May 01, 2010 10:12 pm

Re: Overhead camera?

Postby Spike » Mon Sep 10, 2012 9:28 am

why are you calling rendering functions within a network function? that's nearly always a bug, and will always result in flickering - the only time it makes any sense is for loading screens, eg precache_model can take some time in some engines.

to get the player visible, you need to get the player entity added to the scene, either via explicitly calling addentity between clearscene and renderscene, or by setting a drawmask and allowing addentities to pick it up (which is the recommended way). This of course also requires that its modelindex and origin are correct.
If you want to interpolate or animate the entity, you can give it a .predraw function, and addentities will automatically call that before actually adding the entity, you can just put your entity update code within this function.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK


Return to QuakeC Programming

Who is online

Users browsing this forum: No registered users and 1 guest