User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 16 of 16

Thread: Need help with better/faster collision (overlap) detection

  1. #11
    Clicker Firefly 3D Module
    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)
    Adnihil's Avatar
    Join Date
    Oct 2016
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you very much for making that example, it's interesting to see how you did the movement. However the issue of walking into/over obstacles is still there. You can see this if you set the forward speed to 6 (instead of 3.0) and walk forward. Setting the speed to 60 will make the character enter the purple obstacle completely. Though in the actual game the speed would never be over 10, in theory the code shouldn't allow this to happen, should it? So it's a bug?


  2. #12
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-onFirefly 3D Module
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,300
    Mentioned
    27 Post(s)
    Tagged
    0 Thread(s)
    Sorry about that, I forgot something. I needed to add a subloop to control the stepping back out of the collision. Is this more like what you needed?

    top down rpg rev2.mfa

  3. #13
    Clicker Firefly 3D Module
    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)
    Adnihil's Avatar
    Join Date
    Oct 2016
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, thank you very much!
    After a lot of tinkering I found out that for some reason having a 'collision detector' Active object seperate from the 'Player' Active object made the movement of the player all weird and glitchy. Removing the collision detector Active(s) and using the Player Active as a collision detector itself fixed the issue.

    There's an other issue caused by the unstuck-loops though; when a part of the Player active is overlapping an obstacle (this can be achieved by standing next to an obstacle and rotating), moving forward will make the player move backwards, and moving backwards will make the player move forward. This allows the player to move through obstacles. Even with a round Player active this can still happen since it's impossible to make a perfect circle using square pixels.



    I've been trying to find a fix for this for the past couple of hours, but to no avail (most of my issues come from rotating in corners). Do you happen to know any ways to prevent this from happening?

    I also just realised that something I was planning to do isn't going to work the way I thought it would. I wanted to make the player slide along obstacles when walking into them at an angle, instead of stopping completely and having to face 90░ away from the obstacle to be able to move along it. I've tried searching for guides about this but don't really know what to look for. Does this type of movement have a name or something I could search for?

    move along wall.png (like this)

  4. #14
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,156
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    I would suggest to split the X and Y components of movement and use a separate detector for collisions anyway,
    you wont' have issues if the detector itself does not rotate

    see superquick example:
    fastloop_360_movement.mfa

    (you can change player speed in "move_speed")

    the detector can be made invisible of course

    *** edit ***

    Added backward move and "rotating speed" value
    so it's more like what you need I guess?

    fastloop_360_movement_1.mfa

  5. #15
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-onFirefly 3D Module
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,300
    Mentioned
    27 Post(s)
    Tagged
    0 Thread(s)
    I realize now that I made a mistake on the movement loop. It was not moving one step at a time, but pSpeed steps. I have fixed it now. I also separated the visual so the collision object now doesn't rotate, but the player visual does.

    As for your sliding along collision, it can be done but would require splitting the loops so that horizontal and vertical movement each have their own loop.

    top down rpg rev3.mfa

    Edit: Schrodinger, as always, did is a bit more elegantly than myself. He also separated the loops so you can slide. :P

  6. #16
    Clicker Firefly 3D Module
    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)
    Adnihil's Avatar
    Join Date
    Oct 2016
    Posts
    97
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Alright! Thank you all so much! Looks like I was making things way more complicated than they should be!
    It's also interesting to see how things can be done in different ways. This was a good learning experience!

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Way to replace obj overlap with collision
    By Huntermanx in forum Fusion 2.5
    Replies: 6
    Last Post: 31st July 2017, 12:06 PM
  2. Problem: Overlap detection is checking by the highest x and Y of an object
    By Stranger in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 30th July 2015, 12:12 AM
  3. Polygon or pixel collision . which is faster?
    By Yima in forum Fusion 2.5
    Replies: 4
    Last Post: 14th January 2014, 10:31 AM
  4. overlap (custom collision detection) issue
    By Hamcraft in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 26th May 2011, 02:08 PM
  5. Background collision vs. overlap question
    By Drcooper in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 9th August 2010, 10:47 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
  •