midgen / uesvon Goto Github PK
View Code? Open in Web Editor NEW3D navmesh generation and pathfinding plugin for UnrealEngine
License: MIT License
3D navmesh generation and pathfinding plugin for UnrealEngine
License: MIT License
If a pawn is placed in the world, the immediate path can be found (provided a second long delay first applies) but then SVON Move To Location or Actor
does nothing with error
Path finder failed to find start nav link. Is your pawn blocking the channel you've selected to generate the nav data with?
(= it is blocking itself). However, if a pawn is spawned in the world such that the navigation mesh is first generated without effects due to any pawn, the error is
Pawn is not inside an SVON volume, or nav data has not been generated
and even the immediate path cannot be found. A scenario based on pawn spawned in the world would be helpful. This of course applies after more basic scenarios and examples are build up. Note that the only existing test/example project CashDemo
includes unnecessary plugins/details and is of very specific use case (for example, it's useless for my task).
Suggestion: make a simple scenario and publish it step-by-step: for example, make SVON volume - locate pawn - set destination - find navigation path and show it.
Because of the lack of simple scenario (or test case), debugging C++ code is necessary - no path can be build between any of two locations. The path generation is called from BP FindPathImmediate
node and error says that "pawn is not inside SVON volume or nav data has not been generated". This error message is not true because, in Editor, it is seen exactly opposite - pawn is inside generated mesh.
Could you please clarify what is the license for this code?
As far as I understand, code without any license is "all rights reserved" and cannot be used for anything other than fun.
Thanks!
Right now "Pawn is not inside an SVON volume, or nav data has not been generated" sounds too general. HasNavData
can provide exact reason for error, so already known information needs to be exposed.
Hey @midgen - What engine version is this meant to be used with?
And would it be possible to put that engine version in the Read Me.?
Path finder failed to find start nav link. Is your pawn blocking the channel you've selected to generate the nav data with?
How to resolve,plz
e.g. missing nav volumes, no data available etc.
Either as an octomap (considering it's already an octree) or some sort of a 3D mesh format. Does the current internal representation match a standard one?
Like title says
Apologies for posting as issue.
Would it be possible to expose some method/s to blueprints that allow us non-genius designers to get the path point transform array?
Apologies if this is a pain.
PS thanks for adding the last Blueprint feature I requested! Huge help :)
Issue in the pathfinder.
Currently only navigates down a maximum of two levels when pathing from high to low layers. Can result in path running through a blocked area.
Fix is to ensure pathfinding properly navigates down unlimited levels, although this can explode the open set, so needs to be implemented and tested along with the pathfinding optimisations.
This seems like a pretty great plugin!
Would UE4 4.24.2 Support be Possible?
Having errors building the c++ project when I put this inside my projects plugin folder.
1.) ThreadSafeBool.h not found within AITask_SVONMoveTo.h
2.) _MSC_VER is not defined within morton_common.h
3,) SVONLeafNode.h invalid operands to binary expressions
4.) ModuleManager.h not found inside UESVON.h
Also a lot of notes about candidate templates being ignored. Could not match and substitution failures.
Thanks for sharing such an amazing plugin, I have used it well by Behaviour Tree. While when I try to use by C++, the following error came out. Please advise how to solve it. Thanks a lot.
UE4.24.3 + VS2019
Build success in VS.
But when clicking PLAY in the UE 4 Editor, the UE4 crashed with the following error.
_Unhandled Exception: EXCEPTION_ACCESS_VIOLATION reading address 0x000002f8
UE4Editor_FindPath_1636!ADebugPath::BeginPlay() [C:\Users\User\Documents\Unreal Projects\FindPath\Source\FindPath\Private\DebugPath.cpp:58]_
`#include "DebugPath.h"
#include "Engine/World.h"
#include "Engine/Engine.h"
#include <Runtime/Engine/Classes/Kismet/GameplayStatics.h>
#include <Runtime/Engine/Classes/Components/ActorComponent.h>
#include "UESVON/Public/SVONNavigationPath.h"
#include "UESVON/Public/SVONFindPathTask.h"
#include "UESVON/Public/SVONLink.h"
#include "UESVON/Public/SVONNavigationPath.h"
#include "UESVON/Public/SVONPathFinder.h"
#include "UESVON/Public/SVONVolume.h"
#include "UESVON/Public/SVONMediator.h"
// Sets default values
ADebugPath::ADebugPath()
{
// Set this pawn to call Tick() every frame. You can turn this off to improve performance if you don't need it.
PrimaryActorTick.bCanEverTick = true;
if (FindVolume())
{
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, TEXT("my_SVONVolume sucess"));
}
}
// Called when the game starts or when spawned
void ADebugPath::BeginPlay()
{
Super::BeginPlay();
const ASVONVolume* my_SVONVolume = GetCurrentVolume();
SVONPathFinderSettings settings;
settings.myUseUnitCost = true;
settings.myUnitCost = 10;
settings.myEstimateWeight = 1;
settings.myNodeSizeCompensation = 1;
settings.myPathCostType = ESVONPathCostType::EUCLIDEAN;
settings.mySmoothingIterations = 0.0;
FSVONNavPathSharedPtr path;
UWorld* my_world = GetWorld();
SVONPathFinder svonPathFinder(my_world, *my_SVONVolume, settings);
const FVector start_position(-8310.0, 1020.0, 140.0);
const FVector target_position(-8580.0, 5020.0, 2518.0);
SVONLink start_link;
SVONLink target_link;
SVONMediator::GetLinkFromPosition(start_position, *my_SVONVolume, start_link);
/*
SVONMediator::GetLinkFromPosition(target_position, *my_SVONVolume, target_link);
svonPathFinder.FindPath(start_link, target_link, start_position, target_position, &path);
TArray<FSVONPathPoint> points = path->GetPathPoints();
for (FSVONPathPoint point : points)
{
GEngine->AddOnScreenDebugMessage(-1, 5.0f, FColor::Yellow, point.myPosition.ToString());
}
*/
}
// Called every frame
void ADebugPath::Tick(float DeltaTime)
{
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void ADebugPath::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
}
bool ADebugPath::FindVolume()
{
TArray<AActor*> navVolumes;
UGameplayStatics::GetAllActorsOfClass(GetWorld(), ASVONVolume::StaticClass(), navVolumes);
for (AActor* actor : navVolumes)
{
ASVONVolume* volume = Cast<ASVONVolume>(actor);
if (volume)
{
aSVONVolumn = volume;
return true;
}
}
return false;
}
`
`// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Pawn.h"
#include "DebugPath.generated.h"
class ASVONVolume;
UCLASS()
class FINDPATH_API ADebugPath : public APawn
{
GENERATED_BODY()
public:
// Sets default values for this pawn's properties
ADebugPath();
protected:
// Called when the game starts or when spawned
virtual void BeginPlay() override;
public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
bool FindVolume();
const ASVONVolume* aSVONVolumn;
const ASVONVolume* GetCurrentVolume() const { return aSVONVolumn; }
};`
A test case I am trying is to build a single path between two point.
FindPathImmediate
outputs nothing.UESVON: Error: Pawn is not inside an SVON volume, or nav data has not been generated
It is likely myCurrentNavVolume
is nullptr.
How to get SVONNavigation component to know about SVON volume in the level?
I use "Find path immediete" BP, but following error occures.
"UESVON: Error: Pawn is not inside an SVON volume, or nav data has not been generated"
I followed the steps below, and confirmed pawn is inside an SVON volume
●Install the plugin (to Plugins/ folder)
●Add an SVONVolume to my level
●Add a SVONNavigationComponent to my AI Controller
There is a video on YouTube showing the sparse voxel octree navigation mesh. However, this plugin can only generate regular grid. Why?
This issue should be clearly stated in ReadMe and in Wiki.
Currently using node centers as path points, which results in a non-optimal path particularly when navigating larger nodes.
Add option to calculate square portals, and use node face centers as path points instead.
This will also give us the data to enable implementation of a funnel algorithm to further optimize the path,
This piece of code crashes if you do "Simulate", since the player controller doesn't have a pawn. That if (pc)
line needs to be if (pc && pc->GetPawn())
bool ASVONVolume::Generate()
{
#if WITH_EDITOR
// Needed for debug rendering
GetWorld()->PersistentLineBatcher->SetComponentTickEnabled(false);
// If we're running the game, use the first player controller position for debugging
APlayerController* pc = GetWorld()->GetFirstPlayerController();
if (pc)
{
myDebugPosition = pc->GetPawn()->GetActorLocation();
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.