QuakeNavSharp 1.0.0
See the version list below for details.
dotnet add package QuakeNavSharp --version 1.0.0
NuGet\Install-Package QuakeNavSharp -Version 1.0.0
<PackageReference Include="QuakeNavSharp" Version="1.0.0" />
paket add QuakeNavSharp --version 1.0.0
#r "nuget: QuakeNavSharp, 1.0.0"
// Install QuakeNavSharp as a Cake Addin #addin nuget:?package=QuakeNavSharp&version=1.0.0 // Install QuakeNavSharp as a Cake Tool #tool nuget:?package=QuakeNavSharp&version=1.0.0
QuakeNavSharp
A .NET Core library to manipulate Quake 2021 (Enhanced) bot navigation.
Features
- .nav file support: Manipulate .nav files directly if you wish with a 1:1 representation of the binary structures. Supports reading and writing.
- OOP navigation graph representation: Edit, view and create the navigation graph with references instead of ids and logical hierarchy.
- NavJson support: Convert navigation graphs from and to NavJson format. A git friendly format that represents a navigation graph.
Quick start
// Loading a nav file
NavFile navFile;
using(var fs = new FileStream("mymap.nav",FileMode.Open))
navFile = await NavFile.FromStreamAsync(fs);
// Convert it to a navigation graph
var graph = NavigationGraph.FromNavFile(navFile);
// Adding a new node
var node1 = graph.NewNode();
node1.Origin = new Vector3(100,100,100);
// Adding a link to another node
var node2 = graph.NewNode();
var linkToNode1 = node2.NewLink();
linkToNode1.Target = node1;
// Save a .nav file with the modified nodes
using(var fs = new FileStream("mymap.nav",FileMode.Create))
graph.ToNavFile().SaveAsync(fs);
// Convert the graph to NavJson json
var json = NavJson.FromNavigationGraph(graph).ToJson();
NavJson
NavJson is a JSON representation of the navigation graph. It was created with Git in mind to allow incremental changes to bot navigation in plain text and easily diff'ed.
It is closer to the OOP navigation graph than the binary structures in terms of look.
The main difference is that Links are connected via Node coordinates instead of Node Ids. This allows nodes to be deleted without having to apply a change to every other node / link with an id above it.
It also includes some information about the map, contributors and possible urls where to download a map from.
Here's a snippet:
{
"Version": 0,
"Map": {
"Name": "The Slipgate Complex",
"Author": "John Romero",
"Filename": "e1m1",
"Urls": []
},
"Contributors": [
"JPiolho"
],
"Comments": "Deathmatch",
"Nodes": [
{
"Origin": [684.62695,104.976776,48.53125],
"Flags": 0,
"Links": [
{
"Target": [607.29736,129.47595,16.531242],
"Type": 0
},
{
"Target": [688.049,-3.7063046,48.53125
],
"Type": 0,
"Edict": {
"Mins": [719,31,47],
"Maxs": [785,49,113],
"Targetname": 0,
"Classname": -75
}
},
{
"Target": [681.66376,180.51585,48.53125],
"Type": 0
}
],
"Radius": 20
},
...
(Unfortunately it doesn't look that pretty due to limitations from System.Text.Json serializer, but feel free to roll your own if you wish!)
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. 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. |
-
net5.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.