3D Navigation Plugin

Some refactoring and tidying up gone in.

Created the wiki on github today

Thank you for you continued efforts with this plugin!

Fiddled with an earlier version of this for, of all things, propagating grenade explosions :slight_smile:
May get back to that at some point because I do dislike the current way I rigged them up.

Cool, glad people are using it :slight_smile:

The voxel representation of the world could be used for all sorts, keep meaning to add a ray trace function and see how it stacks up to a physics trace. Should work well for stuff like sensory occlusion/propagation.

Next job though is to clean up the paths, it just uses node centers at present, I’ll add a square portals option first, and look into a funnel algorithm to optimise it up further.

I got constant crash. This is log:

UESVON: Display: Finding path immediate from X=1780.000 Y=-1680.000 Z=110.275 and X=332.633 Y=228.289 Z=71.000
UESVON: Display: Path finder failed to find start nav link
LogWindows: Error: [Callstack] 0x00000000ED01E310 UE4Editor-UESVON.dll!ASVONAIController::MoveTo() 

Using 4.19

Do you have an SVONVolume in the scene?

Reminds me I need to put some more helpful error catching in for setup problems…I’ll do it tomorrow.

Yes, I have SVONVolume. Without volume it wont crash, but of course AI could not move. Here what I did:

  • I downloaded plugin from git and put it in {PROJECT}//Plugins/uesvon/
  • I enabled plugin and restarted editor
  • Created AIController based on SVONAIController
  • On AI Character I selected that AIController (SVONAI)
  • Added SVON Volume in the scene and clicked Generate button.
  • When I use Move To node it crash.
    Here is new log:

UESVON: Display: Generation Time : 24
UESVON: Display: Total Layers-Nodes : 4-169
UESVON: Display: Total Leaf Nodes : 129
UESVON: Display: Total Size (bytes): 7792
UESVON: Display: Finding path immediate from X=1780.000 Y=-1680.000 Z=110.275 and X=0.000 Y=0.000 Z=0.000
UESVON: Display: Path finder failed to find start nav link
ogWindows: Error: === Critical error: ===
//
LogWindows: Error: [Callstack] 0x00000000ECF3E310 UE4Editor-UESVON.dll!ASVONAIController::MoveTo()
//
LogWindows: Error: [Callstack] 0x00000000078EC43E UE4Editor-AIModule.dll!UnknownFunction ]

Sorry I’ve been sick today and haven’t ben able to fix anything!

I don’t have 4.19 installed at the moment, will set it downloading and test tomorrow.

Try just getting latest from master, and just use a normal AI controller, add a SVONNavigation component to it, then use the SVONMoveTo node, instead of the regular one.

Been reminded today, that you do need AI Tasks enabled in your project settings at the moment. I’ll remove this requirement shortly, but I’ve been super ill the last few days :confused:

hello,

really love the plugin! i was able to get it to work with the CashDemo, and it seems to work consistently with that project.

I migrated every single setting over, including the behavior tree and decorator/service for set position exactly to my project.

the issue i’m having is, that for some maps, when i load the SVONVolume into the level and click generate, when i first try it, it seems to work, but if i clear out the generated volume data or try to make a new volume sometimes the data maybe isn’t being stored properly? I also noticed some strange artifacting sometimes in my test level i used for the SVONVolume.

Imgur: The magic of the Internet (my built version of SVONVolume - where upon running the behavior tree shows as being run with yellow). I made sure to check the project settings bt tasks checkbox.

https://www.youtube.com/watch?v=UxaTt8aX1oU video of expected behavior using don3d, the ships consistently move towards target here.

can you please double check the tree data for the SVONVolume is being stored properly and use various test cases with new maps for this when ever you have time?

I will try to download future iterations of your UESVON-master branch and compile it into my game and report anything else i find or if it persistently is able to detect the pathing.

thank you for the great work!

One other recommendation i can make for you is that if you consider posting this on the unreal marketplace when you’re ready, i’m sure people will buy it.

Koshi

i ran into an issue with packaging a game using uesvon and i had to do this:


void UAITask_SVONMoveTo::PerformMove()
{
// Prepare the move first (check for early out)
CheckPathPreConditions();

ResetObservers();
ResetTimers();
ResetPaths();




if (myResult.Code == ESVONPathfindingRequestResult::AlreadyAtGoal)
{
MoveRequestID = myResult.MoveId;
OnRequestFinished(myResult.MoveId, FPathFollowingResult(EPathFollowingResult::Success, FPathFollowingResultFlags::AlreadyAtGoal));
return;
}

// If we're ready to path, then request the path
if (myResult.Code == ESVONPathfindingRequestResult::ReadyToPath)
{

myUseAsyncPathfinding ? RequestPathAsync() : RequestPathSynchronous();

switch (myResult.Code)
{
case ESVONPathfindingRequestResult::Failed:
FinishMoveTask(EPathFollowingResult::Invalid);
break;
case ESVONPathfindingRequestResult::Success: // Synchronous pathfinding
MoveRequestID = myResult.MoveId;
//if (IsFinished())
// UE_VLOG(GetGameplayTasksComponent(), LogGameplayTasks, Error, TEXT("%s> re-Activating Finished task!"), *GetName());
RequestMove(); // Start the move
break;
case ESVONPathfindingRequestResult::Deferred: // Async...we're waiting on the task to return
MoveRequestID = myResult.MoveId;
myAsyncTaskComplete = false;
break;
default:
checkNoEntry();
break;
}

}
}

