Files
Bubberstation/code/modules/mob
LemonInTheDark 85fa2ea1c2 Locks Diagonal Movement to the Tick (#92956)
## About The Pull Request

When we move diagonally, we multiply our movement rate by sqrt(2) (cause
A\*A + B\*B = C\*C right).
The problem with this is most of the time our movement rate is cleanly
divisible by 0.5 (our tick rate), and sqrt(2) is like 1.47 something.

This means anytime you move diagonally, you become desynced from the
tick, and get movement jitter (about 80% off window for standard
diagonals, tho that gets better as it compounds). I saw this in my
smooth movement pr (#92935), it's been a problem for 4 years now
(#63058) we just like, never noticed cause why would you the rest of the
game is horrible too.

This behavior also possible with normal movement, but that is not
CONSTANT like this is.

What I'm doing here is flooring the resulting delay to the tick rate,
because that's basically close enough, and I prefer moving slightly
faster to moving slightly slower.

## Why It's Good For The Game

Best case displays (with all other problems resolved)

Old:


https://github.com/user-attachments/assets/0151af94-9204-4ba9-ad0c-7e4958faa254

New:


https://github.com/user-attachments/assets/2eb4df09-abff-4e10-b32f-3765755336e1
## Changelog
🆑
fix: Moving diagonally will no longer lead to stutter stepping (it's
tickbound)
/🆑
2025-09-13 17:05:12 +02:00
..
2025-09-10 23:12:08 +02:00
2025-06-25 17:36:10 -07:00
2025-06-25 17:36:10 -07:00
2025-09-07 09:24:34 +02:00