Giter Club home page Giter Club logo

gonav's People

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

Watchers

 avatar  avatar  avatar

gonav's Issues

Properly parse game-specific custom area data.

The parser does not actually parse custom data. These lines in parser.go:

// Skip passed some unknown data
var garbageCount byte
p.read(&garbageCount)
p.advanceBytes(int(garbageCount) * 14)

Actually skips over game-specific custom area data.

  • Team Fortress 2 NAVs stores 1 integer at the end of the area data to store TF2-specific area attributes.

Error reading dust2 nav file on new version of Go (1.14)

Doesn't appear to work on the latest Go version using dust2's nav file. I'm using the example in the README.

f, _ := os.Open("de_dust2.nav") // Open the file
parser := gonav.Parser{Reader: f}
mesh, _ := parser.Parse() // Parse the file
area := mesh.QuadTreeAreas.FindAreaByPoint(gonav.Vector3{10, 10, 10}, true) // Find the nav area that contains the world point {10, 10} with a Z-value closest to 10
fmt.Println(area)

I think the problem is in parser.go on line 193. I believe

p.read(currSpot.OrderID)

should read

p.read(&currSpot.OrderID)

That appeared to fix the problem for me. Otherwise, you get the following error:

Failed to open file: Unexpected error when parsing: Failed to read data.
Parent error: binary.Read: invalid type uint32.

Directions (and ladder directions) are wrong

The navmesh file contains connections in the order +x, +y, -x, -y (counter-clockwise), or east, north, west, south. However, nav_compass 1 shows a compass with NESW going counterclockwise (:-1:), so perhaps it's best to avoid these terms altogether. The 32 bit value stored for each ladder is not up or down, it's also a cardinal direction. It seems to be the direction of the bottom area relative to the ladder. Check de_sugarcane for a map with all four ladder directions.

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.