Search Unity

Cross Platform Deterministic Physics

Discussion in 'Physics' started by maormenashe, Dec 13, 2018.

  1. maormenashe

    maormenashe

    Joined:
    Oct 7, 2018
    Posts:
    20
    I've recently started looking into developing RTS games, i read a few articles about how to implement it and i saw mostly two main ways, "Authoritative Server" and "LockStep". Using "Authoritative Server" you would implement the physics on the server side which seems a bit to heavy for me and can get really expensive.
    Using "Lockstep" the game must be deterministic in all the platforms it's distributed.

    Big problem Unity3d is not cross platform deterministic. I ran a little test building a little game that creates a collision between 2 GameObjects, when using the same platform with 2 clients the position and determination worked great at least with Unity3d version "2018.3.0f2". The big problem was when i switched to using different platforms, in this case Android and Windows, the position wasn't deterministic..

    A little search got me to the understanding that most platforms run different calculation for floats and a use of fixed point should be used.

    I'm kinda stuck... i believe for me to use fixed point with physics means i need to re implement it?
    Anyone has any solution for this determination problem?

    Btw i'm aware of TrueSync by Photon, but it's a bit pricey.