Files
Bubberstation/code/modules/mod
LemonInTheDark 5aab9dd88a Saves roughly 20% off living/Life(), makes gravity event based (#74084)
## About The Pull Request

Right now, each time life processes we need to run has_gravity, and
check its output against a bunch of thresholds.
We could save off that second bit by caching the previous value, but
we'd still be only updating this every 2 seconds.

This potentially delayed updating leads to really janky feeling behavior
around transition points too (like when moving on/off the sand on tram
station)

So instead of doing this updating off life(), let's make it event based.
We'll decompose has_gravity, and take all the values it relies on, and
check for them changing ourselves.
That way we get instant response, and can save all the wasted
has_gravity calls.

This constant checking on movement adds a few signal registrations, a
connect_loc, and some logic on living/Moved

The Moved logic increases Moved's self by 50%, roughly 1 second a round
at worst.
Don't have concrete numbers for the connect_loc

(new self / old self)

![image](https://user-images.githubusercontent.com/58055496/226091990-8cbeef82-6a37-488c-a0b6-cf570156c2dc.png)

In constrast, handle_gravity is currently on average maybe 15 seconds.


![image](https://user-images.githubusercontent.com/58055496/226092056-5fc7fc59-46e2-4e01-a6ee-6867de30c1f0.png)

I could JUST save maybe 13 seconds and not spend the 1 by storing the
previous gravity value, but I think this is worth the ux changes. It
does add some extra resistance to change, but s much nice.

Moved some functions around too, and removed now redundant
update_gravity calls

## Why It's Good For The Game

Snappier gravity, faster Life()

## Changelog
🆑
qol: Human gravity will react to changes instantly, instead of waiting
for the next process tick. Hopefully this feels better and not worse
/🆑
2023-03-25 22:44:27 -06:00
..