[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/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/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 - Weird timing issues

Weird timing issues

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Weird timing issues

Postby NameZero912 » Fri Jan 23, 2009 8:43 am

Hiho,

I've found out about a weird glitch in the DP engine, it is server-specific. Since I'm actually only a bit proficient at QuakeC (but not at C, and not at DarkPlaces code either) I'd just like to ask for your opinions what the cause for this glitch could be and whether/how it could be fixed

The time variable (of SSQC) does behave weird. Have a look at . The first few lines show the normal output of time which I added into the SSQC code, so that time is printed each frame. In the first few lines it behaves as expected (slowmo is set to 1 at this point). But then, when I enter slowmo 0.001, things get weird. time does not continously increase anymore, but increases in steps. Also, the period at which the time value changes appears to be random. Furthermore, if you do something like self.nexthink = time + 0.0001 inside a Think-function of an entity, the value of self.nextthink is still time, and not time + 0.0001 !

Please note that what I just explained only happens if the server was running a map for a long time already. It can be simulated by disabling the timelimit and use slowmo 1000 for a few seconds. Set slowmo to 1 again, let the time be printed each frame and then set slowmo to 0.0001 (I tested this in Nexuiz SVN).

Thus, you won't experience this glitch if the server just loaded a new map, because in this case time will continously increase just fine.

The effect of this glitch appears in the Nexuiz sv_timeout feature which "pauses" the game by setting slowmo to 0.0001 - it goes to a point that the timeout feature is just broken (and the timeout is too short) once the map is running for a longer time due to the Think function which is called too often because the time value does not increase continously.

Kind regards,
NZ
NameZero912
 
Posts: 4
Joined: Fri Jan 23, 2009 8:31 am

Postby Spike » Fri Jan 23, 2009 11:29 am

.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby NameZero912 » Fri Jan 23, 2009 12:00 pm

Thanks for the hints. Divverent told me exactly the same.

Once I have more understanding of the engine code I'll have a look at the pause command of DP. I will try to modify it that it can be called from QC as well. All in good time ;)
NameZero912
 
Posts: 4
Joined: Fri Jan 23, 2009 8:31 am

Postby NameZero912 » Fri Jan 23, 2009 1:50 pm

Gnah. I should have known it. DP won't execute any Think functions while the game is paused. To do the timeout feature I guess I'd have to do this:

- Keep the checks in SSQC, if checks are passed, call a new built-in function that sets sv.paused to 1 (e.g. TogglePause()) (there are many checks, e.g. if the one who calls it is a player, how many timeouts has he left, is there enough time for calling the timeout, the duration of the timeout, etc etc...)
- Additions to DP that track the amount of time X that passed from the moment where sv.paused was set, and to call a new, fixed QC function in the VM with X as parameter.
- This fixed QC function deals with unpausing the game again once X reached a specific value, by calling the TogglePause() built-in again
NameZero912
 
Posts: 4
Joined: Fri Jan 23, 2009 8:31 am

Postby Spike » Fri Jan 23, 2009 2:00 pm

FTE has a half-arsed flawed extension along these lines already.
ZQuake has a revised version which works much better.
Implement the zquake one.
I say this so we don't end up with too many conflicting extensions.
.
Spike
 
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby NameZero912 » Fri Jan 23, 2009 11:00 pm

NameZero912
 
Posts: 4
Joined: Fri Jan 23, 2009 8:31 am

Postby Spike » Sat Jan 24, 2009 2:21 am

.
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 2 guests