Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[Navigation Script] FREE AdHoc Pathfinder (AHP) for vast, infinite, and Multi-Terrain sets (w/Demo)

Discussion in 'Works In Progress - Archive' started by Kivak, Aug 7, 2014.

?

Should this be available for public use?

  1. Yes, but only for free

    35.5%
  2. Yes, but I wouldn't use it

    9.7%
  3. Yes, I would pay a small fee for it

    61.3%
  4. No, nothing useful here

    0 vote(s)
    0.0%
  5. Maybe... (Please comment)

    0 vote(s)
    0.0%
Multiple votes are allowed.
  1. SteveB

    SteveB

    Joined:
    Jan 17, 2009
    Posts:
    1,451
    Wow how did this fly under my radar (actually I'm surprised there hasn't been more discussion since Oct)...fantastic!

    -Steven
     
  2. glenrhodes

    glenrhodes

    Joined:
    Oct 25, 2013
    Posts:
    56
    Question - I just placed the code into my project, and I'm getting the following errors:

    Assets/Scripts/AStarAdHocPathfinder/AStarAdHocPathfinder.cs(285,41): error CS0037: Cannot convert null to `bool' because it is a value type

    and

    Assets/Scripts/AStarAdHocPathfinder/AStarAdHocPathfinder.cs(285,41): error CS1662: Cannot convert `iterator' to delegate type `AStarAdHocPathfinder.FindPathToTargetCorutine()' because some of the return types in the block are not implicitly convertible to the delegate return type

    It's a line of code that says:
    return null;

    I was able to get rid of the error by changing it to
    return false;

    but I wanted to make sure that would be the expected / correct fix.
     
  3. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    140
    @jason.fisher: Interesting... I'll have to take a look at that. Also, were you able to get anywhere with the modification to planetoids?


    @glenrhodes: Yes that should work fine! :) Good catch!
     
    Last edited: Jan 15, 2015
  4. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    140
    I just wanted to put in a quick note in apology for letting this go for a while. This fall was really bad for me - my dad passed away from brain cancer and life has been pretty chaotic (I'm only 26 so loosing my dad was not expected). That said, I'm hoping to get back into working on this soon. Please feel free to post questions and improvements here and on Github where the code resides. :)

    Happy New Year everyone!
     
    FBTH likes this.
  5. John-G

    John-G

    Joined:
    Mar 21, 2013
    Posts:
    1,114
    Deepest condolences on the loss of your father.
     
    Kivak likes this.
  6. schipman

    schipman

    Joined:
    Jan 22, 2010
    Posts:
    45
    Is there an example scene on how to use this? This looks perfect for my project but I haven't had any success getting it functional... thanks!
     
  7. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    140
    Hi there @schipman !

    I can make an example scene for you a little later this evening but it's really straight-forward. In the meantime, did you take a look at the instructions here: https://github.com/mrabenhorst/AdHoc-Pathfinder#how-to-use

    That might be faster than waiting for me. :)
     
  8. then00b

    then00b

    Joined:
    Oct 5, 2012
    Posts:
    8
    Hi @Kivak. Seems like it's been a little while since this thread was last updated but I was curious if, with a little modification in regards to flipping the Z and Y axis, this could be used for 2D pathfinding (disregarding gravity considerations, etc)?
     
  9. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    140
    Hey there @then00b !

    Yes I have been away from Unity development for a little while. Luckily the thread updates me to new posts. ;)

    To your question... yes I am sure this could be adapted to a 2D layout. All you need to do is remove the section of code which tests for slope and casts the rays. Instead, you might replace that with something that tests for obstructions in the 2D world.

    That said, I don't know how much this will gain in the 2D world. There are many 2D pathfinders that are much much faster than AHP. The only thing AHP might have on the rest of the options is the fact that it works on infinite planes. But I imagine that isn't unusual.

    I hope that helps! :)
    -Kivak
     
  10. Cosmas

    Cosmas

    Joined:
    Jan 9, 2010
    Posts:
    133
    What ever happened to this? Did jason.fischers changes get merged into the main branch?
     
  11. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    140
    Hi Cosmas!

    Development has stagnated and no changes were requested to be pulled into the main repo. :(
     
  12. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,545
    Screen Shot 2019-12-04 at 10.39.20 AM.png

    I'm not a great coder but your script is easy enough for me to understand:) Im testing it trying to make procedural roads on terrain. Im starting with a list of points and am testing Path Painter to see if the two will work together. Thanks for sharing the script. It is very neat.
     
  13. Kivak

    Kivak

    Joined:
    Jul 13, 2013
    Posts:
    140
    Very welcome. I am glad to see people are still finding uses for it so many years later. :)
     
    protopop likes this.