Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Movement delay & smoothness refactor. (#2294)
* Movement delay & smoothness refactor. 1: kills tick compensation. It was a broken system that could best be summed up as "old coders threw random formulas at movement code until they got a movement speed they were happy with". 2: Movement now uses glide size to be SMOOTH AS HELL. 3: client FPS had to be disabled due to point 2, because of https://secure.byond.com/forum/?post=2241289 Still WiP and probably pretty broken. * Improvements. * Many many fixes. * Properly disable fps preference. * Movement loop! Implements a movement loop. Instead of the client repeatedly sending movement commands, the server keeps track of the client's movement buttons and sends the movement commands itself. This helps with responsiveness, and also makes diagonal movement possible (enabled only for ghosts) * Actually give ghosts movement delays. * Review comments. * Review comment
- Loading branch information
Showing
85 changed files
with
957 additions
and
460 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#define MOVE_DELAY_BASE 1.1 | ||
|
||
//Glidesize | ||
#define FRACTIONAL_GLIDESIZES 1 | ||
#ifdef FRACTIONAL_GLIDESIZES | ||
#define DELAY2GLIDESIZE(delay) (world.icon_size / max(Ceiling(delay / world.tick_lag), 1)) | ||
#else | ||
#define DELAY2GLIDESIZE(delay) (Ceiling(world.icon_size / max(Ceiling(delay / world.tick_lag), 1))) | ||
#endif |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
////////////////////////////////// | ||
// /vg/ MODULARIZED DELAYS - by N3X15 | ||
////////////////////////////////// | ||
|
||
// This number's kinda arbitrary but whatever. | ||
#define DELAY_CONTROLLER_DEFAULT_MAX 10000 | ||
#define DELAY_CONTROLLER_DEFAULT_MIN 0.3 | ||
|
||
// Reduces duplicated code by quite a bit. | ||
/datum/delay_controller | ||
// Delay clamps (for adminbus, effects) | ||
var/min_delay = DELAY_CONTROLLER_DEFAULT_MIN | ||
var/max_delay = DELAY_CONTROLLER_DEFAULT_MAX | ||
|
||
var/next_allowed = 0 | ||
|
||
/datum/delay_controller/New(var/min=DELAY_CONTROLLER_DEFAULT_MIN, var/max=DELAY_CONTROLLER_DEFAULT_MAX) | ||
min_delay = min | ||
max_delay = max | ||
|
||
/datum/delay_controller/proc/setDelay(var/delay) | ||
next_allowed = world.time + Clamp(delay, min_delay, max_delay) | ||
|
||
/datum/delay_controller/proc/setDelayMin(var/delay) | ||
next_allowed = max(world.time + Clamp(delay, min_delay, max_delay), next_allowed) | ||
|
||
/datum/delay_controller/proc/addDelay(var/delay) | ||
var/current_delay = max(0, next_allowed - world.time) | ||
setDelay(current_delay + delay) | ||
|
||
/datum/delay_controller/proc/isBlocked() | ||
return next_allowed > world.time |
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
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
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.