for some reason


if (IsFinished())

was giving me an error saying it was an empty control statement.

here’s the error i got:


ParallelExecutor.ExecuteActions:   [1/2] Module.UESVON.cpp
ParallelExecutor.ExecuteActions:   C:\unreal\game
eptunegl 4.21.2 SSD\Plugins\uesvon-master\Source\UESVON\Private\AITask_SVONMoveTo.cpp(193): error C4390: ';': empty controlled statement found; is this the intent?
Log.WriteException: ==============================================================================
Log.WriteException: ERROR: UBT ERROR: Failed to produce item: C:\unreal\game
eptunegl 4.21.2 SSD\Binaries\Win64\NeptuneGL-Win64-Shipping.exe
Log.WriteException:        (see C:\unreal\src\UnrealEngine-4.21.2-release\Engine\Programs\AutomationTool\Saved\Logs\UBT-NeptuneGL-Win64-Shipping.txt for full exception trace)

once i commented out the lines like above it worked and i was able to package the game.

hello mid_gen, i have some questions about this plugin, first, i run success in my project, but I use my code[EncompassesPoint_CompareOnly] instead of [aVolume.EncompassesPoint(aPosition)], because I think it just only need to compare distance and point with the volume box; so I just changed this code, and it works okey,
but if the target point is moving around the block things, the ai which use svon_moveto will be ‘blocked’, the log says:“Path finder failed to find start nav link. Is your pawn blocking the channel you’ve selected to generate the nav data with?” in function [FindPathAsync]. so maybe this is a bug I think, maybe it should check the path or the points inside the path is in leaf node or block node, wish you give me some suggests, thinks for your code. :slight_smile: [a programmer from china. poor english. sorry]

I means, if the target position AI move to, the line path = targetposition - AIposition, and if the path througth the red box(leaf or block node), the ai will be blocked forever.

I have add some codes to avoid to been blocked by the nav, because the all points in the path you calculate is valid and I have checked them. but the UPathMovement not always use them directy, like add some accpet radius calculations in its function. and maybe the final point is invalid.
my code in FindPathAync:

if (AIPawn)
{
if (UPawnMovementComponent* movecomp = AIPawn->GetMovementComponent())
{
FVector foundpoint = LastPathPointsCacheCopy.Last();
const FVector AILocation = AIPawn->GetActorLocation();
const FVector ReverseDir = (LastPathPointsCacheCopy.Last() - AILocation).GetSafeNormal();
FHitResult hits;
for (uint8 i = 1; i <= 3; ++i)
{
const FVector testpos = AILocation + ReverseDir * 10.f * i;
if (SVONMediator::GetLinkFromPosition(testpos, *myCurrentNavVolume, TestLink))
{
const FVector delta = (testpos - AIPawn->GetActorLocation());
movecomp->SafeMoveUpdatedComponent(delta, AIPawn->GetActorRotation(), false, hits, ETeleportType::None);
return false;
}
}

    const FVector delta = (LastPathPointsCacheCopy.Last() - AIPawn-&gt;GetActorLocation());
    movecomp-&gt;SafeMoveUpdatedComponent(delta, AIPawn-&gt;GetActorRotation(), false, hits, ETeleportType::None);
}

}

LastPathPointsCacheCopy is the last path points array, and is not-thread safe, so copy them in the head of the code.

Sorry, had notifications off for the forums, haven’t checked in a while.

If you have code changes then please just submit a PR on github and I’ll take a look on there, much easier to manage!

Heya!
Kinda running into some issues, and I know it’s my own fault, so would love to know if there’s a workaround.
I’m working in 4.23 - and have brought the plugin in successfully with one exception… I can’t find the SVON AI Controller class anywhere.
I went digging through your git and saw it vanished around v4.21.
Is there any way to get that back in there?

UPDATE: Ripped the extras out of the Cashgen demo and trying to steal the SVONAIController class from there…

Depends how you want to implement it really, I felt like the BTTask/GameplayTask option was cleaner than an overriden AIController (which can be a pain in the butt to extend).

I’ve been working on UE full-time for a few months now since I wrote the plugin, so learnt a lot of stuff I’ll put into cleaning it up soon.

The CashDemo project has been updated to 4.24 now.

Looking forward to advances on 3D navigation! :wink:

hi,
ive been using don navigation for a few years and while its awesome at some things, im really having trouble making airplanes which only move forward and turn naturally towards their next target, rather than going sideways or snapping. i’ve also tried it for ships (constrained on Z-axis)… Does this plugin handle AI airplane flight mechanics more naturally? and does your demo include that?
thx much!
-khaz

Don’t work for UE4.25. It’s a pity!

What error are you getting?