Search Unity

Solving Indeterministic Physics

Discussion in 'Editor & General Support' started by jpthek9, Feb 7, 2015.

  1. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Hi, I'd like to see whether or not this rounding system I implemented will work to make Unity PhysX deterministic. Unfortunately, I only have a windows computer so I haven't been able to test it out on other platforms. If you want to help solve this mystery (of whether or not Physics can be made deterministic), download the build here. It'll automatically capture the position and rotation of each object at frame 3k and copy it to your clipboard. Then you can post it on pastebin and we can compare our results.

    Here're my results (Intel(R) Core(TM) i7-4700HQ CPU @ 2.40GHz, 4 Cores):
    Determinsitic: http://pastebin.com/g036x7Yb .
    Indeterministic: http://pastebin.com/ZYzDA2eb

    Both show up the same on the same computer but I'm not sure how they'll fare on other computers.
     
    Last edited: Feb 7, 2015
  2. NiDBiLD

    NiDBiLD

    Joined:
    Jan 26, 2015
    Posts:
    4
  3. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    Yeah, unfortunately so. Thanks for the tests. It's good to know for sure.
     
  4. NiDBiLD

    NiDBiLD

    Joined:
    Jan 26, 2015
    Posts:
    4
    Sorry. :/

    I'm also looking for a way to get Unity to behave deterministically, but no luck so far.
     
  5. jpthek9

    jpthek9

    Joined:
    Nov 28, 2013
    Posts:
    944
    From the research I've done, I've concluded there're only 2 ways to get deterministic simulations: Decimal math and fixed point math. For my RTS, I've decided not to use physics though but instead a flocking system which is a lot simpler imo (think air units in SC2 with more seperation). Since decimal math is just a short step away from convenient floats, I'm going to use that. Hopefully, the rumors of crappy performance don't turn out to be too true.