8 Commits

Author SHA1 Message Date
Kawe Mazidjatari
1a3f7b6bda Recast: rename reachability table to traversal table
The static pathing code is split into 2 elements, the disjoint sets (poly groups), and the traversal table (which links poly groups, visually known as poly islands) together through jump or offmesh links. Reachability covers more than just traversal in the context of this game engine, therefore it has been renamed to avoid future confusion.
2024-07-05 17:48:48 +02:00
Kawe Mazidjatari
fa8d89d287 Recast: make assert and allocation code shared
All recast/detour allocation and assertion code were identical, with the exception of their names (rc* for recast, dt* for detour). We want to use Recast's rcVectorBase class in Detour code, as there is no Detour equivalent, but copying it in its whole isn't good practice (especially considering there is more boilerplate code we want to get rid of in the future). Moved these to Shared so Detour could use it as well under the name rdVectorBase (rd stands for Recast Detour). No changes to the logic of the code were made in this patch.
2024-07-04 11:32:56 +02:00
Kawe Mazidjatari
1ac6f9be60 Recast: integrate static pathing generation/parsing code into editor
Instead of building the static pathing data when the NavMesh is getting saved, build it right after the NavMesh has been build. also, parse this data out from NavMesh files loaded from the disk. This patch also documented some extra features and designs. In the future, static pathing logic will also be implemented in the detour path query code.
2024-07-04 00:54:50 +02:00
Kawe Mazidjatari
d03dfe645f Recast: group all unconnected poly's (optimization & bug fix)
Reserve poly group ID 1 (defined as DT_STRAY_POLY_GROUP) for unlinked poly's. The game skips all poly's that are marked 1. Previously, before this optimization, the AI would become stuck when they walk over an island who's poly's are marked 1 as we didn't take this engine feature into account in Recast.

- Recast will now render all poly's marked 'DT_STRAY_POLY_GROUP' as red.
- This patch also reduces the number of poly group id's and therefore reduces the overall size of the NavMesh.
2024-07-03 11:55:24 +02:00
Kawe Mazidjatari
c215fcb220 Recast: fix incorrect reachability table buffer size calculation
Reachability table buffers were way larger than they should be due to an incorrect calculation of the buffer size. This bug fix reduced NavMesh sizes significantly (worlds edge '_small' was 200mb, and is now 20mb after this patch).
2024-07-03 10:45:44 +02:00
Kawe Mazidjatari
bff572659f Recast: enable reachability table building code
It was commented as it was offset with 4x4 bytes, this has been fixed and therefore reachability tables allocate properly in memory now.
2024-07-03 10:39:05 +02:00
Kawe Mazidjatari
e3250fc53a Recast: make default cell size 16 units
Seems to result in the best NavMesh, and also seems to perform the best in-game with even better reliability than before.
2024-07-02 16:16:15 +02:00
Kawe Mazidjatari
fd3e227a86 Align folder structure with p4 2023-09-19 22:13:22 +02:00