fixes & increases SSinput click delay threshold & moves it and average_click_delay to deciseconds (#71520)

## About The Pull Request
theres an issue with SSinput calculating the average_click_delay that
made it skip queuing clicks much faster than it should have. now it
should work. also moves everything to deciseconds for consistency
(except for the statpanel display, which changes it to per second). also
i increased the click delay threshold to 1 tick in deciseconds because
really we should only be refusing to queue if SSinput is being skipped
for whatever reason or each tick is receiving massive non input overtime
## Why It's Good For The Game
feex queuing clicks to lower overtime when the server is overloaded
## Changelog
🆑
fix: queuing clicks should work correctly now
/🆑
This commit is contained in:
Kylerace
2022-12-06 00:59:11 -08:00
committed by GitHub
parent 836518b752
commit 293e85f94b
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1,2 +1,2 @@
///if the running average click latency is above this amount then clicks will never queue and will execute immediately
#define MAXIMUM_CLICK_LATENCY (20 MILLISECONDS)
#define MAXIMUM_CLICK_LATENCY (0.5 DECISECONDS)
+3 -3
View File
@@ -53,7 +53,7 @@ VERB_MANAGER_SUBSYSTEM_DEF(input)
if(control != "mapwindow.map")
return FALSE
if(average_click_delay >= MAXIMUM_CLICK_LATENCY || !..())
if(average_click_delay > MAXIMUM_CLICK_LATENCY || !..())
current_clicks++
average_click_delay = MC_AVG_FAST_UP_SLOW_DOWN(average_click_delay, 0)
return FALSE
@@ -82,7 +82,7 @@ VERB_MANAGER_SUBSYSTEM_DEF(input)
stack_trace("non /datum/callback/verb_callback instance inside SSinput's verb_queue!")
continue
average_click_delay = MC_AVG_FAST_UP_SLOW_DOWN(average_click_delay, TICKS2DS((DS2TICKS(world.time) - queued_click.creation_time)) SECONDS)
average_click_delay = MC_AVG_FAST_UP_SLOW_DOWN(average_click_delay, TICKS2DS((DS2TICKS(world.time) - queued_click.creation_time)))
queued_click.InvokeAsync()
current_clicks++
@@ -96,5 +96,5 @@ VERB_MANAGER_SUBSYSTEM_DEF(input)
/datum/controller/subsystem/verb_manager/input/stat_entry(msg)
. = ..()
. += "M/S:[round(movements_per_second,0.01)] | C/S:[round(clicks_per_second,0.01)] ([round(delayed_clicks_per_second,0.01)] | CD: [round(average_click_delay,0.01)])"
. += "M/S:[round(movements_per_second,0.01)] | C/S:[round(clicks_per_second,0.01)] ([round(delayed_clicks_per_second,0.01)] | CD: [round(average_click_delay / (1 SECONDS),0.01)])"