Ports "The punisher!"

* From tgstation/tgstation#27196
* The mc will now punish subsystems that overrun their tick allotment with less allotment in later fires.
* The punisher also delays the next fire of subsystems that overrun. Because of how this is ends up being calculated, this will almost never actually kick in, but sometimes subsystems like garbage will overrun into multiple ticks, so delaying their next fire is needed.
* The punisher does not delay the next fire of SS_TICKER subsystems (tgstation/tgstation#34964)
Note: SS_KEEP_TIMING subsystems do not get their next fire delayed.
This commit is contained in:
Leshana
2018-04-20 16:19:29 -04:00
parent 0d957e35a5
commit 0094c74b64
3 changed files with 19 additions and 8 deletions

View File

@@ -17,6 +17,7 @@
var/next_fire = 0 //scheduled world.time for next fire()
var/cost = 0 //average time to execute
var/tick_usage = 0 //average tick usage
var/tick_overrun = 0 //average tick overrun
var/state = SS_IDLE //tracks the current state of the ss, running, paused, etc.
var/paused_ticks = 0 //ticks this ss is taking to run right now.
var/paused_tick_usage //total tick_usage of all of our runs while pausing this run
@@ -167,7 +168,7 @@
if(can_fire && !(SS_NO_FIRE & flags))
msg = "[round(cost,1)]ms|[round(tick_usage,1)]%|[round(ticks,0.1)]\t[msg]"
msg = "[round(cost,1)]ms|[round(tick_usage,1)]%([round(tick_overrun,1)]%)|[round(ticks,0.1)]\t[msg]"
else
msg = "OFFLINE\t[msg]"