Physics Errors

0 favourites
  • 3 posts
From the Asset Store
7 Errors
$12.75 USD
15% off
7 Errors is a game where you have to find the 7 mistakes before time runs out. Can you find all 7? Have fun looking.
  • I have been attempting to build a simple collision simulator inside of Construct 3 and have noticed some pretty odd behaviors that occur even with a simple setup.

    My simulation simply has two circles that can only move horizontally in a zero gravity environment. They have no linear or angular damping and can't role. The user is able to modify both circles density and velocity individually. They can also modify the elasticity globally. They also have the option to turn on a bounding box which are immovable and also share the global elasticity.

    None of the objects have friction.

    The issues I'm seeing have to do with the balls losing all velocity when they technically shouldn't, or sometimes pushing one another and getting stuck together when they should be bouncing off of one another.

    For example if the Blue circle has a density of 3, velocity of 0, and the green ball has a density of 1 and velocity of -50 then the balls will simply get stuck together and move to the left of the screen instead of bounce away. This happens regardless of the elasticity setting.

    Another setup is blue circle with density of 2, velocity of 150 and green ball with densdity of 1, velocity of -150. Global elasticity is 70%. Bounding Box is on.

    On the green balls 7th collision it will hit the right wall with a velocity of about 44. It should lose about 13 velocity and bonce to the left, but instead it stops. The blue ball then hits the left wall and stops as well. Realistically both balls should continue bouncing for forever... getting slower and slower each time.

    I haven't been able to identify the exact issue for sure. I've attatched my .c3p file for anyone that wants to see the behavior in action or look at how I've set this up.

    My .c3p

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • My guess is that the Box2D engine is just not very good. In the first test, for example, if you change the velocity to -50.0001, the balls start to bounce. There are probably some "magic numbers" used in the engine code, which may explain these anomalies..

    I made a quick test in C2 with Chipmunk physics and it seems to be much more accurate. Unfortunately, as far as I know, this plugin has not been ported for C3.

  • That's really a shame to see even a basic simulation break down so quickly. Thanks for the input dop2000.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)