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

Apex Path v2.0 [RELEASED] - High Performance, Easy to use dynamic Pathfinding

Discussion in 'Assets and Asset Store' started by Reinholdt, Jul 16, 2014.

  1. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Allow me to rephrase then. Apex Path does not provide a means to add margins to obstacles.
    Obstacles are defined by their collider.
    However since obstacle detection can easily be overridden, you can implement any logic you need for it.

    The built-in height navigation allows you to set the allowed max height and max slope angle. This can be done either globally or per agent. So cells in which e.g. the slope exceeds a limit will be blocked to the agents with that limit.
     
  2. jnorris-sca

    jnorris-sca

    Joined:
    Oct 6, 2017
    Posts:
    8
    I have a couple questions about your asset.

    Can your asset easily support multiple elevations? I have caves underneath the terrain, and I want AI to be able to navigate on both the terrain and inside the caves.

    Can your asset support different sizes for the agents? I have multiple different creatures that all have a different radius and height. If so, is there any extra performance overhead for each different size?
     
  3. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    You may well find it difficult to use a grid based path finder with caves. Of course it depends on the layout.
    Apex Path does not support multilevel geometry inside a single grid, so only if the levels can be represented as separate grids (flat xz planes) will it work, think stories in a building.

    We do support having multiple agent sizes, however only in single grid scenarios. Navigating from one grid to another is not supported with multiple agent sizes.

    The performance overhead of supporting multiple size agents is minor.
     
  4. jnorris-sca

    jnorris-sca

    Joined:
    Oct 6, 2017
    Posts:
    8
    Unfortunately, the cave system in my game is pretty complex. Do you have any plans on supporting multilevel geometry better?
     
  5. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,010
    What about a scenario where the agent wants to go from point A to point B and there is a path along the ground, but there is an obstruction lower than the agent's head? I tried this in a demo scene and the agent thinks he can get to point B, but his collider hits the obstruction and he just gets stuck there and never moves on.

    upload_2017-11-14_7-42-49.png

    Is there a way to solve this without custom coding?

    [EDIT]
    Nevermind. I re-baked the grid and it works now.
     
  6. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    I am afraid we have no plans to do that. You are better off looking at a Nav Mesh solution as Nav Meshes fully support multilevel geometry.
     
  7. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    That would do it :)
     
  8. jnorris-sca

    jnorris-sca

    Joined:
    Oct 6, 2017
    Posts:
    8
    I'm currently using a nav mesh based pathfinding, but the performance isn't great when generating and updating the nav mesh. My game has a lot of dynamic elements, so unfortunately it can't be prebaked. I was hoping to find a better alternative for a dynamic world. Oh well.
     
  9. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,010
    When I import Apex into 2017.1.2p2 I get the following error.

    XmlException: Document Type Declaration (DTD) is prohibited in this XML. Line 1, position 10.
    Mono.Xml2.XmlTextReader.ReadDoctypeDecl ()
    Mono.Xml2.XmlTextReader.ReadDeclaration ()
    Mono.Xml2.XmlTextReader.ReadContent ()
    Mono.Xml2.XmlTextReader.Read ()
    System.Xml.XmlTextReader.Read ()
    Mono.Xml.XmlFilterReader.Read ()
    System.Xml.Linq.XDocument.ReadContent (System.Xml.XmlReader reader, LoadOptions options)
    System.Xml.Linq.XDocument.LoadCore (System.Xml.XmlReader reader, LoadOptions options)
    System.Xml.Linq.XDocument.Load (System.IO.TextReader reader, LoadOptions options)
    System.Xml.Linq.XDocument.Parse (System.String s, LoadOptions options)
    System.Xml.Linq.XDocument.Parse (System.String s)
    Apex.Editor.NewsWindow+<>c__DisplayClass2.<CheckAutoShow>b__1 (System.String xml) (at c:/Development/Apex Applications/ApexGameTools/Source/ApexShared/ApexSharedEditor/NewsWindow.cs:62)
    Apex.Editor.EditorAsync+EditorAsyncTask`1[System.String].Poll () (at c:/Development/Apex Applications/ApexGameTools/Source/ApexShared/ApexSharedEditor/EditorAsync.cs:193)
    UnityEditor.EditorApplication.Internal_CallUpdateFunctions () (at C:/buildslave/unity/build/Editor/Mono/EditorApplication.cs:109)

    It doesn't seem to cause a problem with using the asset in the editor, but who knows what effect it might have otherwise. Is there a fix for this?
     
  10. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    You can remove the Assets\Apex\Editor\Data\Products.manifest file.
    It may also be that the file is simply corrupt. In any case it is of no importance whatsoever.
     
  11. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,010
    It's been a while, but I've still been getting the XML error even after the Products.manifest file has been removed. I've been meaning to post here for a while, but just got around to it.

    upload_2017-12-6_20-16-35.png

    upload_2017-12-6_20-16-59.png
     
  12. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Sorry about that, I can see that is pretty annoying.
    The quick fix is to open the News window (Tools -> Apex -> News) and uncheck the "Inform of unread News at start-up." check-box.
     
  13. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,010
    Unfortunately, that isn't working. When I try to open that window then I get the following error:

    UnityException: get_isPlayingOrWillChangePlaymode is not allowed to be called from a ScriptableObject constructor (or instance field initializer), call it in OnEnable instead. Called from ScriptableObject 'NewsWindow'.
    See "Script Serialization" page in the Unity Manual for further details.
    Apex.Editor.NewsWindow..cctor () (at c:/Development/Apex Applications/ApexGameTools/Source/ApexShared/ApexSharedEditor/NewsWindow.cs:26)
    Rethrow as TypeInitializationException: An exception was thrown by the type initializer for Apex.Editor.NewsWindow
    System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (RuntimeTypeHandle type) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs:101)
    UnityEditor.EditorAssemblies.ProcessEditorInitializeOnLoad (System.Type type) (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:136)
    UnityEditor.EditorWindow:GetWindow(Boolean, String)
    Apex.Editor.SharedMenuExtentions:ShowNewsWindow() (at c:/Development/Apex Applications/ApexGameTools/Source/ApexShared/ApexSharedEditor/SharedMenuExtentions.cs:17)

    I'm using Unity 2017.2.0p4
     
    blitzvb likes this.
  14. jebediahh

    jebediahh

    Joined:
    Feb 20, 2017
    Posts:
    26
    Hello - I'm close to buying this, but I'd like to know first if Apex Path will work well with MapMagic World Generator. I'm looking at Apex Path because I'm reading that it is dynamic in nature... whereas a nav mesh has to be pre-baked.
     
  15. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Hmm ok, well on 2017.2.0f3 it all works fine.
    I am afraid you will have to put up with that error at start-up until we release an update get rid of it.
    The error has no impact on the functionality of the product. It is an editor only and completely separate news check.
     
  16. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    As long as the generated world has one or more colliders to identify terrain, obstacles etc. then it will work just fine with Apex Path.
     
  17. Dee_Lucky

    Dee_Lucky

    Joined:
    Jun 26, 2015
    Posts:
    53
    Is it possible to use this asset for 500 units with decent fps rate?
     
  18. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    That depends on a number of things, most important of which is the frame budget for path finding and steering.
    It also depends on how many steering options are enabled besides the basics of moving, e.g. local avoidance etc.
    And finally it depends on the minimum specs of the device the game is to be played on.
    So I can't give you a conclusive answer on this.
     
  19. Dee_Lucky

    Dee_Lucky

    Joined:
    Jun 26, 2015
    Posts:
    53
    I'm doing an RTS like starcraft II, so I need basic local avoidance and basic movement. The game is only for PC
     
  20. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    My point was that it is practically impossible to guarantee that a certain number of units will be viable.
    There are simply too many ifs. I can give you a few examples.
    1. If all 500 units requests a path at the same time, then the result will not be satisfactory.
    2. If the frame budget is 1 ms, then it is likely not going to be satisfactory.

    So you will simply have to test out your specific scenario.
    Sorry I can't provide a more conclusive answer.
     
  21. Dee_Lucky

    Dee_Lucky

    Joined:
    Jun 26, 2015
    Posts:
    53
    Okey, so I've bought the Apex Path and Apex Steer. Can someone assist me in achievieing pathfinding starcraft II-like?
    https://gyazo.com/932ea94b3a78db2a95d8266e61a3d240
    As you can see the agents take into account their ally agents which are currently attacking enemy while searching for another path. How to achieve that?
    Thanks
     
  22. Rami_Ahmed

    Rami_Ahmed

    Joined:
    Apr 14, 2016
    Posts:
    25
  23. Jacky_Boy

    Jacky_Boy

    Joined:
    Dec 8, 2013
    Posts:
    95
    @Geminior I am having difficulty getting quadrupeds to work with Apex. I'm using Opsive TPC with Apex for Humaniod characters and it's been working perfectly. I created a generic prefab of an animal and set the root node, set it up with Apex quick start but when I try to get it to patrol using Behavior designer (which is integrated with Apex) get no response.
     
  24. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    While you will likely want to write a new speed component and adjust a number of steering settings to match quadrupeds, there is nothing different in how path finding and steering works. Could it be that the radius of the creature exceeds half a cell size and you are not using clearance?
    Other than that I can't think of a reason.
     
  25. Jacky_Boy

    Jacky_Boy

    Joined:
    Dec 8, 2013
    Posts:
    95
    I use clearance but not sure about cell size. I will have to look into this more then. I will save writing a new speed component as a last option. Thanks for the feedback @Geminior
     
  26. Tomza

    Tomza

    Joined:
    Aug 27, 2013
    Posts:
    596
    Hi,
    I'm looking for a shooter AI character solution for my game. I don't see any examples of Apex for shooter AI bots. Is it possible with the asset?
     
  27. Grendelbiter

    Grendelbiter

    Joined:
    Oct 14, 2016
    Posts:
    123
    Hi, I need Pathing or Steering (or both) for my Space Shooter. It's 3D but with a top down camera and everything is in the XZ plane. I made a Ship script which takes in a Vector3 Targetpoint where it turns to and a float Thrust Value from -1 to 1 which fires up all engines attached to the ship which each add force to the Rigidbody of the ship. What I would like to know is would it be possible (and easy) to use Apex Path and Steering to drive those variables? I really would like the AI to use my system, I tried other movement solutions and they all don't look convincing.
     
  28. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    I assume that by AI you mean Path finding and Steering. Apex Path can support any game genre,but being a grid based solution it imposes restrictions on the environment / terrain. The level design must adapt to a grid based layout.
    What solution to choose really depends on what you value the most. Compare the pros and cons of grid based vs Nav Mesh and choose whatever matches your requirements best.
     
  29. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    The default locomotion implementation in Apex Path does not use forces. However locomotion is one of many extension points, and you can easily implement your own that uses forces.
    There are examples in the examples project and the default implementation will also work as a reference for creating your own IMoveUnits implementation.
     
  30. Glowing_Slab

    Glowing_Slab

    Joined:
    Jun 19, 2015
    Posts:
    43
    Hi,

    We’ve had very nice results using Apex Path in our demo, but having problems triggering animation states. Following the tutorial here https://unity3d.com/learn/tutorials/modules/intermediate/asset-store/apex-path-and-mecanim
    I’m trying to just have a 1D blend tree (from an idle animation to a run animation) and to keep the turning behaviour as it is without the script. I kind of think this should be simple but nothing seems to work. Are there any more videos or tutorials beyond the one linked above?
     
  31. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    I assume you have downloaded the tutorial project to go with the article.
    Other than that there are a fair amount of posts on our forum, if you do a search for Mecanim. This one in particular may be of use.
     
  32. Glowing_Slab

    Glowing_Slab

    Joined:
    Jun 19, 2015
    Posts:
    43
    Thanks, @Geminior! I eventually figured out that the problem was my animations were of the character walking on the spot, not actually moving forward. I've written a script which ties the set speed to switch animation states, and that works pretty well.
     
  33. NewMagic-Studio

    NewMagic-Studio

    Joined:
    Feb 25, 2015
    Posts:
    432
    How Apex handles the animations without root motion? Unity system changes agent.velocity using the animator deltaTime so the agent moves at the same speed than would do a root animation, but in the example i see of Apex just gives a Vector3 speed parameter to get the magnitude and use that to get one animation or other in a Blend Tree
     
  34. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Please refer to this post.
     
  35. u3dxt

    u3dxt

    Joined:
    Jul 6, 2013
    Posts:
    317
  36. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,010
    @Geminior What happened? Why is Apex Path deprecated?

    [EDIT]
    Actually, I see that all Apex assets have been removed from the assets store. The only things remaining are some tutorials.
     
    Last edited: Nov 17, 2018
  37. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Please refer to this post for a brief explanation.
     
  38. PNep

    PNep

    Joined:
    May 15, 2017
    Posts:
    3
    @Geminior
    I know, deprecated, but please a tiny help...
    Hello… Im having problems trying to get my animal wander on my mesh, but it falls down and keeps wandering on the grid… Im unable to change the grid to look like the mesh :'(
    Heres a screenshot…
    Scene view before run
    http://prntscr.com/mm5zs8
    Scene view after run
    http://prntscr.com/mm61gq
    Pleaseeeee I really need help :'( Its been more than an hour playing with the parameters :'(

    EDIT: Ok, I seem to have found the problem...
    http://prntscr.com/mm72f8
    So I can try to make the unit go up (look at the waypoint created), but it just sticks to the lower area of the grid

    Please forgive me for mentioning @Jacky_Boy and @magique , I don't think the owner of the asset might be able to reply, and looking at other Apex users on here, you two were the most recent ones to have come online... I understand that this problem is mine and I must be doing something incorrectly and I should be the one to try to solve it myself, but Im unable to, so please forgive for the notif you get, and please help me if you can, if not then also np
     
    Last edited: Feb 17, 2019
  39. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    172
    Hi folks,

    Is any one managed to fix the "GridComponent.cs" WARNING/ERROR on editor with Unity 2019.1 ?

    @Geminior please any help with this issue driving me crazy ?
     
    Last edited: Aug 6, 2019
  40. Glowing_Slab

    Glowing_Slab

    Joined:
    Jun 19, 2015
    Posts:
    43
    I also am being driven crazy by GridComponent.cs error - with Unity 2018.4. Annoyingly, it compiles on one of my machines but not the other?
     
  41. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    172
    The asset is deprecated from long time and as you can see there is no support at all.

    My advice will be to upgrade your project to another A* path finding asset.
     
  42. fisj

    fisj

    Joined:
    Mar 1, 2013
    Posts:
    7
    I was necroing an older game project and encountered the same issue. The thing where it would work in one project and not another was confusing for me also. It worked fine until I nuked my library, and it would have compilation problems on the GridComponent afterwards. Unity was getting confused by Grid.cs and a native definition so after changing that and fixing up any refs Apex works fine for me (Check your warnings). You may need to remove the GridComponent and re-add it. I've tested in 2019, 2020, 2021.

    Many thanks to the Apex guys for open sourcing this, and also for creating such a well coded solid pathing solution (at least for my genre of game, RTS)
     
    Recon03 and Glowing_Slab like this.
  43. Glowing_Slab

    Glowing_Slab

    Joined:
    Jun 19, 2015
    Posts:
    43
    Thanks fisj, this is going to be extremely helpful - and its a relief to read that you got it going again. I'd narrowed it down to something in the metadata folder in the library but got lost after that. Any further info on the native definition/refs would be great. Thanks!
     
  44. Glowing_Slab

    Glowing_Slab

    Joined:
    Jun 19, 2015
    Posts:
    43
    Got the GridComponent working, thanks for the advice fisj! However, now I can't get multiple instances of the GridComponent working for multiple grids. Complains about Waypoint.cs.
     
  45. Recon03

    Recon03

    Joined:
    Aug 5, 2013
    Posts:
    838

    Yes I used Apex Path since it was released and still use today on and off. Mine has been pretty much set up tailored to my own needs, as I always been into AI, I added alot of my own functionality to it, but the basics of Apex Path tech is still there and working with the newer versions of Unity. 2020, 2021. and so on. The Open source, made this possiuble.