Question on Collision and Overlap differences

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • Hi to all,
    I am in a good point on my exercises to learn how to use CTF2.5, my Invaders like game is nearly completed (2-3 days of work is a good time for a newbye on Fusion, I think).
    Now I have a question about collision between objects, as an example a laser beam that hits a spaceship.

    Some tutorials use

    Object>Collisions>Another Object event,

    others use

    Object>Collisions>Overlapping another Object event.

    The effect in the game, for a small game like mine, is the same for the two events.
    The Enemy Spaceship is destroyed with lasers, sounds and explosions effects, and in the other way if an enemy hits the player ship it is game over.

    Wich are the differences in using the two events?
    In a Shoot'em Up game is better a Collison or an Overlapping event?

    Edited once, last by 1Ombra1 (October 10, 2017 at 12:57 PM).

  • on Collision working single time. (one shot - one kill)
    on Overlapping works every time when one objects hits another. (it's your laser beam)
    ;)

    Humm...
    so an Overlapping type is better if I have somethng like a column of energy that destroy everithing and is active only for a little bit of time,
    the Collision type is better for a missile impact like event?
    Is this the main difference between the two events?

  • collision - only activates the first time your objects touch each other ( the objects have to come apart from each other & recollide to activate this event again)
    overlap - activates constantly if your objects are touching each other

    so i guess overlapping is good for lasers, otherwise the laser will only be able to hit each enemy once lol

    i'd say its always best to use overlap & just set an enemy objects flag to "on" wen it is destroyed to stop it from getting hit & comboed multiple times.

  • Now I was seing some esxperiments and I see that the Collision events are labeled with green color in the Event Editor, the Overlapping events are black.
    So there is also a different processing time on the two types of event, I suppose, Collisions are processed before the Overlappings, am I right?

  • @10MBRA1, Yes. The differently colored events, which are green by default, do have a different processing time than black events. The green events are not processed every frame; they are processed only when their trigger happens. In the case of 'On Collision', it would be when a pair of objects initially collide. In the case of 'On Overlap' this would be checked every frame. This can be costly in terms of performance because the 'On Overlap' condition can consume a lot of computer processing resources relative to most other black events. They are ways to mitigate this performance decrease, but you typically will not notice the different unless you have a) a big / complex game, b) multiple huge objects colliding with each other and none have the bounding box collision option checked, or c) play your game on a device such as a handheld phone.

    • Please login to see this link.

    Please login to see this picture.

  • My understanding is that collisions get checked before all of your events - in other words, Fusion checks all of your collision events, and only then moves onto event #1. So, it might be beneficial to place those events earlier in your code (where convenient) so that the order in which you see them is closer to the order in which Fusion processes them.

    Also note that collisions will get tested even if they are in deactivated groups (ie. "active when frame starts" is UNchecked). This is not a concern, other than that it consumes some performance, so it's good to keep in mind.

    Please login to see this link.
    My Fusion Tools: Please login to see this link. | Please login to see this link. | Please login to see this link.


  • Also note that collisions will get tested even if they are in deactivated groups (ie. "active when frame starts" is UNchecked). This is not a concern, other than that it consumes some performance, so it's good to keep in mind.

    I would never imagined something like this, if I have an inactivated group I would logically supposed that no events in the group will fire.
    This thing is to be keeped in mind with great projects with massive amount of collisions, in this case is better to use overlappings instead of collisions.

  • found this post by Francios (one of the creators of fusion) in an old thread, thought it might be of sum interest.

    Quote

    Re: Collision lag bug!!!
    OK, I need to explain how a Overlapping condition works. We take the first object at its current coordinates (the actual X and Y position) and ask the collision with all the other objects. All the other objects are tested at there position of when the frame started. In you example, you ask for the collision between the GRAY and then the GREEN (is it green I'm colorblind!). So it takes the actual coordinates of the grey and compares it to the previous coordinates of the green, even if it has been moved in the actions of the same loop.
    To make you example work, you should just invert the objects in your condition, replace the gray by the green and vice versa, and it works.
    Yves and I have been talking about making the collisions work with the actual coordinates, but this would change the bahavior of MMF and maybe create problems with previous applications. So we do not know exactly.
    In your hundreds of events of programs, just make sure the object that has just moved is in the first position of the condition, and everything will work fine.

  • From my observations:
    The collision between two objects or object colliding with the background behaves differently depending on what built in movement you have selected on said object/s. By default it is triggered every time one object moves before any regular events happen (Green events do not follow the event sheet's "from top to bottom" structure). They are more limiting as they can only happen at the beginning of the frame once.

    The Object is overlapping another object or Object is overlapping a backdrop behaves mostly the same whichever built in movement you have. Unlike collision, this is checked within the event (So if other conditions aren't met it won't be checked), but also the more overlapping conditions you have the more it will hit performance. In an "object overlapping another object" event, the first object will be check using its updated position, while the second won't (Where it was at the beginning of the frame cycle).

    Hope that helps

    - BartekB

    Join the Click Converse Discord! - Please login to see this link.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!