16 Commits

Author SHA1 Message Date
Kawe Mazidjatari
59a8f12e0e Recast: allow setting table count in dtNavMesh::init
Needed for pre-allocation on solo mesh.
2024-07-12 12:53:43 +02:00
Kawe Mazidjatari
c64ebe12c2 Recast: fix incorrect renaming
Everything 'dtAlloc', 'rcAlloc', 'dtAlloc', 'dtFree', got renamed into 'rdAlloc', 'rdFree'. There were a lot of object allocators that used these suffixes which were not accounted for causing those to be renamed. Everything has been renamed back to their original names (excluding the actual rdAlloc/rdFree functions as these were supposed to be renamed).

No code logic was changed in this commit.
The accidental renaming was caused in commit fa8d89d287752782ebdd5d9563f04fa72ef0bee9
2024-07-07 17:25:42 +02:00
Kawe Mazidjatari
917b33bb71 Recast: move Detour_IsGoalPolyReachable to dtNavMesh
Make the code shared so we can also use it in the Recast editor.
2024-07-07 12:05:35 +02:00
Kawe Mazidjatari
602fa7d1ec Recast: editor improvements
- Separate disjoint set and traversal table building code
- Use game types and data to determine what to build into the traversal tables (e.g., 5 traversal tables for _small and only 1  for the rest).
- Automatically initialize the editor using the _small navmesh parameters instead of the broken defaults.
2024-07-06 19:51:31 +02:00
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
615f63d82a Recast: rename structure fields and add more documentation
A more consistent name with what has bee reversed so far. Also added documentation on what has been reversed entirely and as much information that i have about stuff that has been partially figured out.
2024-07-05 10:38:16 +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
f999c6ae6d Recast: split dtLink::flags into actual fields
Its split into 3 separate fields, this will be used in the future for fixing jump links between poly's.
2024-07-03 11:59:52 +02:00
Kawe Mazidjatari
b7bca8e15c Recast: remove extraneous clamp for saltbits
Due to the change in 4ced95e2c111178a4127a663d95dc5c02e764d00, there are always 4 salt bits or less.
2024-07-02 16:12:56 +02:00
Kawe Mazidjatari
4ced95e2c1 Recast: properly calculate tile and poly bits during build
Tile bits should be 16, and polyBits 28 - tileBits. This is also the reason why the 'm_saltBits < 10' check no longer exists in the executable.
2024-07-02 14:18:11 +02:00
Kawe Mazidjatari
97204c20dc Recast: light formatting improvements
Keep the style consistent with the rest.
2024-07-02 14:13:05 +02:00
Kawe Mazidjatari
7c90262829 Recast: remove unused and incorrect code
Should no longer be used as tiles are now built correctly after the change in a2d5d52dc4e571388b9b86f21e40a5110a69665e
2024-07-02 01:28:58 +02:00
Kawe Mazidjatari
cc73d147fc Recast: implement off-mesh connection yaw angles and reference positions
Used by the engine for AI wall running, but also other AI logic like move direction. This probably is some cached ref pos + yaw to save on computation in the runtime, and probably used to lerp the AI to the correct direction before jumping. Current implementation seems very close to original navs now, though, the original navs appear to have some yaw angles being rotated a bit, probably manual adjustments to make the AI face a wall that isn't perpendicular.

Also implemented debug drawing for the new ref positions, and made the start circle of the off-mesh connection red, and the end position green to make it easy what is what in bidirectional connections.
2024-06-30 17:36:01 +02:00
Kawe Mazidjatari
0e54998a36 Recast: reverse some fields 2024-04-03 14:52:12 +02:00
Kawe Mazidjatari
fd3e227a86 Align folder structure with p4 2023-09-19 22:13:22 +02:00