New Collision Mode: Angled Bounding Box

This forum is currently in read-only mode.
From the Asset Store
Create your game with this complete pack of images and animations!
  • right now, if you have a thin rectangle turned at a 45 degree angle

    per pixel is a waste of resources, especially if the object is very large

    but bounding box, creates a non angled box that encompasses the entire diagonal object

    and has no practical use whatsoever in most situations, but is very fast

    I think the ability to have a bounding box that would enclose the original sprite, basically the box you see in the picture editor, that will turn with the object's angle, and scale with it

    would be much quicker than per pixel, and be extremely useful in many situations

  • Good feature, sign me in petition. Right now have this situation (need 45 degree angle LOS obstacle for wall)

  • Couldn't you get a dummy hit box to do that for you?

    Like if sprite angle = 45 dummy set frame to frame 2, or for something a little more accurate, you could set up the dummy to set its height and width via multiple image points from the host sprite.

    dummy set height to distance(imagepointX("top"),imagepointY("top"),imagepointX("bottom",imagepointX("bottom"))...?

    Ok dunno if that will work haven't tested it.

  • not sure what you mean, and in any case, that sounds like alot of work for what should be as simple as clicking an option in a dropdown menu

  • Couldn't you get a dummy hit box to do that for you?

    Like if sprite angle = 45 dummy set frame to frame 2, or for something a little more accurate, you could set up the dummy to set its height and width via multiple image points from the host sprite.

    dummy set height to distance(imagepointX("top"),imagepointY("top"),imagepointX("bottom",imagepointX("bottom"))...?

    Ok dunno if that will work haven't tested it.

    What do you mean by dummy hit box? The whole point of this is for the box collision mask to rotate with the sprite, so there aren't huge corners of nothingness that can trigger collisions in rectangular-ish rotated objects. A dummy hitbox would use an extra object, and would have to use per pixel collisions anyways, since it's the only type of collision mode that works with rotated sprites. The whole point is so you can better benefit from the performance savings of box collision mode.

  • Sorry, I wasn't talking about rotating the hit box.

    This cap kinda shows what I mean, not exactly perfect tho.

    http://dl.dropbox.com/u/666516/resizehitbox.cap

  • What do you mean by dummy hit box? [...] would have to use per pixel collisions anyways, since it's the only type of collision mode that works with rotated sprites.

    For a dummy hitbox, use a box. It rotates and does not use per-pixel collision, as it has no pixel definition.

  • This is a good idea for C2, but per pixel isn't much of a waste of resources. At 1 bit per pixel for a collision mask you're only using 128kb of memory for a 1024x1024 object, on machines which these days typically have well over 1gb physical RAM going spare.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • if you have large moving sprites for platforms, per pixel causes major slowdown

    I don't think 1024x1024 is impractically large for a modern hd game, but look at this cap

    runs fine

    toggle the action that rotates the sprite, and it causes major slowdown on my system, which is not top of the line, but fairly up to date:

    bounding box collision: 9300 fps

    per pixel: 25 fps

    AMD Phenom II X4 965 Black Edition Deneb 3.4GHz

    4GB 1333 (PC3 10600) Dual Channel

    Radeon HD 5870 1GB

  • This is a good idea for C2, but per pixel isn't much of a waste of resources. At 1 bit per pixel for a collision mask you're only using 128kb of memory for a 1024x1024 object, on machines which these days typically have well over 1gb physical RAM going spare.

    I think he means processing time, which is significantly larger for per-pixel than bounding box.

    Did you try dummy box objects? they are *exactly* what you're looking for.

  • I forgot about the box object. Tis one of those lost forgotten objects.

  • Its better to use Box object for collisions?

  • No, unless you have a huge object that needs a custom hitbox to save on performance.

  • not sure if it was a bug but a while back i remember rotating a box object has the same kind of problem as bounding box collisions, using it might not fix this problem.

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