Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Pathfinding in unity: Beta of Path now online

Discussion in 'Made With Unity' started by AngryAnt, Mar 31, 2008.

  1. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    Hm. Not really sure whats going on there. Haven't seen that before. I'm gonna go through the entire source at some point though and hopefully we'll not see bugs like that on the other side.
     
  2. PhilipV

    PhilipV

    Joined:
    Aug 25, 2008
    Posts:
    103
    Hope it's not a bug!
    by the way... Why is the y offset of the character controller set to 1 instead of 0?
    Last question:how do i export a mesh from a unity generated terrain, to be used with path?
    thanks for answers and sorry if my questions seem noobish, but i am that :)
     
  3. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    I don't really know why the offset is set like that. Its been a while since I designed that test project. Regarding terrain and navigation, read the first post on this page (page 7).
     
  4. half_voxel

    half_voxel

    Joined:
    Oct 20, 2007
    Posts:
    978
    To export a terrain you can use the esxportToObj script on the wiki, although the max size I was being able to use was 1/32 otherwise it was running to slow.
    Although when I tried that i could not make the character move, it just didn't respond, except for one time, but that time it took a too long way instead of the obvious (I don't know if it was a bug or something else, but the debug info told me it was not standing on a mesh, so it was probably something I did wrong).

    PS: I am building a RTS game and I tried the pathfinding system but I didn't got it to work very well so I'm up to developing an own pathfinding system using raycasting. But I don't want to ruin AngryAnts thread about HIS pathfinding system, so when it is complete I will start an own thread.

    /Aron
     
  5. PhilipV

    PhilipV

    Joined:
    Aug 25, 2008
    Posts:
    103

    Why you don't reccomand generating navmesh data from terrain?
    My idea was to create the terrain inside Unity, export the mesh to Cheetah3d or Something accessible, cut some holes for the obstacles, and reimpoort it into Unity...Would this be a bad idea?

    @Sturestone: Hmm... are you writing that as a c++ plugin for unity? I pretty decently know c++, and if you don't mind, i'd really like to see how a pathfinder works, so, again, if you don't mind, could you let me go through your source? Obviously if you don't want me to, it's not a problem if you say no, I understand that
     
  6. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    Phillip: I *really* encourage you to read up on what NavMeshes are and how they are used. First off, you could simply browse through this thread and read my replies to posts with similar questions.
     
  7. cj-currie

    cj-currie

    Joined:
    Nov 27, 2008
    Posts:
    337
    Hi Emil,

    Great work on this system. I'd like to do a Javascript adaptation of your Path system since I don't know C# very well. I understand it well enough to figure out what's going on, but I don't know how to call methods from the path.dll using Javascript. Do you know the JS equivalent of "using PathLibrary", or are any .dll in the assets folder automatically included?

    -Thanks
     
  8. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    I'm currently in the process of rewriting the system entirely for stability and an editor interface among other things. When I'm done, I suspect Arges will be doing a tutorial on it :wink:
     
  9. cj-currie

    cj-currie

    Joined:
    Nov 27, 2008
    Posts:
    337
    I'm looking forward to that!
     
  10. PauloBarbeiro

    PauloBarbeiro

    Joined:
    Sep 10, 2008
    Posts:
    15
    Hi Angryant,

    Well I was reading the demo and the documentation on your site, and I couldn't understand properly how the 'marks' works. I mean... while the demo is running I could click on that GUI buttons to mark the triangles as 'unwalkables' but, I did not figure out how can I mark the triangles previously, which would be the right way to do it in a game.

    Could you give me a little help?

    Thanks,
     
  11. PauloBarbeiro

    PauloBarbeiro

    Joined:
    Sep 10, 2008
    Posts:
    15
    ah... by the way,
    I've tested the demo with another mesh, a bit more complex, and the result are not the best as possible, take a look...

    The click were just beside the start position, but the path elected, were the longest as possible. And the worst is that it happens quite frequently :(
     

    Attached Files:

  12. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    As I'm very far in my progress on Path 0.4b I'm no longer debugging 0.3b. I promise that not only will many of the mentioned bugs be addressed in the next release, but also "full" (whatever that means?) editor integration will be included and I'll have good documentation available.

    I'm aiming for a release around unity the 2.5 release as last I heard otee were aiming for a release at GDC09 in march.
     
  13. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    Sounds great :)
    I hope you are able to reach that target :)
     
  14. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286
    Really looking forward to the next version :)
     
  15. diese440

    diese440

    Joined:
    May 25, 2007
    Posts:
    105
  16. _alia_

    _alia_

    Joined:
    Nov 4, 2008
    Posts:
    29
    I see that AA is not debugging 0.3 anymore but I was wondering if anyone here had come across the following error and what they did to fix it. This happens in the web player. Is the source available so that I can hack a fix in? or am I just plain doing something wrong (tm).

    unity security internal call - throwing exception
    SecurityException: This method is not supported in the unity web player for security reasons.
    System.Environment.GetFolderPath (SpecialFolder folder)
    PathLibrary.PathDebug.Init ()
    PathLibrary.PathDebug..ctor ()
    PathLibrary.PathDebug.Instance (Boolean launchTerminal)
    PathLibrary.PathDebug.Instance ()
    PathLibrary.PathSystem..ctor ()
    PathLibrary.PathSystem.Instance ()
    ControlPathDemo.Update ()
     
  17. amcclay

    amcclay

    Joined:
    Aug 8, 2006
    Posts:
    143
    Does anybody have any experience using this system on the iPhone? Is the iPhone up to the task of doing all of these pathfinding calculations?
     
  18. AngryAnt

    AngryAnt

    Keyboard Operator

    Joined:
    Oct 25, 2005
    Posts:
    3,045
    Alia:
    That is caused by the debug window gadget. Is it rendering the system unusable in the webplayer?

    amcclay:
    Only time will tell. 0.4 should run just fine there, but so far unity iPhone doesn't support external assemblies.

    Edit:
    Please direct Path 0.4 questions here: http://forum.unity3d.com/viewtopic.php?p=124253
     
  19. _alia_

    _alia_

    Joined:
    Nov 4, 2008
    Posts:
    29
    It seems like it. The exception is causing the construction to fail.. so then later no pathFinder object.
     
  20. daodao

    daodao

    Joined:
    Feb 1, 2009
    Posts:
    16
    I found Rej has some comments about external assemblies in this thread
    http://forum.unity3d.com/viewtopic.php?t=17782

    It seems Unity Iphone support external assemblies. Does it mean path can run on iphone? Further, does it mean UnitySteer can run on iphone?
     
  21. Arges

    Arges

    Joined:
    Oct 5, 2008
    Posts:
    359
    Interesting, I hadn't read that quote by ReJ. Can't lose anything by trying it out. Bear in mind that the latest Path editor components are written for 2.5, and will likely not work on Unity iPhone, so you may need to generate the Path Asset with Unity 2.5.

    On the specific case of UnitySteer, yes, you could use it on iPhone whether it supported external assemblies or not, since you get the source for it. :) I avoided using .Net 2.0 features (how I missed my generics!) but do let me know you find any that slipped by.
     
  22. daodao

    daodao

    Joined:
    Feb 1, 2009
    Posts:
    16
    Hi, I'm trying to test UnitySteer. I clone the UnitySteerExamples from github. Then, open it in Unity 2.5.1. When I open and run the scene, e.g. Avoid obstacles, I was told some script exceptions like this:

    Assets/Sources/LightningBolt.cs(6,7): error CS0246: The type or namespace name `UnitySteer' could not be found. Are you missing a using directive or an assembly reference?

    Could you tell me what I'm missing? Should I copy the UnitySteer to Assets/Scripts/? I have tried that but still failed to run the scene.
     
  23. Arges

    Arges

    Joined:
    Oct 5, 2008
    Posts:
    359
    Hello daodao,

    The UnitSteerExamples project was set up with UnitySteer as a submodule, so that's perhaps what's causing you problems. Please try directly with the project as provided here:

    http://www.arges-systems.com/files/UnitySteer.zip

    And let me know how it works. If it doesn't, please start a separate thread, to avoid cluttering this one.

    Cheers,
     
  24. daodao

    daodao

    Joined:
    Feb 1, 2009
    Posts:
    16
    A quick report. It works. Thanks :)
     
  25. daodao

    daodao

    Joined:
    Feb 1, 2009
    Posts:
    16
    I tried Path 1.0 on Unity Iphone basic and I was told this:

    ** (/Applications/Unity iPhone/Unity iPhone.app/Contents/Frameworks/MonoCompiler.framework/mcs.exe:11051): WARNING **: The class System.Collections.Generic.IEnumerator`1 could not be loaded, used in mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089


    It seems Path using dotNet 2.0 features which is not allowed in Unity Iphone. Can we avoid dotNet 2.0 features? Can I help on this?
     
  26. varmint

    varmint

    Joined:
    Nov 30, 2008
    Posts:
    15
    Hello, :D 8)

    We have a few people during our beta testing get lost in the game world and were not sure where to go. So, inspired by Hansel and Gretel, we put in a "bread crumb" system. Well, in our case, foot steps :p

    It uses Path to create a path to the player's destination in the 3D world. This will be in our next release and upcoming demo. Below is a video showing it in use.

    http://www.youtube.com/watch?v=66Kt6XiuTRA

    Also I wanted to ask if there is any chance of a release coming out that would allow us to unload paths between levels? ;)
     
  27. MANISH KUMAR

    MANISH KUMAR

    Joined:
    Nov 22, 2010
    Posts:
    57
    how i use your path tool in unity projects pls give me any demo....
    perfect demo
    ...............
     
  28. The Port Of Riches

    The Port Of Riches

    Joined:
    Nov 15, 2011
    Posts:
    29
    This looks very nice. Why hasn't Unity implemented such a system?
     
  29. UnknownProfile

    UnknownProfile

    Joined:
    Jan 17, 2009
    Posts:
    2,311
    Unity is bringing pathfinding in 3.5.
     
  30. ivanzu

    ivanzu

    Joined:
    Nov 25, 2010
    Posts:
    2,065
    They are doing it right now its coming in unity 3.5:)
    But i think that it wont be available for unity free maybe only basic stuff.
    http://blogs.unity3d.com/2011/06/16/unity-roadmap-2011/