npruehs / game-math

Free open-source math library for games.
http://npruehs.de/game-math/api/1.0
MIT License
42 stars 8 forks source link

Deterministic float calculations #28

Open Krakean opened 6 years ago

Krakean commented 6 years ago

Hello. Is GameMath support deterministic calculations for floats (basically, restrict precision / fixed point)? Its specifically required to make a game like an RTS networked. Some reading, in case if someone not familiar with the subject - http://gafferongames.com/networking-for-game-programmers/floating-point-determinism/

npruehs commented 6 years ago

Hey @Krakean!

No, you'd basically have to build your own fixed point arithmetic, and that hasn't been done for this library yet. Feel free to open a pull request in case you're building it yourself!

Also, note that, strictly speaking, fixed point arithmetic is not necessary to build an RTS, but to use the lockstep approach. You could decide to build an RTS without lockstep, if you want to :)