Construct 3 suggestions & ideas

Suggest and vote on ideas for Construct 3! Please note this is only one aspect of planning. We do not guarantee any features here will be implemented, even if they are top-voted ideas. The aim is just to collect feedback. Remember to search for existing submissions before adding an idea, describe your ideas as comprehensively as possible, and vote for plausibleĀ ideas that are well thought out. Please seeĀ our full guidelines on suggesting features.

Rectangular Collusion Check for Objects

It checks whether specific object is within the rectangular area or not.

Usage

Very useful when coding A.I as it requires plenty of area-collusion checks. Currently you must have hitbox to test it with a return function with unnessary work for CPU.

Useful when working on game mechanics like "Crouch" for protagonist. Current solution is to create additional mask object and pin it to the character which is OK as long you have only few characters.

Replacing masks for collusion checks with this feature would surely improve optimization.

Implementation

Must work with "Invert"

Must have 1 object to pick with which it supposed to check for collusion.

Must have 4 values of position for Rectangular to enter: Left (X), Top (Y), Right (X), Bottom (Y)

Example of how this would in Crouch, when you want your character to go back to normal height:

Object: Solid

Left: Player.X-abs(Player.Width/2)

Top: Player.Y-20

Right: Player.X+abs(Player.Width/2)

Bottom: Player.Y

If collusion happens - my character wouldn't return to normal height and stay in Crouch.

I hope this explains it.

Summary

I'm sure many developers will make good use of this feature. It would help solve many problems with collusions, improve performance and further increase quality of development.

Thanks for attention!

  • XpMonster
  • Jul 19 2020
  • No status
  • Attach files
  • XpMonster commented
    21 Jul 09:01

    I already do that with a return function where I am using smallest Sprite possible which through sent parameters is set to a position & then stretched. It's OK, but would be more convenient with a single condition.

    I mean we have offset collusion, but it could also be done using even a simplier function. Plus you can do with rectangular overlap the same you can do with offset overlap, but you can't do with offset overlap what you can do with rectangular overlap ;D

    I think that's pretty summarizes my complaint. Being hard pro-platformer dev I barely ever found offset overlap to be useful. Offset check is very useful, but when you can't define the area that will give wrong results in some occassions. Probably oldschool games with tilemap for solid objects have much less problem with that, but not every game can use this approach.

  • Admin
    Ashley Gullen commented
    20 Jul 09:34

    You could just use an invisible sprite object set to the rectangle you want to check, and test collision with that. There's no efficiency gain to be had from that, since if we implemented this, it would do the same thing as that.