Perfect Collision mask for physics?

This forum is currently in read-only mode.
  • How sad...

  • One question Ashley why did you choose Newton Dynamics for Physhics engine? There are probably pixel-collision physics engines out there.

  • The short answer is no, physics collisions won't be per pixel, because the collision engine in Newton is substantially different - it operates on convex polygons rather than bitmap masks.

    No concave shapes at all? So if I wanted to make this, I wouldn't be able to?

    <img src="http://i31.tinypic.com/ajnfki.png">

    Also, just out of curiosity, how many vertices does the Ellipse mask have?

  • If you can stick objects together you could do this...

    <img src="http://img183.imageshack.us/img183/6965/ajnfkigtd3.png">

  • If you can stick objects together you could do this...

    <img src="http://img183.imageshack.us/img183/6965/ajnfkigtd3.png">

    I've tried that already, with very poor results. The physics simulation gets hung up on the corners where objects overlap and causes unexpected behavior. Play around with it yourself, you'll see what I mean.

    And even if it did work well, that's a rather inefficient way to build a simple object that really only needs ten lines. You've gone from ten vertices in one object to 32 vertices in eight objects.

  • Yeah you could do it by compositing convex polygons, but not a single concave polygon on its own. I don't think Ellipse in the physics engine uses vertices at all, I suspect it's a custom algorithm, since there are probably specific equations for perfectly round objects.

    The reason is (not that I'm an expert) that it's much harder to write an efficient collision detection engine if you can't guarantee a convex polygon. I'm not sure the specifics why. I think it also applies to a dynamic shadows engine, but I'm not sure.

  • I've tried that already, with very poor results. The physics simulation gets hung up on the corners where objects overlap and causes unexpected behavior. Play around with it yourself, you'll see what I mean.

    But i meant more like something built in to construct in the future. You place a few physics objects in the shape you want, and then you click "merge" and they all fuse together into one object. They would still be separate objects thoug, just stuck together perfectly.

  • Yeah you could do it by compositing convex polygons, but not a single concave polygon on its own. I don't think Ellipse in the physics engine uses vertices at all, I suspect it's a custom algorithm, since there are probably specific equations for perfectly round objects.

    The reason is (not that I'm an expert) that it's much harder to write an efficient collision detection engine if you can't guarantee a convex polygon. I'm not sure the specifics why. I think it also applies to a dynamic shadows engine, but I'm not sure.

    Perhaps what's needed is an algorithm to automagically convert complex polys to tris, the way 3D modelling programs do:

    <img src="http://i28.tinypic.com/23lz403.png">

    Programs like Max and Maya let you make crazy n-sided polygons, but blow the surface it's all converted to triangles.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using a full 3D physics/graphics engine, I suspect, would make the creation of a 2D game much simpler. I think the focus is to remain 2D, for... speed? I don't know. Though, if I programmed a platformer today, from scratch, not being a programmer, I would use polygons and meshes of them to organize all information.

    It would just be... 2.5D, or whatever you call it, for simplicity's sake. The playing field entirely 2D, game environment, collision stuff and appearance somewhere in between. SSB style.

  • Havok is free. Dunno how easy it's be to use though.

  • And ODE is open-source. But, these are future things, if ever, from the looks of it.

  • I suppose that Ashley could rename the current Physics behavior to Newton Physics Dynamics and try to implement other engines for 1.0.

  • Or just replace this current one with an implementation of something made for 2D physics rather than 3D. I believe that in a past discussion on the topic, one 'Chipmunk' was brought up - I meant to look into it but never got around to it. If and/or when Construct gains more 3D capacities, NGD would be a good idea but right now a more concentrated-purpose behavior is needed (wanted).

  • What about Box2d?

    http://www.box2d.org/

  • What about Box2d?

    http://www.box2d.org/

    Dont have pixel collision

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