mrazza / gonav

A Source Engine navigation mesh file parser written in Go.
GNU Affero General Public License v3.0
50 stars 11 forks source link

Properly parse game-specific custom area data. #5

Open WhyIsEvery4thYearAlwaysBad opened 3 years ago

WhyIsEvery4thYearAlwaysBad commented 3 years ago

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.

mrazza commented 3 years ago

Is this reserved space of equal size that can be encoded with arbitrary game-specific information? Or is this TF2 behavior you described very TF2-specific? I reversed this with CSGO nav meshes so I'm not surprised to find there's some value here.

WhyIsEvery4thYearAlwaysBad commented 3 years ago

Is this reserved space of equal size that can be encoded with arbitrary game-specific information? Or is this TF2 behavior you described very TF2-specific? I reversed this with CSGO nav meshes so I'm not surprised to find there's some value here.

This is reserved space of equal size that can be encoded with arbitrary game-specific information. Left 4 Dead and Left 4 Dead 2 stores zombie spawn flags and attributes in this custom data. TF2 stores a flag for custom attributes, and CS:S and CS:GO stores approach spot data here.

MathiasLui commented 2 years ago

TF2 stores a flag for custom attributes, and CS:S and CS:GO stores approach spot data here.

But aren't approach areas are handled before that? How did you find out what is stored there in CS:GO? I couldn't figure it out looking at the source leak and the community wiki