Pikol93.NavigationMesh 1.1.0

dotnet add package Pikol93.NavigationMesh --version 1.1.0
NuGet\Install-Package Pikol93.NavigationMesh -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Pikol93.NavigationMesh" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Pikol93.NavigationMesh --version 1.1.0
#r "nuget: Pikol93.NavigationMesh, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Pikol93.NavigationMesh as a Cake Addin
#addin nuget:?package=Pikol93.NavigationMesh&version=1.1.0

// Install Pikol93.NavigationMesh as a Cake Tool
#tool nuget:?package=Pikol93.NavigationMesh&version=1.1.0

A C# navigation library allowing for fast navigation in 2D space.

Benchmarked Data Screenshot Example Mesh

Features

  • Navigation based on run-time generated mesh.
  • Adjustment to agent size.
  • Works for convex and concave shapes.

Installation

This library is available as a NuGet package here.

Usage

The usage is located in the NavigationMeshShowcase repo's README file along with an example project created in the Godot Engine.

Performance

Notes regarding the benchmark:

  • The benchmark was executed with a dataset that is available in JSON format here. The graphical representation of the generated mesh and path can be found here.
  • There has been no conversion between any external type and System.Numerics.Vector2. This should be taken into consideration when applicating to a real project.
BenchmarkDotNet=v0.12.1, OS=Windows 10.0.19041.804 (2004/?/20H1)
Intel Core i5-7400 CPU 3.00GHz (Kaby Lake), 1 CPU, 4 logical and 4 physical cores
.NET Core SDK=3.1.402
  [Host]     : .NET Core 3.1.8 (CoreCLR 4.700.20.41105, CoreFX 4.700.20.41903), X64 RyuJIT
  DefaultJob : .NET Core 3.1.8 (CoreCLR 4.700.20.41105, CoreFX 4.700.20.41903), X64 RyuJIT


|     Method |         Mean |      Error |     StdDev |    Gen 0 | Gen 1 | Gen 2 | Allocated |
|----------- |-------------:|-----------:|-----------:|---------:|------:|------:|----------:|
| CreatePath |     9.774 us |  0.0293 us |  0.0260 us |   3.7537 |     - |     - |  11.51 KB |
| CreateMesh | 2,388.187 us | 14.5723 us | 13.6309 us | 238.2813 |     - |     - | 729.93 KB |

Known issues

  • The library uses System.Numerics.Vector2 type internally. This means that if the user already utilizes another type for storing two-dimensional point data, a conversion between said type and System.Numerics.Vector2 type has to take place. This is generally solved by creating a helper class as described in the example project.
  • Due to a bug related to inflating the polygons, the agent size is required to be equal or greater than 1.
  • Because of the way the ClipperLib library works, closely packed points can lead to precission errors and invalid polygon data which in effect corrupts the whole mesh. This can handled by managing the data to not contain multiple points that are of distance less than 1 unit. Generally this issue is not critical as the navigation under some cases proved to be working, but it's not recommended to keep a lot of points of an obstacle polygon closely together.
  • The created mesh is only accurate to a certain degree. Multiple cases have been found where a path created manually by a human was more optimal than the one created by the algorithm. It is suspected that polygons that have edges of similiar lengths to be more precise.

License

This work is licensed under the MIT license. See the LICENSE file for more information.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 is compatible.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.0 383 4/22/2021
1.0.4 299 3/10/2021
1.0.3 318 3/9/2021
1.0.2 339 3/6/2021
1.0.1 304 3/5/2021
1.0.0 284 3/5/2021