Hello forum, i have a question: is there a way to get the framerate value from qc? (i am using darkplaces=
thanks
PS:
had to enter here by a website that uses IP's anonymous, inside 3d dowsn't work correctly
get framerate in qc
get framerate in qc
hi, I am nahuel, I love quake and qc.
Re: get framerate in qc
Isn't there a frametime global? If so, the frame rate is just 1/frametime. If not, you can create your own using
Watch out for the first time as frametime will be 0). Also, due to floats being floats, the accuracy will degrade after a couple of hours (see here for details). However, if frametime (or similar) is available, then it's probably calculated from double time (rather than float) and thus accurate for longer than anyone will care to play a single level .
Code: Select all
float frametime;
float oldtime;
...
frametime = time - oldtime;
oldtime = time;
Leave others their otherness.
http://quakeforge.net/
http://quakeforge.net/
Re: get framerate in qc
which framerate?
the server's framerate can be calculated by checking frametime inside the StartFrame function.
the client's framerate can be calculated by checking the timing between PlayerPreThink. In a QuakeWorld engine, the frametime value is updated to be the amount of time between input frames rather than the time between server frames. I assume DP is similar.
There is no way to determine the actual video framerate without csqc.
the server's framerate can be calculated by checking frametime inside the StartFrame function.
the client's framerate can be calculated by checking the timing between PlayerPreThink. In a QuakeWorld engine, the frametime value is updated to be the amount of time between input frames rather than the time between server frames. I assume DP is similar.
There is no way to determine the actual video framerate without csqc.
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 pm
Re: get framerate in qc
I fail to see what's the scenario that justifies the use of video framerate information in QC code (even CSQC).Spike wrote:There is no way to determine the actual video framerate without csqc.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC (LordHavoc)
Re: get framerate in qc
depends how broken an engine's interpolation is.
one reason you might want the video framerate is to cut back on explosion effects or filter distant entities or whatever if the rate drops too low.
I dunno, maybe you'd want to kick people with framerates higher than 2000 because you're jealous or something.
But yeah, the only really important rate for nq mods is the outgoing packet rate, which should generally match the server's frametime global in StartFrame.
Frame times elsewhere should be considered unreliable, as there is more than one engine that runs players/entities out of sequence or multiple thinks per frame and other such things.
one reason you might want the video framerate is to cut back on explosion effects or filter distant entities or whatever if the rate drops too low.
I dunno, maybe you'd want to kick people with framerates higher than 2000 because you're jealous or something.
But yeah, the only really important rate for nq mods is the outgoing packet rate, which should generally match the server's frametime global in StartFrame.
Frame times elsewhere should be considered unreliable, as there is more than one engine that runs players/entities out of sequence or multiple thinks per frame and other such things.
-
- Posts: 2126
- Joined: Sat Nov 25, 2006 1:49 pm
Re: get framerate in qc
Both cases could (and SHOULD) be handled (much better) by the engine code IMO.Spike wrote:one reason you might want the video framerate is to cut back on explosion effects or filter distant entities or whatever if the rate drops too low.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC (LordHavoc)