News | Forum | People | FAQ | Links | Search | Register | Log in
Quake Custom Engines
Discuss modified Quake engines here, I guess. What engines do you use? What are the pros/cons of existing engines? What features would you like to see implemented/removed?
First | Previous | Next | Last
Advantages To Running Flat Out 
First of all, and to establish context, there at least used to be a perception that Quake is an older game, uses less resources, therefore it should have lower CPU usage than a newer game. However, a simple "while (1) {}" loop is sufficient to peg a CPU core at 100% (you won't see this in modern Windows because the OS will move it from core to core quite frequently). So it's not the amount of work you do that matters.

Both Windows Sleep and Unix/Linux usleep specify that Sleep times are a minimum, not a guaranteed time interval. To quote from the usleep man page: "The sleep may be lengthened slightly by any system activity or by the time spent processing the call or by the granularity of system timers."

So when you sleep for 1 millisecond, you will actually be sleeping for more than 1, and the specification allows it to be much more than 1; this can be sufficient to cause you to miss a vsync interval, or disrupt input. 1 millisecond doesn't sound like much, but if you remember that 60fps is 16 milliseconds per frame, then it's a substantial enough fraction of it.

At this point a typical reaction might be something like "Quake frame times are so short anyway, surely this is just a theoretical problem". So let's assume that a typical frame time is 1ms. The frame runs then it's followed by a bunch of Sleep(1) calls until it's time to run another.

It should be obvious what's going to happen - at some point the last of those Sleep(1) calls is going to fire, and if you sleep for just a little too long you're going to miss the interval and the next frame will run late. Slightly late with vsync disabled, but with vsync enabled you'll drop to 30fps.

So the reason why it's preferable to run flat out is because the alternative is potentially worse.

That shouldn't be read as meaning that all Sleep calls are bad. If you're running on battery your priority changes and you'll definitely want to sleep. But sleep as a general solution should be avoided; the OS should move your program between cores automatically which will prevent individual cores from ever running at 100% all the time, so nothing should be overheating. Or alternatively, if it's a multithreaded game that's already CPU-bound, then you most definitely don't want to be giving up a resource that you don't have enough of to begin with.

None of this is going to convice anyone who's already made up their minds, I know... 
Very Interesting 
how does this relate to c-states and os power management? Do sleep calls trigger certain c-states? If a system has c-states and power management disabled does host_sleep override that or does it do nothing? 
 
I don't know about Linux, but on Windows Sleep calls don't define how your program interacts with OS power management. All that the documentation states is that the current thread is suspended for an interval based on the value you specify.

What I infer from that is that if there's other work that the core could be doing, it will do it, so you should have no expectation that calling Sleep will guarantee that you'll go into a power-saving mode. After all - Quake isn't the only program running on your OS. 
Mh 
Thanks for that detailed explanation, most informative. 
 
My only objection, for Windows anyway, is the current Sleep docs here seem to state pretty clearly that, if you set the timer resolution to 1ms with timeBeginPeriod, a Sleep(1) will actually sleep somewhere between 0 and 1ms, but not more than 1ms. IIRC, I have measured Sleep(1) sleeping for several milliseconds if you don't call timeBeginPeriod, but if you do it's reliably never more than 1ms. (Of course, this is one random test I did, one PC, probably windows 8.1 or 10, but at least it matched the docs.)

Agree regarding vsync.. it always seemed broken to me, at least in QS (adds so much input lag that it's almost unplayable), maybe most Quake engines (?). If vsync is in use, shouldn't the throttling of the mainloop be left to the blocking "swap buffers" call? 
I See, Thanks 
 
 
If vsync is active then I suggest don't throttle otherwise, either via sleep or Host_FilterTime. IIRC a glFinish immediately after SwapBuffers helps some; causing input to sync up correctly with display, otherwise the CPU may be running a few frames ahead of the GPU.

Last time I checked vsync was a busy-wait on some hardware/drivers, but that was in the D3D 9 era. 
@Kinn 
About 3 weeks, I tried the Mark V WinQuake on a high end gaming laptop I imagine is similar to yours.

The experience was absolutely terrible and was like 10 fps.

Keep in mind on my Windows machine which is nothing remarkable, I get an easy 300-400 fps in Mark V WinQuake on resolutions like 640x480.

I made some adjustments in the just uploaded Mark V which I think may dramatically improve the WinQuake version with machines like yours.

(*I say "I think" because I made some adjustments for the GL version and it was perfect afterwards on that machine. It slipped my mind to do a WinQuake test, so I can't know for sure.) 
Baker 
Ace, just had a go on your new GL WinQuake! Will report back in the other thread 
Is Darkplaces Still In Development 
is it worth my while reporting a bug? 
DP Is Not In Active Dev 
as far as I know... 
 
There is a gitlab with bug tracker here, not sure if it's Xonotic specific. However, it doesn't look like a fork; at least commits are synced between that and the icculus site. Still seems to be somewhat active.
https://gitlab.com/xonotic/darkplaces/issues 
@Shamblernaut ... Check This Out! 
Thanks Guys :) 
We'll see if this fixes the bug, which is likely linux specific. 
 
heh, doesn't fix it... The 64 bit glx version forces my monitors into mirrored mode, rather than primary / secondary.

SDL version works fine though. 
Fifth 
DP Is Not In Active Dev as far as I know...
It is again since April 2016, as evidenced by Icaro's link (don't refer to the outdated Downloads page). 
I Updated My Quakespasm-IRC Engine 
It now uses the latest quakespasm base code.

https://dl.dropboxusercontent.com/u/108695968/Quakespasm-IRC-0.3.zip

I'm also slowly adding speedrunning features to it. When it gets a proper release with more features I might give it a name change and make a proper news post for it.

For now, if you're planning on streaming playthroughs, here ya go.

-Snaut 
Random Question 
Does the .lit file contain all the lightmap information, or just colour information? 
 
It contains black magic and the souls of the undead. Want to check? Try loading a map that needs one... WITHOUT IT!!! 
 
It holds colour * intensity, so an intensity 0 red light will be 0|0|0.

Everything else needed for lighting is actually stored in the surfaces lump, outside of the lightdata. So: each surface stores an offset into the lightdata where it's lightmaps begin (if that offset is -1 then the surface has no lightmaps and so is fullly dark), as well as the styles used by the surface. 
Ah Ok 
cheers 
Qrack Github 
 
Does anyone know why in Darkplaces sometimes the sky will show on the water...instead of the water? Is this fixable or a bug? 
Just A Guess 
But maybe it is caused by using the pretty water pack when the map is not water-vised. 
 
I think you're right, says it right in the README.

Having other issues now for some reason, if I alt+tab out of DP it will not let me back in the game and I have to ctrl+alt+delete...everytime. 
First | Previous | Next | Last
Post A Reply:
Name:
Title:
Body:
message
question
exclamation
idea
flame
noflame
error
skull
beer
moon
pent
rocket
sheep
pacman
pig
cheese
worldcraft
gauntlet
crate
pitfall
pimp
smile
cool
sad
frown
oi
yay
tongue
evil
wink
neutral
q1
q2
q3
ut
hl
cs
doom
dkt
serious
cube
Website copyright © 2002-2017 John Fitzgibbons. All posts are copyright their respective authors.