So I wanted to make an RTS and ran into the whole “deterministic lockstep” concept. Yossarian King has 2 great talks on the subject when creating Homeworld: Deserts of Kharak (Links in comments). Thing is I couldn’t find any good fixed point libraries for C# so I decided to create one. Here’s the github page. I’m posting it here for other’s to use, learn from and possibly contribute to(because I know there are people way smarter than me at this).
This is arguably pretty darn cool!
This is great. Thanks for sharing.
I wonder if it’s possible to create a fixed point math library that is Burst-friendly for extra fast processing. Perhaps fixed-point vector types too? What do you think?
I’ll be honest, the new DOTS system is quite intimidating to me. So I haven’t really used it yet. I saw that Unity’s new multiplayer system, does support Lockstep out of the box.
I’d be happy to work on the library again. I think fixed-point vector types could be quite easy to add.
Any idea what I’d need to do to make the library burst-friendly?
Ah yes… your goal was for lockstep, deterministic multiplayer - which Unity now appears to provide.
I’m actually interested in fixed point math for deterministic, procedural generation - so that the same level/map/data gets generated on all platforms and processors from an initial seed.
While I’m not entirely sure, it feels like it should be possible since the internal storage types for your classes are supported by Burst…
But whether all your functions can be written in Burst friendly code, I don’t know…
EDIT:
From this page: AI War 2:Early Access Starts! - Arcen Wiki
They mentioned that moving away from Fixed Point Math, let them use SIMD optimised code in places - “This greatly improves the precision/accuracy, and in several cases also lets us use SIMD for actually better performance, too.” Since this is what Burst is, it implies that maybe it can’t all be made Burst friendly…
I would love to use this! How so I implement this int unity 2019.3.15? And does it overwrite floats with fixed point values?