User Tag List

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

Thread: Pathfinding

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator ProPatch Maker

    Join Date
    Jun 2006
    Location
    Norway
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Pathfinding

    I found this article on how to make a path finding formula: http://www.clickteam.info/kb/start/i...?showtopic=313

    However, the example doesn’t work, and I’m not sure how to make one myself.

    Angle = Angle + CollisionMask( X + Cos( Angle - 45) * 64, Y + Sin( Angle - 45) * 64 ) * 3
    Angle = Angle - CollisionMask( X + Cos( Angle + 45) * 64, Y + Sin( Angle + 45 ) * 64 ) * 3

    I have no idea how to use this code. Can anyone explain or preferably make an example showing how to make a pathfinding code based on this formula using 32 directions instead of 360?

  2. #2
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pathfinding

    This is really for people who are making a 'custom' movement by using event lines.

    What you should do instead since you are using 32 directions is use this event:
    --Always
    -Set direction to direction + CollisionMask(X + Cos(direction*11.25 - 45) * 64,X + Cos(direction*11.25 - 45) * 64)
    -Set direction to direction - CollisionMask(X + Cos(direction*11.25 + 45) * 64,X + Cos(direction*11.25 + 45) * 64)

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator ProPatch Maker

    Join Date
    Jun 2006
    Location
    Norway
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pathfinding

    Sorry, I get an error. I’m really bad at this formula thing. How is it done, exactly? If lets say, the “enemy” has to find the “player”, shouldn’t that be in the formula? I tried editing the thing, but with no luck.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator ProPatch Maker

    Join Date
    Jun 2006
    Location
    Norway
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pathfinding

    I've uploaded a file that uses collision mask. Can someone tell me why it doesn't work?
    http://mb.erathean.com/collisionmask.mfa

    It is supposed to move on a parallel line with the obstacles

  5. #5
    No Products Registered

    Join Date
    Jul 2006
    Location
    Umeå, Sweden
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pathfinding

    Use theese instead

    Dir( "Enemy" )-CollisionMask(X( "Enemy" )+Cos((Dir( "Enemy" )*-11.25)-45)*16, Y( "Enemy" )+Sin((Dir( "Enemy" )*-11.25)-45)*16)

    Dir( "Enemy" )+CollisionMask(X( "Enemy" )+Cos((Dir( "Enemy" )*-11.25)+45)*16, Y( "Enemy" )+Sin((Dir( "Enemy" )*-11.25)+45)*16)

    Directions work the opposite way from angles in MMF

  6. #6
    No Products Registered

    Join Date
    Jul 2006
    Location
    Texas
    Posts
    1,225
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pathfinding

    Ah. I see.

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator ProPatch Maker

    Join Date
    Jun 2006
    Location
    Norway
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pathfinding

    Thanks guys, but it didn’t turn out as I had hoped. It still doesn’t find it’s path.

  8. #8
    No Products Registered

    Join Date
    Jul 2006
    Location
    Umeå, Sweden
    Posts
    1,090
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pathfinding

    Of course it does'nt... this only tells it to turn if it gets close to a wall...

  9. #9
    Clicker Fusion 2.5Android Export ModuleSWF Export Module

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

    Re: Pathfinding

    There is a pathfinding extension available for MMF2. It works very well, definitely worth a try.

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export ModuleInstall Creator ProPatch Maker

    Join Date
    Jun 2006
    Location
    Norway
    Posts
    528
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Pathfinding

    Yeah, but it’s so hard to use.

    But that collision mask thing would be very handy to fix the bug where enemies get stuck inside walls. Could you Daniel, or someone else, help me tune the code a little. It is a little buggy, it seems it needs just some fine tuning. Because when I use this code:

    Dir( "Enemy" )-CollisionMask(X( "Enemy" )+Cos((Dir( "Enemy" )*-11.25)-45)*16, Y( "Enemy" )+Sin((Dir( "Enemy" )*-11.25)-45)*16)
    Dir( "Enemy" )+CollisionMask(X( "Enemy" )+Cos((Dir( "Enemy" )*-11.25)+45)*16, Y( "Enemy" )+Sin((Dir( "Enemy" )*-11.25)+45)*16)

    The Enemy turns away from the wall a little to late when walking towards the down and right wall. I’m sure all I need to do is to change some of those numbers to make it walk away a little sooner, but I can’t find the right once.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. 2.5 pathfinding
    By Panchos in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 8th December 2013, 12:20 PM
  2. Pathfinding
    By Limyr in forum Multimedia Fusion 2 - Technical Support
    Replies: 9
    Last Post: 28th November 2012, 09:58 PM
  3. pathfinding
    By graboide in forum iOS Export Module Version 2.0
    Replies: 6
    Last Post: 9th October 2012, 11:33 AM
  4. iso pathfinding
    By Horn in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 11th June 2007, 10:37 PM
  5. pathfinding
    By rurkryber in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 11th February 2007, 11:20 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
  •