Reach Exact End or End Node

Hi, I’m using a newly imported installation of the asset (pro version), and I’m working on an RTS. I want my units to reach an exact end point (why would I not?) and, it seems there is no built in solution to do this. Everywhere I search I just find statements such as “this is not what you want” or “that movement would be rigid.” No, units can smoothly move to parts of the waypoint with a determined end rather than stopping whenever the unit seemingly feels like doing so.

With the built-in solutions, such as AIPath, the Seeker, and the Simple and Advanced path modifiers, no configuration could have my units always reach the exact end of a point. When working on an RTS where players want deterministic movement, why would I ever want the units to decide on their own where they end up? When I click on a position, I want the unit to go to the position unless there are obstacles. I don’t want the unit to command itself and decide its own new end point along the path.

I’d be thrilled to make my own solution, but the purpose of buying the package was to have a plug and play solution where I could configure settings to make a Seeker go from point A to point B. Not point A to point B + or - an arbitrary number.

Judging by the rest of the topics of this nature, I’m guessing this topic will be unanswered, but thanks for any help,
Bilal

Hi

Are you having issues making the path go to a specific point (see the green line rendered by the Seeker component) or is the path calculated correctly but the agents are stopping before they reach the end?

The paths will always end at the exact position you specify unless that point is not reachable, if it is not reachable it will try to move to the closest point it can reach (unless the closest point it can reach is too far away in which case the path will fail, this threshold can be adjusted under A* Inspector -> Settings -> Max Nearest Node Distance).

The AIPath movement script should also move to the exact endpoint of the path with very good precision. In 3.x the movement scripts were not as good at stopping at the exact endpoint of the path however, but since you say you are using a newly imported installation I assume you are using 4.x.
This assumes the Seeker -> Exact Start/End Point fields are set to ‘ClosestOnNode’ but that is the default value so likely you haven’t changed it. If you would set ‘Exact End Point’ to ‘SnapToNode’ instead it would move to the center of the last node in the path, which may not be the point that was specified.

Hello,

Thanks for the reply. The path is calculated correctly (shows in gizmos, success callback works), but the agents sometimes stop before reaching the end, and sometimes don’t.

The changelog in my project has 4.0.6 listed as the latest version to clarify, and the path does not appear to be failing.

Here is a screenshot showing where the agent sometimes stops before the end of the path:

I’ve tried changing the seekers Exact Start/End Point fields to each type and haven’t been able to notice a difference between them when sending the agent to a point.

The AI Path script also appears to be causing the agent to move in circles very rapidly while approaching a point. Maybe this is an issue of scale? Or maybe I am viewing the wrong grid as what nodes really are, and I need smaller nodes or bigger characters?

I’ll attempt to change the Max Nearest Node Distance and rescan the grid, and investigate what’s happening with just the Seeker attached.

EDIT: In regard to the rapid circular movement, I’m assuming I should ask for paths using the AIPath script reference rather than the seeker if I have one attached? And I don’t see a difference after changing the Max Nearest Node Distance to 1 from 100

Hi

Ok. If the green path looks correct then the issue lies with the AIPath component. The ‘Max Nearest Node Distance’ will not have any effect on this issue.

It’s odd that it only sometimes stop. I’m not quite sure what could be the cause of that.
Could you show me a screenshot of your AIPath + Seeker settings?

That sounds like the ‘pick next waypoint distance’ setting is too low or the ‘slowdown distance’ is too low. If ‘pick next waypoint distance’ it is too low then the AI will constantly try to navigate to a point on the path veery close to where it is which can result in some jitter if it overshoots.
Here is a video that explains a bit about how it works: https://youtu.be/OpgUcYzRpwM?t=9m40s

Even with default settings the agent has more than what I would call jitter; it appears to be throwing itself past the point it chooses, then repeats after overshooting causing a tornado-like effect. These are the settings:

With that said, the default settings do actually end up getting it to the end point. Without the AIPath component, the seeker would stop short of the end point. What changes should I make so the AIPath component stops this behavior?

What do you mean? The Seeker component doesn’t do any movement of its own, it only concerns itself with calculating paths. If you remove the AIPath component the object should not move at all. Do you have another component that is also moving the character?

Yup, I had a misunderstanding of how the components worked, so another script was managing the movement. The AIPath component seems to do what I was looking for. My apologies, and thanks for the help.