User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Collision Mask Overlapping

  1. #1
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Collision Mask Overlapping

    I'm having this issue with the way MMF2 handles overlapping. I'm trying to create some events that will allow me to use ONE active object to both display a visible animation, and have a hidden collision mask.

    The events should work like this:

    1. Set Collision Mask Animation (stopped)
    2. Do any collisions needed (Player vs. Active Obstacle)
    3. Set visibile Sprite Animation (walking)

    So, theoretically, this SHOULD switch the object to a collision mask, do collisions with it, then switch to a different animation at the end of the frame.

    But this isn't happening. No matter what I do, the collision events are ignored, collisions occur on the wrong animation, or collisions are buggy. Maybe I just don't understand how overlapping/collisions work in MMF yet. I thought I'd get it after a couple of years! But still its a mystery to me.

    I have a very simple example file here, and would VERY much appreciate a solution to this issue.

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=220699

    It seems that MMF2 doesn't allow you to use one animation as a collision base, then switch to another one before it draws the frame. It seems to always use the LAST set animation for all collision events in the whole frame.

  2. #2
    Clicker Multimedia Fusion 2SWF Export Module
    Jacob's Avatar
    Join Date
    Jul 2007
    Location
    Second pixel to the right
    Posts
    3,208
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Mask Overlapping

    Instead of changing animations, just change direction.

  3. #3
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Mask Overlapping

    Will that work?

    I just tried your solution. It doesn't work. Changing the direction still applies the overlapping condition to the WRONG direction.

    I don't understand how it DOESN'T work; the logic flow goes like this:

    1. Always: Set direction to RIGHT
    2. Do collision events
    3. Always: Set direction to LEFT

    But the program is performing the overlapping/collisions on the image in the LEFT direction! As you can see, this direction should be set AFTER the collision, and changed BEFORE the collision.

    Therefore, the collision event should NEVER occur while the Active Obstacle object is in its LEFT facing direction, but it does!

    The collision event is triggered as it is overlapping the object in its Left facing direction. How is this possible?

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Mask Overlapping

    Are you using the "Collides with" condition as the first line of the event? (Is it highlighted in red?) If so, this event will be executed out of order of the rest of the event list, as soon as it occurs (possibly due to other preceding events) - try adding an "Always" to the top of the event.

  5. #5
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Mask Overlapping

    No, I am using overlap. I have uploaded another very simple example here:

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=220798&#Post220 798

    This screen shot should explain everything. PLEASE look at the example file too, "Collision Check 2". Its only 4 events long.

    http://fc07.deviantart.net/fs71/f/2011/026/c/9/sample_by_pencilgoblin-d3845u0.png



  6. #6
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Mask Overlapping

    I actually build my collision masks into my objects whenever I can, rather than having two objects following each other. Here's an example of this. The downside of this that you can't test an object's hidden collision mask frame against an other object's hidden collision mask frame, due to some MMF2 limitations (if you test for overlap between two objects, and the second object in the condition was moved or changed somehow previously during this frame by an event, that update isn't taken into account when compared - in other words, the second object will have the position and collision mask it had in the last rendered frame).

    I know it's annoying. I scratched an entire game idea, because I couldn't move multiple objects around, changing animation frames and testing for collisions in any combination, within a single frame.

  7. #7
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Mask Overlapping

    I see. So the second object in comparison isn't updated. Well, that gives me an idea. What if you simply compared BOTH objects?

    Code:
    *Player overlaps Obstacle
     +Obstacle overlaps Player
    This way it compares BOTH objects against each other, giving both objects the chance to be the primary object in comparison.

    Actually, I just edited the program to test this theory, and it works! If you check for overlap on both objects in two conditions, the overlap condition is solved.

    I have updated the example here to show this result:
    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=220798#Post2207 98

    There are a few problems that could occur from this method:
    1. The double collision-comparisons on each event could slow down a larger application a lot.
    2. With many objects to test for (not just 2), the events could get complicated.
    3. The collision check may not work as expected with Qualifiers.

    I will further experiment with this idea. I'm going to make some stress-tests to see what it can and can not do. I'll post relevant information here.

    There really needs to be a definitive guide on how MMF2 deals with collisions!

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    turtle's Avatar
    Join Date
    Jun 2010
    Posts
    209
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Mask Overlapping

    Thanks for the information... I was trying to figure it out myself then Nifflas posted, then JimJam posted...

    I was with the spread value method... create and position a dummy object (as mask) at each instance to check for collision detection. Seems like you guys have provided a better and simpler solution.

    Didn't know double checking the collisions could worked out the way it did

    Thanks a lot Really thanks...

  9. #9
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Mask Overlapping

    No problem. I was having the same issue.

    In my game I was using the double-actives for collision/sprites. But this was causing slowdown in my game when I had more than 200 objects per level!

    I'm going to be doing some stress tests to see how far this double-checking method can go before I implement it. I suggest you do the same, so we don't run into another wall of glitches half way through our games!

  10. #10
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Collision Mask Overlapping

    Through some experimentation, this method of double-checking collisions does seem to work if you use Qualifiers.

    But, it doesn't seem to work at all if the "collision mask" is larger than the "sprite". It only works when the Mask is smaller than the Sprite. To test for proper overlap when the Mask is larger, you must only use the condition that compares the Masked object first.

    And in the case of my main project, it creates odd effects if the Mask is the same size as the Sprite. It looks like this method is not going to work for me.

    Is there ANY way to force MMF to see the updates to objects when comparing collisions? What can I do at this point, since my own work around doesn't work?


Page 1 of 2 1 2 LastLast

Similar Threads

  1. Collision Mask Help?
    By Eliyahu in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 3rd April 2011, 07:24 PM
  2. Collision Mask Overlapping
    By JimJam in forum File Archive
    Replies: 1
    Last Post: 26th January 2011, 11:39 PM
  3. collision mask
    By willow in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 25th October 2009, 08:13 PM
  4. Bug: Collision mask
    By Sphax in forum File Archive
    Replies: 0
    Last Post: 11th August 2006, 01:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •