-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplify server stepping and dtime calculation
Old: * game or dedicated_server_step increment server dtime counter. ServerThread runs in a loop in which it receives for at least 30 ms, and then reads and resets the dtime counter. If the counter is > 0, it does a server-step (AsyncRunStep). * There are aliasing effects. E.g. in singleplayer the server-step dtimes are 0ms (0 frames, server-step skipped), 16ms (1 frame) and 33ms (2 frames), and the actual times between the server-steps are >30ms or >60ms. New: * ServerThread receives (with timeout) until next step shall start (or longer if there are more packets), and calculates dtime itself. * In singleplayer, Game tells the server if the game is paused or unfocused. Effects: * Shorter server dtimes are possible (i.e. <30ms). * No dtime value aliasing. * Server-step dtime is decoupled from client-step dtime (i.e. low client fps doesn't cause coarse server-steps). Note that pause and unfocus are now handled explicitly. But the results are similar to before.
- Loading branch information
Showing
6 changed files
with
113 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.