I discovered so many fixes for the following:
AI Move To node returning “Aborted”, Ai falling off Nav Mesh, target Actor VS target Vertex, GetRandomPointInRadius, StopMovement,
Nav Proxy not firing, misbehaving, transforming/rotating/scaling, data monitoring
I need to post this to add to the community understanding and documentation of Nav Proxy. I don’t know exactly how everything works underneath it all but I know how to reign it in to make it do whatever you want.
What I do from the start:
-Drop a new Nav Link in
-Drag the two Smart Link polygons where you want them.
-Press “Copy End Points…” button at the top of the Details > Smart Link area.
-Move the Smart Link a little bit in the viewport to make the 4 floating cylinders match up perfectly.
-Turn on ‘Details > Smart Link Is Relevant’.
-Edit > Project Settings > Navigation System> Agents > Supported Agents > make a name copy and paste it at "Default Agent Name at top of screen.
-Edit > Project Settings > Navigation System> Default Agent Name
-Select your Smart Link > Details > Supported Agents > click the name you made in project settings.
-Smart Link > Details > Blueprint button at the top right corner of the Details box.
-Right Click inside of the blueprint and search for “EventRecieveSmartLinkReached”.
-Now the Smart Link should work and trigger here when the ai tries to use it over a gap in the NavMesh.
Use this blueprint now to program your Smart Link and make sure all Smart Links are using this blueprint for their logic. Now you can just drag and drop the blueprint from your Content folder without needing to reprogram every new proxy you place in your level.
Tips for fixing problems:
-Details > Simple Link > Point Links >
try changing these settings, everything other than my instructions should be default.
Left Project Height 1000,
Snap Height ON @ 50,
snap radius =30 or else the link fails to fire when characters slide past them. Not sure why.
To check if the Proxy Connects two pieces of green NavMesh, press the P key in editor OR press the ’ key in game to reveal debug, press 0 to reveal valid Nav Proxies. Only trust the arrows you see in game. The editor’s arrows are not valid all of the time.
With no Nav Proxy, The AI will run to the nearest location against the wall of the NavMesh area they are in. If your Nav Proxy fails to work correctly, the AI May run towards the player when out of bounds of the NavMesh.
Most Player physics tend to destroy Nav Proxy functionality. If you slide thru a nav proxy going faster than 150, you will most likely slide off the ledge before your logic can completely fire.
You need variables to fix this.
Make sure your Nav Proxy Smart Links are close to the border of the green NavMesh. Press ’ and 0 in game to reveal the straight green lines in between the disconnected Nav Mesh islands. Place the Smart Links closer to the end points of the straight green lines connecting the Nav Mesh pieces. When the AI gets bugged out it will walk to these green lines and just ignore the Proxy.
This happens because maybe the AI slide off the NavMesh and can’t access NavMesh data anymore. Being a blind idiot, the AI will run towards that 1 connecting point in hopes of getting back into the Nav Mesh area. this is my understanding of one of the unexplained Ai Move to Aborted message too.
Inside the Nav Proxy blueprint > the data Agent and Destination in the “EventRecieveSmartLinkReached” event is very reliable. But sometimes the AI will fire a nav proxy every tick opposed to just once. Make sure to program for this in mind or else you will get a large error % when using multiple nav proxies in close proximity. Small floating platforms etc. I will upload a video soon of good execution in game.
There still remains many impossible to explain circumstances which effect the AI Move To node. Seek remedy to a wide variety of impossible to fix problems with this node by trying:
Create variable that monitor distance between player and proxy, scale your jumping or traversing physics and logic to scale off of this value with Normalize and Clamp in blueprints. Now my Nav Proxies at various distances and scales will perform the actions of the character more calculated in a perfect arc or swift movement.
The key here is to prevent the AI character to slide off of the Nav Mesh
More fixes for things:
Edit > Project Settings > Navigation Mesh
(CPU/GPU intense!)
Tile Size UU > 1500-3000
Cell Size > 10.
This seems to Decrease the frequency of the AI “re-thinking” where it needs to navigate. Sometimes the Nav Data will update and ruin the AI logic, even if you in the same valid NavMesh area.
Runtime Generation > Static, until you fix your bugs. Dynamic NavMesh “re-thinks” a lot more in my experience and is not worth using. If you are using extremely large NavMesh you can scale your resource consumption down in other ways. Look that up if you need that its well documented.
Don’t scale or rotate anything Navigation related. It will load wrong and calculate wrong all the time. Something in your massive web of random code will trip incorrectly 1% of the time and you won’t know how to find it. Avoid this problem with simple design around your implementation of Ai code.
If AI Move To fails when using your preferred way of using it, try making a loop of multiple AI Move To nodes. Try every type of Navigation possible each time the AI ticks. A lot of ways to do this:
Destination Actor
Destination Vector
GetAllActorsOfClass > ForEachLoop > Array Element > GetRandomPointInNavigableRadius
Make conditionals depending on if the AI Move To failed or not.
AI Move > Movement Result > Branch > String == “Aborted” > your logic here…
During the transition of NavMesh navigation to NavLink navigation, there is a high probability of error for unexplained circumstances. To avoid this narrow window of hell… Set up a master “pause” button at the beginning of your AI logic which toggles at the beginning of the NavProxy.
I programmed a 0.5 second pause to my AI Movement at the beginning and end of the Nav Proxy. Make variables to monitor the status of the NavProxy and change the AI logic accordingly.
My AI logic when Nav Link fires: Get Player Pawn > Get Movement Component > Stop Active Movement > Add Movement Input. Just push the AI controller in the direction of the proxy and make them jump on a timer. that timer should scale off of the distance of the proxy.
Calculate the Z axis difference between the the AI and the NavProxy and the distance to the other side of the NavProxy (yes, the variables in SmartLinkReached work correctly). Use these differences to tell your AI to only jump when a Nav Proxy is above a certain angle and far away from them. This way you can fall from a tall Nav Proxies and jump up ones close to you.
Now you have a fine tuned & reliable Proxy system and can drag and drop it anywhere in your game. Bug fix your own AI blueprints with these new tools.