Inconsistent results from GetReactionForce across devices

Hello Everyone,

I am working on a game which has a bridge that carries some objects. The bridge consists of solid objects connected by revolute joints. I want the bridge to break, when the weight of all the objects is too high. The way I check for that is by traversing all the joints, running GetReactionForce on each and if any of the values exceeds given threshold, I delete the joint.

I adjusted the threshold experimentally and everything works great, until I install the game on a different device. In that case the exact same code reports totally different results for GetReactionForce(). Here's sample code:

revoluteReactionForce = revoluteBridgeJoints[i]->GetReactionForce(dt);
CCLOG(@"Reaction force: %f, delta time %f", revoluteReactionForce.Length(), dt);

And here are the results:

On iPad 2 I get this:
Reaction force: 5.546707, delta time 0.016756

iPhone (non-retina) simulator:
Reaction force: 0.761167, delta time 0.016640

iPod (2nd gen):
Reaction force: 0.840120, delta time 0.016700

The above results were generated for the exact same number of identical objects sitting on the bridge (I modified my code so there are no variations affecting the measurements).

Why am I seeing such a huge difference between the iPad2 and the iPhone/iPod? Timestep is practically the same for all of them.

Please help!

Thanks,
George
Are there multiple joints supporting the load? If so, there may not be a unique solution. So you might have to look at the total load.
Hi Erin,

Yes, there are... 11 joints to be precise. If that's unavoidable I can look for some heuristic. I figured I should try to understand the problem before I start doing that though 🙂

Thanks,
George

Original thread: https://box2d.org/forum/viewtopic.php?t=8298