17 Commits

Author SHA1 Message Date
Kawe Mazidjatari
ba97662c99 Recast editor cleanup and improvements
* Removed Samples button and dialogue.
* Removed SoloMesh.
* Removed TempObstacles.
* Limit 'Verts Per Poly' to 6 (DT_VERTS_PER_POLYGON).
* Moved hulldef constant and handler to TileMesh.
* Set m_tileSize based on hull (small = 32, med_short = 32, medium = 32, large = 64, extra_large = 64).
2022-07-26 15:45:40 +02:00
Kawe Mazidjatari
112a530d5a Improve Recast & Detour and NavMesh generation
* Add missing dtQueryFilter field (some flag used in the engine but not sure yet what it does).
* Set tile->polysEnd and tile->offMeshConsEnd to end of polys and offMeshCons array pointer (if ever needed).
* Set camera perspective to 75 (previous 50).
* Improve theme.
* Lowered the climb height for all hulls (this improves NavMesh generation around low obstacles, previously it would create a poly connecting the ground on the side with the surface of the object around where it connects with the ground, causing AI to take this route instead and kind of 'glitch' onto the surface).
2022-07-26 14:23:02 +02:00
Kawe Mazidjatari
5b9b0164b1 Remove 'bool* is_tf2' from class 'Sample' 2022-07-20 16:44:28 +02:00
Kawe Mazidjatari
4f0e4eae04 Remove extraneous fclose call 2022-07-20 15:22:11 +02:00
Kawe Mazidjatari
7481cefd78 Ability to load navmeshes from game directory
Load navmeshes from '..\\maps\\navmesh\\' first before attempting to load from root.
2022-07-20 15:21:21 +02:00
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
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
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