User Tag List

Results 1 to 9 of 9

Thread: Collision and other interactions between the same types of objects

  1. #1
    Clicker Fusion 2.5

    Join Date
    Jul 2006
    Posts
    212
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Collision and other interactions between the same types of objects

    I am struggling to find an advanced, clean method of doing this. In other programming environments, you'd use pointers and references. I need to test variables and give actions to objects on both sides, so it can't be just using the normal collision testing.

    The only idea I've had was to store one set of information in a helper object (bounds, various info) but I struggle to think of a way to do that that's not slow. If that is the recommended method, how exactly do you set it up?

    Examples of the kinds of things I'd like to do: when objects overlap, push out so they separate. A fast-moving character colliding into another will be damaging like a projectile. For these I need separate control over each for conditions and actions.

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Mar 2014
    Posts
    156
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Is this what you are trying to do?

    part: 1
    https://youtu.be/V2YB91xt9OY

    part: 2
    https://youtu.be/adi6_YDQYro

  3. #3
    Clicker Fusion 2.5

    Join Date
    Jul 2006
    Posts
    212
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Sort of, but I need one-sided conditions and actions, which makes things a lot more complicated. Having 2 collision boxes per object would also be pretty difficult for what I'm doing, since they can change size.

  4. #4
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    668
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Use bounding boxes or circles for all your collision. Don't rely on the overlap feature at all. Store your boundaries in values. Foreach loop through all your objects. On Foreach loop, store the boundaries and ID of the current object in a helper object (or global values), then nested Foreach through all of them again. On the nested loop, test if the current object's ID =/= stored ID, and compare the boundaries of that object to the stored boundaries to flag an intersect.

    Here's an example, for both rectangles and spheres. Rectangles need no manual changing of boundaries, but circles require you to update their radius if you change them and make sure the hotspot stays in the middle.
    Attached files Attached files

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Mar 2014
    Posts
    156
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by casleziro View Post
    Use bounding boxes or circles for all your collision. Don't rely on the overlap feature at all.


    How about if you are doing fastloop movements? Are you saying don't use overlap for those too?

  6. #6
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    668
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Overlap works on moving object vs static object only. If you have 2 moving objects, they will never collide properly because one of the 2 objects (object B) will not update their collision data until the next frame. This is a performance feature clickteam won't change until Fusion 3, however annoying it might be.

    For moving object vs moving object, you have to use math or some other elaborate workaround. There are a few methods (including a few of mine for complex collision) and better explanations if you search around for the "overlap delay bug"

  7. #7
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Mar 2014
    Posts
    156
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    well, my friend... If it's called the "overlap delay BUG" I think I'll just wait till F3. Hopefully we'll have the ability of defining collision polygons!

  8. #8
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    668
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    You can still use overlaps for general purpose. But if you need pixel perfect precision they just aren't up to the task with moving vs moving. It isn't really a "bug" more of an antiquated performance feature that they couldn't remove with how tied into the code it is.

    Another popular engine that has this issue is Godot.

  9. #9
    Clicker Fusion 2.5

    Join Date
    Jul 2006
    Posts
    212
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by casleziro View Post
    Use bounding boxes or circles for all your collision. Don't rely on the overlap feature at all. Store your boundaries in values. Foreach loop through all your objects. On Foreach loop, store the boundaries and ID of the current object in a helper object (or global values), then nested Foreach through all of them again. On the nested loop, test if the current object's ID =/= stored ID, and compare the boundaries of that object to the stored boundaries to flag an intersect.

    Here's an example, for both rectangles and spheres. Rectangles need no manual changing of boundaries, but circles require you to update their radius if you change them and make sure the hotspot stays in the middle.
    I went with a method pretty similar to this and it seems to work. I used overlapping to filter the "for each" loop (which for some reason only works if done from a fastloop. Otherwise it'll just run the loop for 1 object.) Thank you for the detailed response and example!

Similar Threads

  1. Help with webview + fineuploader interactions
    By haoujey in forum Android Export Module 2.5
    Replies: 2
    Last Post: 8th May 2018, 08:31 PM
  2. Replies: 19
    Last Post: 30th April 2017, 07:16 PM
  3. Counting different types of objects
    By winter in forum Fusion 2.5
    Replies: 2
    Last Post: 17th October 2016, 01:06 PM
  4. Box2D "Disable Collision Types" not working?
    By gastrop0d in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 23rd December 2011, 12:32 AM
  5. Physics collision types
    By Dynamite in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 21st February 2008, 09:51 AM

Posting Permissions

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