Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NavMesh tools/libraries enhancements #34

Merged
merged 48 commits into from
May 28, 2024

Conversation

dbierek
Copy link
Contributor

@dbierek dbierek commented Apr 20, 2024

Adds Anthony Fuller's NavTool updates from #11:

This PR contains multiple improvements and changes to NavWeakness, NavTool, and NavViewer these are outlined below:

NavWeakness

  • Switched to my NavPower header library
  • Added functions to output the navmesh as human readable or for the viewer
  • Changed the Surfaces object to Areas and changed the Unk02 object to KDTree

NavTool

  • Added an option to output as a human readable format (--human)
  • Changed the Surfaces object to Areas and changed the Unk02 object to KDTree

NavViewer

  • Renamed Surfaces.js to NavMeshes.js
  • Changed names of check boxes to match what they actually are
  • Added rendering of k-d tree bounding boxes
  • Now renders faces and edges by default instead of the "unknown points"
  • Changed the Surfaces object to Areas and changed the Unk02 object to KDTree

.gitignore

  • Removed unused Faces.js
  • Changed Surfaces.js to NavMeshes.js
  • Added .vscode and _build

Also adds new updates:
Reads from NAVP or JSON depending on the filename in the first argument. If the filename contains JSON it will open and parse the JSON file. I recommend naming the file [HASHCODE].NAVP.JSON, but it can be anything as long as it ends in .JSON.

Writing to NAVP:
Use the --navp flag and enter the output filename.
Example:
NavTool.exe 00F7EAFFD546CE00.NAVP.JSON --navp 00F7EAFFD546CE00.NAVP

Writing to JSON:
Use the --json flag and enter the output filename.
Example:
NavTool.exe 009F622BC6A91CC4.NAVP --json 009F622BC6A91CC4.NAVP.JSON

NavpJsonVersion 0.1
Example:

{
  "Areas": [
    {
      "Area": { "Index": 1 },
      "Edges": [
        {
          "Position": { "X": -22.8499, "Y": -12.9597, "Z": -1.3357 },
          "Flags": 662
        },
        {
          "Position": { "X": -21.75, "Y": -15.85, "Z": -1.3504 },
          "Flags": 451
        },
        {
          "Adjacent Area": 2,
          "Position": { "X": -20.75, "Y": -12.9497, "Z": -1.3505 },
          "Flags": 1772
        }
      ]
    },
    {
      "Area": { "Index": 2, "Type": "Steps" },
      "Edges": [
        {
          "Adjacent Area": 3,
          "Position": { "X": -20.75, "Y": -8.4714, "Z": 1.6817 },
          "Flags": 1776
        },
        { "Position": { "X": -22.5496, "Y": -8.48, "Z": 1.6943 } },
        { "Position": { "X": -22.85, "Y": -8.55, "Z": 1.65 } },
        {
          "Adjacent Area": 1,
          "Position": { "X": -22.8499, "Y": -12.9597, "Z": -1.3357 },
          "Flags": 1772
        },
        { "Position": { "X": -20.75, "Y": -12.9497, "Z": -1.3505 } }
      ]
    },
    {
      "Area": { "Index": 3, "Type": "Steps" },
      "Edges": [
        { "Position": { "X": -22.55, "Y": -8.25, "Z": 1.85 } },
        {
          "Adjacent Area": 2,
          "Position": { "X": -22.5496, "Y": -8.48, "Z": 1.6943 },
          "Flags": 1776
        },
        { "Position": { "X": -20.75, "Y": -8.4714, "Z": 1.6817 } },
        {
          "Position": { "X": -20.75, "Y": -6.45, "Z": 3.0503 },
          "Type": "Portal",
          "Flags": 594
        }
      ]
    }
  ],
  "NavpJsonVersion": "0.1"
}

@dbierek dbierek changed the title Tony's and Danny's navtool updates [NavTool] [NavWeakness] Tony's and Danny's navtool updates Apr 20, 2024
@dbierek dbierek marked this pull request as draft April 22, 2024 18:30
@dbierek dbierek changed the title [NavTool] [NavWeakness] Tony's and Danny's navtool updates [NavTool] [NavWeakness] [NavViewer] NavMesh tools/libraries enhancements Apr 23, 2024
@dbierek dbierek changed the title [NavTool] [NavWeakness] [NavViewer] NavMesh tools/libraries enhancements NavMesh tools/libraries enhancements Apr 23, 2024
@dbierek dbierek marked this pull request as ready for review May 24, 2024 10:35
@OrfeasZ OrfeasZ merged commit 7b91b02 into OrfeasZ:master May 28, 2024
4 checks passed
@dbierek dbierek deleted the tony-navtool-updates branch May 28, 2024 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants