Code Monkey home page Code Monkey logo

uesvon's Introduction

uesvon

3D navigation plugin for UnrealEngine

Engine Version : Master tested with 5.3. Should be backwards compatible with to at least 4.20, see branches for previous snapshots, but note features are not backported.

Please view the Wiki for more information

UESVON Demo

uesvon's People

Contributors

luosiyong avatar midgen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

uesvon's Issues

Make a simple scenario

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.

IMG_6788

Engine Version?

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.?

Crash when doing "Simulate"

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();
	}

Is it sparse voxel octree?

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.

Error when pawn is spawned in the world

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).

Add node faces secondary pathing option

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,

No navigation volume known for navigation component

A test case I am trying is to build a single path between two point.

  • SVON volume has been added to level, and mesh has been generated.
  • A character gets SVONNavigation component. Call to 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?

Feature Requests

  • Blueprint function to get a random navigable point within input sphere and/or box (for patrol behaviours)
  • Blueprint function to check if a given point is within navigable bounds

Apologies if this is a pain.

PS thanks for adding the last Blueprint feature I requested! Huge help :)

Linux / VS Code Version Support Possible?

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.

[c++]ue4 crash when calling SVONMediator::GetLinkFromPosition

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; }

};`

Make meaningful log

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.

Is it possible to save the 3D mesh?

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?

nav data has not been generated

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

svon_error1

Does anyone know how to generate nav data?

Feature request

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?

Wrong identification of pawn

Navigation volume is built correctly. However, pawn is wrongly cognised so the immediate path cannot be found.

IMG_6935

There should be robust way to find the pawn. More importantly, for Find Path Immediately the pawn is not necessary - it is ultimately to find a path between just two points.

License

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.