-
Notifications
You must be signed in to change notification settings - Fork 351
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the client async #310
base: master
Are you sure you want to change the base?
Conversation
To separate the client into time zones (planned are are at least two, one for the renderer and one for everything else) precise time counter independent of the complicated and delay prone timer framework are needed. * Move Sys_Milliseconds() from threads.cpp (were it doesn't belong) into the system depended code. * Implement Sys_Microseconds() for Windows and Posix plattform. * Make Sys_Milliseconds() a wrapper around Sys_Microseconds(). * Add header entries for Sys_Microseconds().
* Implement some kind of break, i.e. slow the main loop a little bit down and use special OPCODES to tell the CPU that we are in a very tight spin loop. This prevent overheating. * Introduce the render timezone for the renderer, call the renderer up to 300 times a second. This is currently hartcoded, a cvar will be introduced in a later commit. * Everything else is the game timezone, hartcoded to 60 frames. The game can't run faster anyways. * COmment old timeer based break. The code isn't removed because we need it to optionally support the old behaviour without time zones.
I just forced pushed the branch:
To make it clear. The goal of this pull request is to split the client into at least two time zones and allow the addition of more time zones at a later time. The goal is not to solve the 60 hz problem. That will be done (if ever) at a later time. |
I've added two cvars:
Both cvar can be set at runtime without restart. I've played through the Alpha Laps, the game seems to run fine in async mode. |
just a quick untested win32 build of this branch rebased on current master: dhewm3_1.5.1_RC2+async_win32.zip |
Hi,
@DanielGibson asked me if I could have a look at dhewm3s timing code and estimate if it's possible to make the client asynchronous, i.e. render as many frames as possible without breaking the game logic. This is a very first try. The approach taken is the same as in Yamagi Quake II. The client is split into two time zones, renderframes for the renderer and clientframes for everything else.
General observations:
What's working:
What's not working:
Assertion 'node1->object == NULL && node2->object == NULL' failed.
in BTree.h:442. I'm unable to reproduce it. The coredump was broken, so no chance to further investigate it.What's missing:
The big question is if this is the way to go or if it would be better to make the timer subsystem more accurate and split the global
TRIGGER_EVENT_ONE
timer (which is now unused) into two distinct times. One for the client and one for the renderer. In any case it is possible to make dhewm3 asynchronous and it looks easier than I initially thought.