3 ms·
I don’t understand why they didn’t just use an integer. You can’t have half a HP in AoE and nothing has HP so high that it would overflow a 32 bit integer. Seem
by celeritascelery 3y ago
I don’t understand why they didn’t just use an integer. You can’t have half a HP in AoE and nothing has HP so high that it would overflow a 32 bit integer. Seems like it would avoid a lot of problems.
- mqus 3y agoAfaiu there are compounding factors like 1.5 here and 1.5 there should result in 2.25 and so on
- adameasterling 3y agoI had a really fascinating conversation with the lead architect at Frost Giant the other day. They're making the next StarCraft, basically. They don't use floating points. He didn't mention (IIRC) the possibility of rounding bugs; the reason he cited was something a bit more interesting: Floating points are not deterministic, which makes multiplayer challenging, as they simulate game state on each client's computers and only send commands across the wire. One wonders if the "out of sync" errors that plagued Age of Empires in my youth were partially explained by FP determinism issues!
- account42 3y agoFloating point numbers are deterministic, they just depend on thread-global state which has different defaults on differen platforms and can be changed by third-party libraries (including injected ones) at any point.