Search Unity

Floating point determinism and Unity configs

Discussion in 'Physics' started by ahbutfore, May 23, 2020.

  1. ahbutfore

    ahbutfore

    Joined:
    Nov 11, 2019
    Posts:
    4
    I want a physics system that is deterministic across platforms, to that end I'm using my own physics implementation based on integers to avoid small float rounding errors in math on different computer architectures.

    However, it'd be easier if I could set up scenes / prefabs in Unity using the default float / Vector2 variable types and just convert them to my fixed precision types when the game starts.

    So my question is, when my game starts up and loads in the floating point values that are saved in the .prefab or .unity etc files, is it guaranteed that all computer architectures will have the same initial representation of the float? ie, it is only the math operations that can end up changing float values in non-deterministic ways?