Should've been converted to the source engine coordinate system as well, but we missed this as then rendering thereof was 'fixed' incorrectly causing incorrect bounding volumes to appear correctly. Fixed the renderer and the calculation; the AI now never gets stuck in-game regardless whether 256 or 512 sized tiles are used.
Since the table was taken out of the child instance in commit 245ff565042870e0cded7a2ec3dcc868a00414af, we should no longer handle the window and frame separately. Car count must now be counted together.
Allow the user to specify how far to extend from the current tile towards the direction of the traverse link, this is useful when navmeshes with smaller tiles are generated as the neighbor lookup boundary for these are essentially bound to the tile size, thus smaller tiles will result in smaller links unless we extend to further neighbors.
Reducing the tile size to 16 for all types completely eliminated the issue where an NPC in-game fails to find a steer poly after traversal (call to dtNavMeshQuery::findNearestPoly fails). Tile size of 16 causes correct tile numbering for world bmins and bmaxs. Also added 2 new sliders allowing the change of min and max tile bits + some additional cleanup.
Added table that allows you to fine tune and toggle traverse types for all anim types and navmeshes. Also tweaked default values with newer fine tuned ones to improve link generation more. There's still a ton of fine tuning work left to be done.
Results in better and more correct navmeshes as super_spectre doesn't support all the types frag_drone has for example, use the mask table to determine whether to establish or not. Also added proper directives now to map the 19 and 20 types properly between MSET 5 and MSET 8.
Low res version of the firing range had 1 failure case, kings canyon had 10+. This typically happens if the cell is right on a poly edge. If getting the height from triangle fails, get it from detail edges instead. This fixes pretty much all failure cases with high accuracy (not as high as getting it from the triangle, but with only 10 failures on a map the size of kings canyon is more than good enough).
Out of bounds access caused when a navmesh is loaded with a smaller amount of tables than currently selected. Always reset the selector when loading/building.
Instead of getting the opposite tile of where our vert is to create the largest links possible, get the nearest one instead. This gets rid of almost all unwanted noise.
Changed algorithm to use elevation instead of slopes and updated values to newer values which are still somewhat incorrect, but at least now we have full coverage on all types. Will need to be polished further. Also made the selector loop in reverse which causes way better and more coverage than starting from the start of the table.
Should always be checked, linking edges that face the same direction causes the ai to perform unnecessary jumps and sometimes even causes it to clip into geometry.
Check if we have enough space for num new links before starting the complex calculations. This optimization saved 10+ seconds on the firing range and had no effect on the output results; the navmesh still hashed to the same value as the one build before this patch.
Move internal edge link generation to separate loop, this results in way better jump link coverage on the navmesh, else we eat up all available links by the time a neighbor uses the tile again. Also did some improvements to the masks in s_traverseAnimTraverseFlags to better reflect coverage for each traverse anim type, this most likely could still use some work however.
Previously we handles each table the same. The updated algorithm now has a disjoint set for each traverse anim type, and selectively determines which poly's are reachable based on the link's traverse type connecting them. All left to be done here is making a correct lookup table, which is currently defined as s_traverseAnimTraverseFlags.
Split traverse link creation and updating code from the editor, only alloc traverse table when we are creating them or when we load navmeshes that have them, don't alloc them before the navmesh is built. Also moved the disjoint set data to the editor class so we can cache the results and reuse them later after editing the navmesh post build. Traverse link algorithm now also ignores polys marked unlinked.
* Properly calculate how much we need to offset from the navmesh's edge to account for the ledge span
* Properly check if the edge we are connecting to overhangs our lower link position.
* Check if our ledge span offset causes the link to clip into geometry, and skip linking if so.
* Removed an improper intersection test in 'Editor::connectTileTraverseLinks', which caused many false positives (all issues this fixes, have been fixed with the improved 'traverseLinkInLOS'.
* Removed extraneous 'CanOverlapPoly' check; all links can now overlap poly's without issues if they pass through the 'traverseLinkInLOS' test.
* Only perform offsetting calculation if we have an amount to offset.
* Split 'dtCalcLinkDistance' into 2 functions, one that calculates it and 'dtQuantLinkDistance' that performs the quantization.
* Removed incorrect and experimental code from 'dtNavMesh::connectExtOffMeshLinks', this was to test off-mesh links for MSET 5, but this wasn't the correct approach.
The upper pos needs to be offset forward with at least the agent's radius since for jumps, we don't take the gap between the ledge and navmesh into account.