mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-28 10:01:58 +00:00
## 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)  In constrast, handle_gravity is currently on average maybe 15 seconds.  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 /🆑