Bb3 B 4: Creating 2d Physics In A 3d World.

Discussion in 'Buildbox 3.0' started by Tom King, Dec 5, 2018.

  1. Tom King

    Tom King Boxer

    Joined:
    Nov 23, 2018
    Messages:
    24
    Likes Received:
    15
    Has anybody else realised that a 2d physics game can't work in BB3 as it stands. Using 3D physics with a 2D camera does not give the correct results. It needs a specifically 2D physics engine. Simply rendering an orthogonal side view of 3D physics gives a "flattened" view of things happening in 3 dimensions.
    I have tried restricting translation & rotation in one of the dimensions on a per object basis, but this gives incorrect results.
    I am very interested to hear any ideas about this, especially from the Buildox Dev team.
     
  2. colette_levesque

    colette_levesque Boxer

    Joined:
    Sep 25, 2015
    Messages:
    94
    Likes Received:
    51
    Have you given Buildbox 2 a try? It is 2d only.
     
  3. zadik

    zadik Boxer

    Joined:
    Dec 3, 2018
    Messages:
    1
    Likes Received:
    0
    please guys, I have a problem of implementing the gdpr for Heyzap mediation in an android studio project
     
  4. Tom King

    Tom King Boxer

    Joined:
    Nov 23, 2018
    Messages:
    24
    Likes Received:
    15
    Buildbox 2 does a great job of 2D physics, but it is being superseded by Buildbox 3 in the (near?) future. The transition phase between BBox 2 & 3 is going to be a very important/stressful time for many users.
     
  5. Tom King

    Tom King Boxer

    Joined:
    Nov 23, 2018
    Messages:
    24
    Likes Received:
    15
    SOLVED! I've found a way to make it work. Double Click the item in the Objects list. Open the "Start" node & after you turn on physics, set the Position Factor Z to zero, & the Rotation factor X & Y to zero. This keeps all physics calculations in the 2D XY Plane. This should probably be made a single "2D physics only" tick box for the final release. I'll send this info to support now.
     
  6. Tom King

    Tom King Boxer

    Joined:
    Nov 23, 2018
    Messages:
    24
    Likes Received:
    15
    Here are two BB3 files showing what I was talking about.

    Sorry I freaked out about this too quickly. Will it give a very big performance hit using the 3D physics engine in a restricted way vs. a 2D only engine?
     

    Attached Files:

  7. Buildbox

    Buildbox Administrator

    Joined:
    Sep 15, 2015
    Messages:
    101
    Likes Received:
    201
    Hi Tom, glad you figured this out. I'll mention to the team we might want to do this automatically when a user is in "2D Mode" :) . As for performance, you should be fine. We're seeing better performance with 3D physics than we were with Box2D in 2.0.
     
    Tom King likes this.
  8. Josh (Nology Games)

    Josh (Nology Games) Community Manager Staff Member

    Joined:
    Nov 27, 2017
    Messages:
    757
    Likes Received:
    244
    Which is really impressive considering that Box2D in 2.0 was designed for much simpler gameplay and worlds.

    Just goes to show just how much effort that the team is putting into the release of Buildbox 3.
     
  9. Tom King

    Tom King Boxer

    Joined:
    Nov 23, 2018
    Messages:
    24
    Likes Received:
    15
    I've now become intrigued by the 2D possibilities of BB3.
    Playing with some 2D planes. (I'm assuming using cubes for squares is a sinful waste of 10 Polys per rectangular shape.)
    They obviously can't be their own collision shapes, (edges of polys don't collide with each other in 3D) so I've been testing with cubes scaled to be very thin in the z Axis. There is a kind of threshold you pass while scaling this axis down, where the 2D Collisions start to fail.
    If the Devs know what determines this threshold, it would also be very useful to know. Is it related to scale of the object in the scene, a constant number regardless of scene scale or even related to world physics time or sub-steps?
    It would also be incredibly useful for the user to have access to the numerical trans, rot & scale attributes of an entity's collision mesh when editing it, as they do for entity level objects' transforms.
    The user can then adjust transformation attributes, particularly the Z scale, of the collision mesh in an accurate way to give optimal results in simulation quality & efficiency.
     

Share This Page