@typeswitch I've hand-rollled simple fixed-point stuff before for exactly these reasons
Conversation
Notices
-
Embed this notice
clarity flowers (clarity@xoxo.zone)'s status on Wednesday, 03-Sep-2025 01:41:30 JST clarity flowers
-
Embed this notice
azul (typeswitch@gamedev.lgbt)'s status on Wednesday, 03-Sep-2025 01:41:32 JST azul
the best modern solution i've seen is storing position as an integer with a small float offset (|offset| <= 0.5) & doing the collision checks with integers. see:
https://maddymakesgames.com/articles/celeste_and_towerfall_physics/index.html
this is almost the same thing as fixed point -- it's preventing the absolute position from being affected by the coarseness of floats.
-
Embed this notice
azul (typeswitch@gamedev.lgbt)'s status on Wednesday, 03-Sep-2025 01:41:33 JST azul
anyway this diatribe is apropos of the platforming in my game having a floating point bug & i'm not sure how to fix it yet
-
Embed this notice
azul (typeswitch@gamedev.lgbt)'s status on Wednesday, 03-Sep-2025 01:41:34 JST azul
in math you can take a large number, break it into lots of small pieces, add those pieces together, and get the original number back.
good luck doing that on the computer . . . if you try to do that with floats you are going to get very strange results.
part of me wonders why floats are everywhere and fixed point isn't just the standard way to do most things.
but then we are an industry that prefers things that only appear to work if you don't look too closely.
-
Embed this notice