67 Commits

Author SHA1 Message Date
Kawe Mazidjatari
e5f445e9c8 NavEditor cleanup
Moved functions and structures to their own files.
2022-07-20 15:07:51 +02:00
Kawe Mazidjatari
31b2a6c9ec Force always reachable again
Reachability still doesn't work properly. Something shifts it in memory but I don't know yet what it is. They however did add something.
2022-07-20 12:35:13 +02:00
Kawe Mazidjatari
59dd3e2228 NavMesh system improvements
* Confirmed DT_MAX_AREAS size being 32 (originally 64).
* header->offMeshEnds to -1.
* Added pointer to 'g_pHullMask'.
2022-07-19 22:00:40 +02:00
Kawe Mazidjatari
0ec03a62b1 Working AI reachability tables
* Set reachability table count to 1.
* Don't divide reachability write size by 4.
* Trim off all unused bytes after building reachability table.
* Default cvar 'navmesh_always_reachable' to 0.

AI behavior seems to have improved a bit, they attempt to pathfind better, and if they find a certain route they attempt another route where originally they would become stuck in such situation.

If you build the SDK after this commit, you need to rebuild all navmeshes, else the game would segfault in dtNavMesh::isPolyReachable().
2022-07-19 02:38:01 +02:00
Kawe Mazidjatari
9f27b58f95 Improve struct member naming consistency
Improved alignment of class 'Sample' and improved naming consistency.
2022-07-18 19:32:36 +02:00
Kawe Mazidjatari
aaec14c3d4 Update member names on currently commented saveAll body 2022-07-18 12:42:00 +02:00
Kawe Mazidjatari
57bb9dffce Update dtNavMesh, dtNavMeshParams and dtMeshTile structures
dtNavMesh is now almost fully mapped out (most members should be correct, the only unsure ones are the unknowns and the mesh/tile flags).

dtNavMeshParams has one new field (I think the last field determines the precomputed malloc size, but I'm not very sure. It would make sense with the inline loop in 'Detour_LevelInit()' setting a certain field in each tile to -1).

dtMeshTile has one extra field (currently unknown) and the renamed unk0 field was is a pointer to the end of the 'polys' array.
2022-07-18 12:38:41 +02:00
Kawe Mazidjatari
31b95f41e8 Don't initialize SDL when running naveditor from the commandline
+ some additional cleanup.
TODO: get logging working on command line
2022-04-22 02:33:26 +02:00
Kawe Mazidjatari
5a2cbaf40a Increase max tiles (hack)
Hack, but it does work properly, even on tiles which are using ID's larger pre-commit (non-generated area's).
2022-03-24 02:07:56 +01:00
Kawe Mazidjatari
9b33e1b94e Fix more debugdraw 2022-03-19 12:56:22 +01:00
Kawe Mazidjatari
35ad8554a5 Somewhat correct working navmesh
The reachability table needs to be figured out still. The issue should be very small, but at the moment I do not have time for it.

The pointer to the table, and table pointers to data is correct, however, not a single poly is ever getting marked as 'reachable' (0xffffffff). This could be either within recast itself (see build_link_table() and set_reachable() functions), or the way the engine parses the data. The function that determines whether poly is reachable is located at '0x140F448E0'
2022-03-18 03:14:07 +01:00
Amos
7e24c31e94 Forgot this one 2022-03-16 01:36:57 +01:00
Amos
243c5e4af7 Fix cylinder debug draw 2022-03-16 01:33:58 +01:00
Amos
7cd73893f4 Build navmesh files to game directory
And additional compiler improvements
2022-03-13 22:20:02 +01:00
Amos
3cf36b5d61 Increase compile performance even more for NavMesh Editor
Cleaned up redundant includes
Reordered required ones
2022-03-13 03:00:07 +01:00
Amos
b3f064d009 Create precompiled header for NavMesh Editor and restructure project filter 2022-03-13 02:22:55 +01:00
Amos
d71b949468 Add Recast & Detour navmesh editor to SDK 2022-03-13 01:15:52 +01:00