Search Unity

What is the current state of the cross-platform determinism of Unity Physics?

Discussion in 'Physics for ECS' started by Grizmu, Jun 29, 2020.

  1. Grizmu

    Grizmu

    Joined:
    Aug 27, 2013
    Posts:
    131
    We are currently developing a game that would benefit from the cross-platform determinism and decided to give the Unity Physics package a go.

    And it has been a blast so far. Even though the physics package is still in preview, some basic build tests for platforms that we plan on supporting gave us full cross-platform determinism, those platforms being: PC, IOS(Mac), Android and IOS(IPhone).

    We have a plan to make a more advanced tests before proceeding, since there are lots of edge casses that we don't check yet, but in the meantime I would love to hear what's the current stance of the Unity Physics team on this matter or/and someone who might've already used the package in production.

    What I know is that a solid part of the determinism comes from the marvelous burst compiler, so it's easy to assume that any device that has an exotic CPU, which is not compatible with standards and not fully supported by burst, will either fail to compile or to be deterministic.

    Question to Unity Physics team: Have there been tests regarding this matter? I could make do without 1% of android devices working with our game, but close to or over 10% of devices without determinism would be a no-no for me.
     
    ScriptsEngineer likes this.
  2. ScriptsEngineer

    ScriptsEngineer

    Joined:
    Jun 8, 2018
    Posts:
    37
    I also have the same question , I'm developing a casual game using Unity Physics, although the scope of my project is for PC, but I have these same doubts about Android.
     
  3. Adam-Mechtley

    Adam-Mechtley

    Administrator

    Joined:
    Feb 5, 2007
    Posts:
    290
    Hi! Cross-architecture determinism is more a question of Burst than it is Unity Physics specifically. As @xoofx has noted elsewhere, the Burst team has had to prioritize different issues for now.

    That said, it's worth noting:
    • Unity Physics (and Havok) each is deterministic per architecture right now, and we have test coverage to ensure it is the case.
    • Even when Burst has support for this functionality, there will still be considerable work to ensure your game code is deterministic, as it will be very easy to "poison the well" in subtle ways
    • Especially in light of the foregoing point, the overwhelming majority of games likely do not actually require cross-architecture determinism. Depending on your specific goals, I'm sure there are some here who can offer recommendations :)
     
    Grizmu likes this.
  4. Menion-Leah

    Menion-Leah

    Joined:
    Nov 5, 2014
    Posts:
    189
    Is there any update on that?

    Given the fact that a year and half ago Android totally broke determinism of Unity 2D Physics engine and there's no plan to fix it, we're kind of stuck and we would immensely benefit from a Physics engine that provide cross-architecture determinism.
     
    reinfeldx and ScriptsEngineer like this.