Couple questions.

  • March 16, 2018 at 21:42 #22904
    jjejj87
    Participant

    Hi, I’ve purchased Apex Path to replace Unity NavMesh and agent for my project. I couldn’t figure out how to do the following.

    1) disable pathing component completely during runtime for root motion animation override – I am simply disabling and enabling SteerableUnitComponent, is this the intended way?

    2) How do I check if there is a valid path before moving? I can get message back from subscribing the Status Component Script (as shown in the tutorial video) after calling Move method on the Unit but is there a way to do it without calling Move?

    3) How do I change the speed of unit during runtime? I looked into Humanoid Steering Component but it is read only.

    March 16, 2018 at 22:38 #22906
    jjejj87
    Participant

    Okay for 3) I found an API doc inside the document folder. It should be good.

    Also, how do I find the nearest Grid from a vector3 position? and how do I check if a vector3 position in on grid?

    I apologize in advance if I am asking obvious things, but I have to say that the document is not really great and also split up in ways that make finding basic operations quite time-consuming. I am guessing once I get around it, it will be better but I think you guys should really work on documents. Also, while the tutorials are quite nice, it feels more like a marketing video than an actual usage video.

    • This reply was modified 1 month ago by jjejj87.
    March 19, 2018 at 10:03 #22914
    Geminior
    Keymaster

    1) disable pathing component completely during runtime for root motion animation override – I am simply disabling and enabling SteerableUnitComponent, is this the intended way?
    That’s one way. Another would be to call the Wait and Resume methods on the UnitFacade.

    2) How do I check if there is a valid path before moving? I can get message back from subscribing the Status Component Script (as shown in the tutorial video) after calling Move method on the Unit but is there a way to do it without calling Move?
    To test for a valid path you need to issue a path request and get the result back. There are multiple examples in the examples project showing how to issue path requests. Do a search for path request and you will find them.
    The gist of it is as follows:

    3) How do I change the speed of unit during runtime? I looked into Humanoid Steering Component but it is read only.
    The SpeedComponent has a SetPreferredSpeed method. The HumanoidSpeedComponent will however override a set speed with strafe of back pedal speeds if that is how the unit moves.
    It is generally recommended that you create your own speed component to match your exact requirements.
    Again there are examples in the examples project (SceneSpecific->ChangeUnitSpeed)

    With regards to documentation, we are well aware that written documentation is lacking.
    Unfortunately it is not viable for us to improve on that.

    March 19, 2018 at 14:58 #22924
    Rami
    Keymaster

    Also, how do I find the nearest Grid from a vector3 position?

    This depends a bit on how you want to measure ‘nearest’ – nearest from grid center? or perimeter? A simple way to do this would be as follows:

    and how do I check if a vector3 position in on grid?

    Simply check whether the grid at the given position is not null, e.g.:

    March 20, 2018 at 20:45 #22958
    jjejj87
    Participant

    Thanks for the replies! Really helps!

    Another issue to ask here (sorry that I have so many)

    When 2 dynamic obstacles are placed on the grid, with boxcolliders, and they intersect, touch or are close to each other, the pathing seems to ignore either one. Is this the intended result? Should I be using a mesh collider instead of 2 box collidered Dynamic Obstacles?

    March 21, 2018 at 12:51 #22965
    Rami
    Keymaster

    I cannot reproduce that issue, which we also know is supposed to be handled. We recommend using box colliders as they are simpler and will result in better performance, but you can use mesh colliders if your use-case needs it.

    Try turning on Gizmo visualization and inspect the grid to see whether the cells are marked red as expected (denoting that they are blocked). Try playing around with the settings on the grid, pathing agent and the obstacles.

    If you cannot solve this yourself, please provide some images or videos of the issue occurring, as well as the settings on your components. If you cannot post them here, you can mail them to us at: support@apexgametools.com.

    March 27, 2018 at 03:14 #22991
    jjejj87
    Participant

    Just found out the cause of the dynamic obstacles issue. basically the grid debug (grids turning red) is just not an accurate representation. I basically have to overcompensate the size of the obstacles and just avoid intersections as much as possible. It is quite misleading.

    As to clarify my previous question. If my unit agent is outside of grid space, how would I find the nearest grid to snap to? I know that you posted a loop based solution which seems very inefficient – to loop them sounds very bad. Is there an API with possibly a distance parameter like the Unity NavMesh, or do I have to do it manually through looping through the whole grid array?

    I also have another question. I am trying to adjust ground offset during runtime but they are read only. What can I do to change ground offset?

    I have to say, that the whole interface structure is very cumbersome and distracting.

    March 27, 2018 at 10:43 #22998
    Geminior
    Keymaster

    Off grid navigation is not supported, however the examples project contains an example of how it could be achieved. Look for OffGridPreProcessor and OffGridPostProcessor.

    groundOffset is read-only on the UnitFacade but you can change it via the UnitComponent, just be sure to call RecalculateBasePosition afterwards.
    You can also simply expose the setter on the UnitFacade.

    For that to work you must of also add the setter to the IUnitProperties interface.

    You are of course entitled to the opinion that interfaces are cumbersome and distracting, however you have bought a generic product. Apex path exposes multiple extension points and multiple options to override built-in functionality, to cater for a wide range of use cases.
    It is not realistic to expect a lean, specialized solution tailored to your specific use case.
    However, since you have full source access you can modify and refactor to your heart’s content.

You must be logged in to reply to this topic.