Search Unity

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. Linus

    Linus

    Joined:
    Feb 22, 2012
    Posts:
    112
    Small editor error:
    Code (csharp):
    1.  
    2. Destroy may not be called from edit mode! Use DestroyImmediate instead.
    3. Also think twice if you really want to destroy something in edit mode. Since this will destroy objects permanently.
    4. UnityEngine.Object:Destroy(Object)
    5. Apex.SingleInstanceComponent`1:Awake() (at Assets/Apex/Apex Path/Scripts/SingleInstanceComponent.cs:19)
    6.  
    Happened when I duplicated a prefab that has A*
    Should I just do as suggested. Or is a symptom of perhaps I should make sure to only have one of certain components?

    Also, links to the forum on your site keeps just giving me the sites index page.
     
  2. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    I am wondering if you guys support ?

    I have simple question as to why the current speed of the agent in steerable unit component is showing up as 2. What could be causing it to have a velocity even though I am not applying any force to move
     
  3. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    A unit's velocity will only increase if the unit is told to move somewhere, so something must be telling it to move.

    Without knowing your exact setup it is hard to provide a solution. The MecanimMoverComponent is an example on how root motion from an animation can be used to move a unit, so the unit must have an appropriate animation that it can control.
     
  4. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Most of the components of the Game World can only exist once in a scene, so that would be why you get that error.
    The logic is basically meant to remove excess instances of components that are only supposed to exist once, but apparently this will be triggered in edit mode as well if you duplicate a prefab.

    So as you suggest yourself, simply make sure only one instance of these components exists.

    Oh and yeah the forums were down for a few hours, but they are up and running again.
     
    Last edited: Oct 14, 2015
  5. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    We do indeed. We have a forum here and a direct support email and this thread for general questions.
    My best guess, with the very limited information provided, is that the force being applied is gravity.
    If you look at the component you will also see Current and Actual Velocity properties, which show the actual velocity vector. If it has a 0 for x and z but a negative value for y then my guess is correct.
    If not, I will have to ask you to provide some more information on the setup and send it to our support email support(at)apexgametools.com or write an entry on the forums.
     
  6. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    why I am getting this error every time

    Error 429 Too many requests
     
  7. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    I really can't tell you, mainly because you don't state anything about where you get this.
     
  8. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    I am getting this error whenever I tried to login to forums
     
  9. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    I see, we have not had anyone report this before. We did do some updates to the site, so perhaps your login attempt clashed with that, resulting in an error. Have you tried again since?
     
  10. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    I am still getting it. I can't get in
     
  11. kotor

    kotor

    Joined:
    Dec 3, 2013
    Posts:
    140
    Since I can't post it in the forums. I will use this for support.

    In the Apex for Mecanim example project. If you try to make the robot to make sudden directional change you can see the pretty obvious jerk in the motion trying to adjust the direction. This will make a very jerky AI agent. Is there any way to smooth out the animation ?

    Thanks
     
  12. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    That is truly odd, since other people, ourselves included, have no issues.
    We will have another look to see what can cause this.
    The Mecanim project is simply an example of how animations can be used for locomotion.
    The precision of the actual movement depends on the animations and how well they blend together. The example animations are few and fairly simple.

    On the Apex Path side of things, you can adjust the acceleration and deceleration rates of the unit (Humanoid Speed Component) to control how fast it changes its speed.
     
    Last edited: Oct 22, 2015
  13. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    Does Apex navigation system work in a local coordinate space?

    Suppose that I have a plane (static in world space) contains some static obstacles on it. I configure Apex navigation system on this plane. Then, I set this plane as a child of a moving object that keeps moving in a constant speed, which means that this plane is put into a local coordinate space (not static anymore). Can I reuse the Apex navigation system I configured for this plane?
    If no, what is the most appropriate way to setup a Apex navigation system on a moving plane?
     
  14. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Apex Path does not support local space, all navigation is done in world space.
    We do have it as a feature request, and may end up implementing it at some point, but currently we cannot offer this functionality.
     
  15. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    I see. Thanks.
     
    Last edited: Oct 30, 2015
  16. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
  17. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
  18. Dan2013

    Dan2013

    Joined:
    May 24, 2013
    Posts:
    200
    #4 on the first page of this thread.
     
  19. Ariegos

    Ariegos

    Joined:
    Jun 20, 2015
    Posts:
    24
    Hi I have a couple of questions.
    Can you have creatures of different widths in the same map? Also say you have a multistory game level with stairs... Does Apex build a navmesh (or whatever it uses) for all the levels or must it be built somehow by hand?
     
  20. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Currently the path finder does not take unit width into consideration, the grid's cells must be large enough to hold the largest unit. There are work-arounds to allow for blocking larger units, by using our attribute system with dynamic obstacles. We will implement an actual clearance map at some point, but when is still unknown.

    Since Apex Path is grid based, it is limited in its multi-level geometry support. Multi.layered buildings however are supported, but you need to set up a grid on each level and connect them using portals (on the stairs, elveators etc.)
     
    Ariegos likes this.
  21. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    Not really related to Apex Path, I notice you guys have "Procedural Content Generation" product on your page. Is it going to be on sale on AS or in-house system only?
     
  22. Jakob-Rasmussen

    Jakob-Rasmussen

    Joined:
    Jul 26, 2014
    Posts:
    92
    Yes - we are currently working on a number of PCG tools, but we have no release date yet. But please let us know if you are looking for anything in particular.
     
  23. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    341
    I'm glad you guys are working on it. There is a lack of PCG tools for AS right now. Since PCG is vast on many topics, I'm still new to Unity and Game overall. But, I would love to see something, as powerful as No Man Sky PCGs or Shadow of Mordor. For example, army of procedural orcs, algorithmically birthed with different bodies, heads, armour, weapons and names, or a procedural quest generation, or a procedural Level generation, which provides a different layout, traps and enemies for every adventurer who ventures into it, or a sandbox like Minecraft, where each user can change the actual game world, each user can have distinct game experience and story, etc. A system that is scalable to even mobile-friendly platforms, built-in or easy to extend LODs, Imposter technique, Batch, Occlusion Culling, Streaming, Terrain support, or even Infinite Terrain support, anything that make the vast open-world as cheap as possible.
     
    Last edited: Nov 26, 2015
  24. Johnny-Casual

    Johnny-Casual

    Joined:
    Oct 7, 2014
    Posts:
    20
    Hi there, I saw on your main page the Apex Utility AI. Will that at some point be available on the asset store?

    Thanks.
     
  25. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    It will be available for purchase in the not too distant future, most likely January.
    You can sign up to the mailing list on our site to be informed when it becomes available.
     
  26. Ariegos

    Ariegos

    Joined:
    Jun 20, 2015
    Posts:
    24
    This is something I'd be very interested in. However I'd want it to have more than simple fedex quests, like get item or kill monster.

    I'd like what the player does in game, to affect whether other quests are made available or they disappear, not just in the current map but in the entire game. This must affect other factions too. So that means the player's actions must affect how NPCs feel about the player and each other.

    I'd also want an editor where main quests can be randomly generated in the editor, but their structure can be edited after random generation. I'd also want to be able to add dialog text to the generated quests as well. Pixel Crushers have done some of what I've requested, but I know of no one who has done random quest generation.
     
    Last edited: Nov 30, 2015
  27. Extrawurst

    Extrawurst

    Joined:
    May 22, 2013
    Posts:
    43
    Hi thanks for the awesome product!
    I would like to know what will be causing problems if we would move your code to a separate solution and simply build the DLL and include it into our projects asset folder ?

    Cheers,
    Stephan
     
  28. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    That should not cause any issues as long as you compile all the Apex products you have into one dll.
    The problem arises if trying to compile each product into a separate dll.
     
  29. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    A performance question: I see from the tutorials that an agent can have many components. Are these components responsible for the steering or pathfinding (inefficient >1000 agent) or are they just GUI candies? In other word, does the GAMEWORLD component centralize all that computing in one update loop where the data is nicely packed for maximum efficiency?
     
  30. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    The various components control various aspects of the steering and path finding of the unit.
    Each unit steers on its own, there is no overall manager.
     
  31. bmcv123

    bmcv123

    Joined:
    Feb 28, 2014
    Posts:
    6
    I followed the very helpful tutorial on setting up Mecanim with Apex Path. Of course, since the 2.0 update, the script no longer works. How can I use the Rotate method to pass the proper Speed and Angle values to the animator?
     
  32. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    If you download the Mecanim Example project from the asset store it is updated for the latest version of Apex Path.
    It does not however make use of Rotate, as rotation is built into the animations, i.e. a velocity change will also cause the unit to turn in the direction of the change.
    If you have animations that purely handle turning, then you can of course pass the input given to the Rotate method onto your Mecanim animator.

    You can pretty much just move the following from the Move method to the Rotate method:
    Code (CSharp):
    1. float angleDirection = TurnDir(_transform.forward, velocity);
    2. float angle = Vector3.Angle(_transform.forward, velocity) * angleDirection;
    3.  
    4. _animator.SetFloat(_angleId, angle);
    and then replace velocity with targetOrientation.
    You can also pass on the angular speed the same way other values are passed on the Mecanim, i.e. _animator.SetFloat(...)
     
  33. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Hey Geminior, I'm trying to use Apex Path as a dll for my project to help reduce compile time. I'm building the dll with Visual Studio 2015 on Unity 5.1.3, by creating a new unity project, importing visual studio 2015 tools and the latest Apex Path, and then building the solution in visual studio.

    I keep getting an error whenever I try to move the editor dll into my project (I'm also deleting all the scripts before I copy the dlls to my asset folder.) A window pops up titled "Apex Error" that says: "Apex Path was unable to create its settings file, please report this to the Apex Team."

    No error or warning appears in the console. The settings file doesn't get created. This happens even if I leave the settings file from a normal asset import after copying the dlls over and deleting the scripts.

    Any ideas? Is there an ideal process for setting up Apex Path with dlls?
     
  34. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Since we chose to launch with full source, we also made use of some features which are only available in full source mode. On top of that there are also some checks made that look for certain files. In the case of the settings file, it looks for another cs file that is supposed to exist to determine the install folder.
    Of course once compiled, there is no source file to be found, and hence the error.

    You will have to change how the settings file is located. Its line 130 in ApexSettings.cs.
    It should be noted that the settings file only influences update checks, and has no impact on the functionality of Apex Path.
     
  35. Alic

    Alic

    Joined:
    Aug 6, 2013
    Posts:
    137
    Ok, that's super easy. Thanks Gem, sorry I didn't figure it out myself.
     
  36. Linus

    Linus

    Joined:
    Feb 22, 2012
    Posts:
    112
    Regarding compile time. Try moving the scripts Apex folder to Standard Assets, Unless its a placebo effect on me, it seems like stuff in Standard Assets dont get recompiled if something is changed inn a script outside of the Standard Assets folder.
     
  37. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    Hello. I need an advice. Can I use this asset for a local avoidance in a mobile tower defence game? How does performance here compare to standard Unity's pathfinding. I have paths precalculated but I need units to be able to avoid collisions with each other on those paths, and we are talking about 150 - 200 units on the level.

    And one particular question is: Can I manually edit the pathfinding grid in Apex (block and unblock squares)?
     
  38. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    Apex Path alone only has very basic local avoidance; to have proper local avoidance you will need Apex Steer.

    I would have linked our mobile performance page, but apparently it is currently broken. We have tested Apex Path on numerous tablets and phones with 128 navigating agents, and performance is fine.
    Compared to Unity our solution generally performs better. Several improvements have been made in Unity 5 which does bring performance in certain areas (dynamics in particular) closer to Apex Path.
    However whether 150-200 units will perform to your satisfaction is simply impossible to answer with certainty. It depends on your budget, the map, the density of the units. My best guess is that it will perform just fine.
    Yes, there are multiple ways of doing that. You can do it manually, you can override how the grid determines blocked cells at initialization time or you can use dynamic obstacles which also allow some cells to be blocked to certain units but not to others.
     
  39. illinar

    illinar

    Joined:
    Apr 6, 2011
    Posts:
    863
    Thank you.
     
  40. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Hi @Geminior

    I thought it would be cool to do a quick integration of the FinalIK Grounder Bot + Apex Path with Height Navigation, and it seems to work and it looks quite good, particularly the way the Bot kind of hangs on the ledge when walking on the edge.

    Here's a 1 minute video if you're interested: https://dl.dropboxusercontent.com/u/10212162/FinalIK_ApexPath.mov

    cheers

    Nalin
     
  41. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    That looks good, can you contact us at support(at)apexgametools.com so we can discuss this further?
     
  42. puzzlekings

    puzzlekings

    Joined:
    Sep 6, 2012
    Posts:
    404
    Sure will do

    Nalin
     
  43. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
  44. ostrich160

    ostrich160

    Joined:
    Feb 28, 2012
    Posts:
    679
    Hi Apex guys
    I was wondering if there was a way to stop units turning in place. So for example, if a unit wants to reach a waypoint 180 degree's behind it, instead of rotating and then moving off, it will have a turning circle by moving off and rotating in a curve to look at the waypoint

    Cheers
     
  45. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    There is no custom data property on cells, however there is a cost property.
    By default setting a cost will have the path finder take that cost into consideration when calculating a path.

    If you have no use for that, you could potentially use the cost property for storing your own influence data, as long as they can be represented in an int (e.g. bit masks).
    However if you do that you also need to change the cell cost strategy as you don't want the path finder to interpret your data as cost.

    To do so, add the following component to your project and attach it to the GameWorld.
    Code (CSharp):
    1.     using Apex.PathFinding;
    2.     using Apex.WorldGeometry;
    3.  
    4.     public class ZeroCostStrategyFactory : ICellCostStrategyFactory
    5.     {
    6.         public ICellCostStrategy CreateCostStrategy()
    7.         {
    8.             return new ZeroCostStrategy();
    9.         }
    10.  
    11.         private class ZeroCostStrategy : ICellCostStrategy
    12.         {
    13.             public int GetCellCost(IGridCell cell, object unitProperties)
    14.             {
    15.                 return 0;
    16.             }
    17.         }
    18.     }
     
  46. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    I am not sure I understand the question.
    Are you asking if there is a way to have a unit have a curved path rather than a straight line path?

    By default, a unit will move in the direction of the path and turn to face their direction of movement, not the other way around.

    So if you want the unit to move in the direction it is facing and have the turn logic make it face in the direction of the path, then it is possible, but you have to write your own steering and orientation components.
    While the basics of such an implementation are rather simple, you also have to handle the actual following of a path, from node to node and arrival.

    Having a unit do a curved path may also lead to other issues, since it is not actually following the path it may veer off into an obstacle.
     
  47. ostrich160

    ostrich160

    Joined:
    Feb 28, 2012
    Posts:
    679
    I should clarify, I'm not referring to general movement, just when the unit sets off.
    As an example, lets say you have a selectable unit, and you place your waypoint behind the unit. It will turn 180 degrees on the spot, and then move off. What I want to happen is the unit to move off the way it is facing and then turn to face the waypoint.
    Think about how a car would move off
     
  48. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    I see ok, well the mid section of my answer is still valid in that case.

    You could potentially also add a preprocessor and add a via point some distance in front of the unit to the request.
     
  49. docsavage

    docsavage

    Joined:
    Jun 20, 2014
    Posts:
    1,021
    Hi @Geminior,

    I have experimented with apex path in the past and it's great but was beyond my coding abilities to get it to work with my project. After some programming progress (only a bit really) I have decided to come back to it as it may sort out my problems.

    The game world is essentially like a pacman/dungeon grid. The vector points and tiletype for each cell/position in the grid have been manually coded in a boardmanager. I then add each one to a dictionary list with the vector as the key and the tiletype as the value that will affect movement speed. The cells are essentially non visual. The scenery graphics are then loaded into the scene as a prefab from the resources folder on the level start. There are no colliders or rigidbodies in the game. It's currently all based on each characters transform.position and distance in relation to each other. Each cell is spaced at 1 world unit apart. Movement is only 4 way.

    My player movement is basically reading an input, checking if the vector/cell is on the dictionary list and if it is it moves to it. There is no diagonal movement and no cutting corners.Old school really.

    The problem is the pathfinding. I have tried all sort of things to get the Non player characters to move around the maze in a decent way but it's turning into a nightmare. Pathfinding in maze like areas appears to hammer performance. The Astar test scenes I tried would fly along on a relatively crowded yet open grid/area but they are crawling in the mazes. The biggest grid is only 50 x 100 large and has no more that 15 non player characters on it.

    I know apex is a great product for most other game types but do you think I can get it to work with what I have done up to now?

    There are a lot of scripts with apex path so if you could narrow down which ones I should be looking at implementing it would be a great help.

    Thanks for the great product. I would appreciate some help if possible.

    doc
     
  50. Geminior

    Geminior

    Joined:
    Feb 12, 2014
    Posts:
    322
    I have taken the liberty of moving this question to our own forums, and will answer it there.