Poly Bridge

Poly Bridge

View Stats:
wouter Sep 27, 2015 @ 9:01am
Bug? Non-deterministic behaviour in jump, jump again
I had a solution that seemed to work but was slightly over budget, so wanted to tweak some things to improve. After failing I undid the changes, but it still didn't work anymore. So, I ran the same "bridge" 10 times without any changes and sometimes it works, sometimes it doesn't.

Since this is a (non-quantum) physics game, I figure that non-determinism is a bug?

Video: https://www.youtube.com/watch?v=ws_PDoQRwCI

I can upload the save file if requested. I run ubuntu linux, beta branch.
< >
Showing 1-4 of 4 comments
bolt986 Sep 27, 2015 @ 10:31am 
From the FAQ: http://steamcommunity.com/app/367450/discussions/0/535150948611102879/

~Why does my bridge work sometimes and fail others?
Physics behaving a bit inconsistently is somewhat unavoidable, due to floating point rounding errors (YouTube video on rounding errors). The simulation is on a fixed time step, with many velocity iterations to reduce floating point errors, but none-the-less different outcomes can sometimes still occur, particularly in complex bridges or with fast moving vehicles.
Last edited by bolt986; Sep 27, 2015 @ 10:33am
wouter Sep 27, 2015 @ 10:44am 
Hmm, I guess I should have RTFF.

Bur anyway, I do still consider it a bug in a physics game. I can understand the same bridge giving a different result on different systems, but AFAIK floating point operations are still deterministic on the same system, so they're doing something strange to get non-deterministic behaviour on a single machine.
Dry Cactus  [developer] Sep 27, 2015 @ 1:51pm 
wouter, you are correct in considering it a bug.
Although floating point can also be responsible for there inconsistencies, the starting issue is that bodies are created at run-time.
In the current implementation of Box2D in Unity (Physics2D), creating, destroying, and re-creating the exact same bodies and constrains can lead to very small differences, which compounded by complex bridges and fast moving vehicles can result in very different outcomes.
It is something we're looking into and hopefully will improve on in the near future.
Thanks for your help!
maawolfe36 Sep 27, 2015 @ 11:00pm 
I've noticed that sometimes my bridges will work at normal speed, but if I speed them up to make the replay fit into a gif, it fails at the higher speeds. I'm guessing this is just another iteration of the same bug? It's a bit annoying, but I've found a workaround where I can just start the level at normal speed until the car starts to move, then speed it up and it will work fine.
< >
Showing 1-4 of 4 comments
Per page: 1530 50

Date Posted: Sep 27, 2015 @ 9:01am
Posts: 4