User Tag List

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

Thread: Yet Another Pathfinder example

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,509
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)

    Yet Another Pathfinder example

    Me again, with yet another pathfinding example...

    This is mostly a proof-of-concept at this point, and I haven't added the actual movement yet, but it does find a path - look at the bottom of the list output. I left in all the other debugging text, because it might help people understand what the algorithm is doing as it searches for a path. I will hopefully release a more polished example soon...

    Download: https://1drv.ms/u/s!Atq7cUIJ7uextEuI...MCZCf?e=L4XdKg



    Like my previous example, it's an implementation of the A* algorithm on a non-grid-based map. Unlike my previous example, this one is designed to be extremely simple, but not necessarily efficient or robust (I expect it to be slow on maps with many nodes). It doesn't use any complicated maths, it's only about 35 lines of code (incl. comments) instead of 130, and you don't even have to define polygons any more.

    It doesn't use any extensions, and in fact the only objects required are Actives and Backgrounds, so it should (though I have no way of testing this) be compatible with all runtimes.
    As always, feel free to share, modify and use it however you want

    btw: I only just noticed the new(?) "Pick objects with minimum/maximum expression value" condition, and it's super-useful, so thanks Clickteam!

  2. #2
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,435
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    You again?! xD
    Amazing work! Looking forward for the updates on this.

    So, how does it know the shapes exactly?
    I know it got nodes, but I wonder how it knows if it's part of one or another...

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,509
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NaitorStudios View Post
    So, how does it know the shapes exactly?
    I know it got nodes, but I wonder how it knows if it's part of one or another...
    It doesn't. It just uses normal collision detection with the background obstacles to work out which nodes are connected (you have to put the nodes slightly outside the obstacles).
    Normal collision detection is obviously slow, but the advantage of this approach is that you don't need nearly as many nodes, and it's pixel-perfect. This example uses 32 nodes, which is fewer than a 6x6 tile grid (which would use 36) - and most of the collision detection is just done once at the start of the frame, so you don't need to do it each time you search for a path.

  4. #4
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,435
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Really interesting, curious to see it actually moving!

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,509
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Basic unit movement has now been added:



    Download: https://1drv.ms/u/s!Atq7cUIJ7uextFDM...l_LRZ?e=6oY2nh

  6. #6
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,435
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Awesome!
    Hmmm, I wonder why it goes to node 8 instead of 27 in this particular scenario...
    Is that really the fastest path?


  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,509
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Nope, you're right. I stumbled upon the same bug, but it shouldn't be too hard to fix. There might be a performance hit though...

  8. #8
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLC

    Join Date
    Jul 2008
    Location
    UK
    Posts
    1,509
    Mentioned
    16 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by NaitorStudios View Post
    Hmmm, I wonder why it goes to node 8 instead of 27 in this particular scenario...
    Is that really the fastest path?
    Try now: https://1drv.ms/u/s!Atq7cUIJ7uextFEB...IR_wX?e=FZLgad
    I'm hoping that should have fixed it... ( some of the code comments might be outdated now, but I'm going to comment everything more thoroughly later anyway)

  9. #9
    Forum Moderator Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleFirefly 3D Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Mac Export Module (Steam)Universal Windows Platform Export Module (Steam)Firefly 3D Module (Steam)
    NaitorStudios's Avatar
    Join Date
    May 2010
    Location
    Brazil
    Posts
    1,435
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    Oh yeah, seems a lot better!

  10. #10
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleMac Export ModuleInstall Creator ProPatch Maker
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Oct 2012
    Posts
    345
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Great work Muddy! Thanks for sharing!

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Will there ever be a pathfinder plugin to htnl5?
    By warlords in forum HTML5 Export Module 2.5
    Replies: 1
    Last Post: 26th October 2020, 07:23 PM
  2. Missing a Pathfinder Object to Android?
    By warlords in forum Android Export Module 2.5
    Replies: 0
    Last Post: 18th October 2018, 06:02 AM
  3. Trying to create my own Pathfinder need help...
    By warlords in forum Fusion 2.5
    Replies: 1
    Last Post: 12th September 2014, 02:57 PM
  4. My crappy pathfinder
    By SoftWarewolf in forum File Archive
    Replies: 4
    Last Post: 10th April 2013, 10:40 PM
  5. PathFinder Demo Errata Corrige
    By Dave78 in forum File Archive
    Replies: 4
    Last Post: 3rd February 2009, 06:59 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
  •