armory icon indicating copy to clipboard operation
armory copied to clipboard

[logic nodes] [navigation system/pathfinding] Improvements to the "Go to Location" node to allow the user a more low-level control over how an object is moved when using pathfinding

Open ItsCubeTime opened this issue 3 years ago • 2 comments

You can skip reading all the italic text if you like

image

The idea is that if "Translate object" is unticked, the node will no longer attempt moving the object on its own, but will rather rely on that the user have created a system of his own for moving the object based on the outputs that Ive painted onto the node in the above screenshot.

Once the Go to location node is called, the forward execution pin will be called once every frame when the object would normally be translated by the "Go to location" node. The idea is that the user have then setup some nodes that gets called from here, that takes care of the object translation.

Turn right/turn left execution pin is called if the object is not quite facing the direction that the object should be moving towards, once again, the idea is that the user can use his/her own setup to rotate the object. These would also be called every frame, but only if the rotation should be adjusted.

To give an example usecase for the features suggested in the last 2 paragraphs. If someone has say already setup a controller for a character using standard WASD controls and want the pawn to be controllable by an AI controller as well. One could simply just replace the WSD event inputs with the Forward/turn right/turn left outputs of the go to location node.

Is turning (bool), is true if either of the "turn right"/"turn left" outputs are being executed.

Next partial destination is the next destination in world space that the object need to reach in order to get around any corners on the navmesh.

Last reached partial location is the last location that was reached by the object. I hope this is slightly self explainatory :)

Partial destionations is simply all the destinations that needs to be reached to navigate to the location fed in from the "Location" input.

The idea of the "partial destionation", "next partial destination" and "last reached partial destination" is that if the user wanted, he could literally just lerp between these 2 locations him/herself on tick, and totally ignore the "forward", "turn right" & "turn left" nodes. But still get a finer control over how the pawn moves to the destination.

Rotation offset error margin lets you set how far off the objects forward vector (rotation) has to be from facing directly towards the next partial destination in order for the "turn left", "turn right" nodes to start triggering. This is especially crucial for if you have a character that you dont want to move forward whilst turning & if its also physics based.

Location reach error margin lets you define how close from any partial (or final) destinations the character has to get in order for the destination to be considered as being "reached". This is crucial if one is working with a physics based movement system where cm level precision might be impossible to achieve.

ItsCubeTime avatar Jun 09 '21 16:06 ItsCubeTime

Sorry about the messy order of everything on the node. It was just a quick mockup so I didnt pay any attention to that in particular 😅

ItsCubeTime avatar Jun 09 '21 16:06 ItsCubeTime

There should probably also be an input execution pin that lets you halt the pathfinder

ItsCubeTime avatar Jun 16 '21 15:06 ItsCubeTime