Add coroutine to intertwine updates/gc cycles with scoring#25
Add coroutine to intertwine updates/gc cycles with scoring#25MathIsFun0 merged 11 commits intoSpectralPack:mainfrom
Conversation
|
Will test this tomorrow |
|
I've had a thought, what if instead of just an ever-expanding mass of dots, we try to approximate how much time is left in scoring? Might try to get that in |
|
thinking more about that, it's pretty hard to get right |
|
fyi, information provided in the above is: additionally, gc will only be called if the gc counts more than 1 gigabyte of memory |
This eliminates the memory overhead of scoring, and eliminates the issue of the game freezing while scoring is in progress.
An overlay with a simple "Calculating..." text appears while scoring, and the user has no control while this is happening.
The overlay only appears during the actual calculations involved in scoring.
The scoring animations the user sees are outside of the calculations, and as such the obstruction of the overlay disappears afterwards.
Updates run 10 times a second (along with GC cycles). If scoring takes less than a tenth of a second, the effects of the coroutine are nonexistent.
It's to be noted that scoring will always take up at least 0.1 seconds. The GC cycle time isn't included.
It seems that updates take a shit ton of time if scoring animations are enabled, likely due to the event manager iterating through all of the events in queue. This is negligible, since if you're performing that many retriggers with scoring animations on, the time it'll take to fully run through all the animations would be months anyways.
/
original PR to Steamodded: Steamodded/smods#295
Moved the code to here, tested it in the different cj hook and seems good.