So before, a subsystem with dynamic wait enabled, when paused mid run, would have to wait ss.wait until it could resume its run. Where as normally subsystems in these cases get resumed within 3 byond ticks, in most cases, only 1 byond tick.
This makes it so the subsystem resumes next tick, like normal subsystems, but only after every other subsystem has been checked once to see if they need to run, and ran if that's the case. so basically low priority
This setup allows subsystems to pause themselves until next mc fire if they are about to go over a tick, and resume on the next mc tick
It also makes it so we prioritize running subsystems we skipped because there wasn't enough time in the current tick to run them based on their avg tick usage. (as well as subsystems paused mid way thru)
Adds a macro for adding this to non-mc procs. just drop it in the loop. There is a define version as well for if checks if you want to know if you just slept to avoid lag.
This is all inside #if DM_VERSION defines, so once i test that 509 still works to compile/test this should be good to merge
Fixes the mc getting all fucked up during midnight rollover
Mc now tracks the tick_usage of every subsystem, and will skip running an expensive subsystem if we are too close to overrunning in a tick, waiting until next tick, unless that subsystem is excessively past due (because we kept skipping it).
It now assumes that 20% of a tick should be saved for byond to do it's things, and stops running all subsystems once we get to 80% tick usage.
Dynamic wait will only smooth out wait changes over 8 fires if the new wait is lower than the old wait, before it would smooth out wait increases as well as decreases.
The fps throttle system is now 509 only.
The mc will now run every 1ds, no GCD bullshit, as we want to spread things out more.
Offline subsystems will still show their stat message
DS is now rounded to 2 digits, not 3, to make room for the tick percentage bit, and because the 3rd digit was useless and all MoE
See http://www.byond.com/forum/?post=2021963#comment18164837
Higher fps when cpu goes over 120 causes issues. I have it scaling around 100 to give us a buffer, and not going back down until it drops below 75 to avoid it jumping too much.
This is a bit of a mess, but all of it can removed once the bug is fixed on byond's end.