45 Commits

Author SHA1 Message Date
Kawe Mazidjatari
e92b5d1300 General cleanup
Use c++ methods, remove unnecessary casts, unnecessary use of auto, etc..
2022-08-09 15:19:12 +02:00
Kawe Mazidjatari
418bd2d679 Improve NavMesh poly blue tone color 2022-08-04 15:41:45 +02:00
Kawe Mazidjatari
05f2888716 fix error log 2022-07-28 15:51:34 +02:00
Kawe Mazidjatari
9eeaebaf6a Even More XZY->XYZ changes 2022-07-28 15:45:02 +02:00
Kawe Mazidjatari
cbaf10478a More XZY->XYZ changes
* dtIntersectSegSeg2D: Calculate over zy-plane instead.
* dtOverlapPolyPoly2D: Calculate over zy-plane instead.
* dtNavMeshQuery::findRandomPoint: z = h.
* dtNavMeshQuery::raycast: Invert hit normals.
* Update all comments to use xyz vector instead (previously xzy (xz-plane z-height)).
2022-07-28 14:24:29 +02:00
Kawe Mazidjatari
c7d61e8b77 Switch neighborhood deltas 2022-07-28 12:49:42 +02:00
Kawe Mazidjatari
0f8f1a4860 Increase smooth path step size and slop
This increases the size of the path lines (this had to be increased due to the scale of the maps in this engine, recast was originally not scaled for it).
2022-07-28 12:34:20 +02:00
Kawe Mazidjatari
4ada4cef72 NavMeshTesterTool XZY->XYZ 2022-07-28 12:14:35 +02:00
Kawe Mazidjatari
34076142ba More XZY->XYZ changes 2022-07-28 03:21:20 +02:00
Kawe Mazidjatari
ce28ea2691 Even more offMeshConnections debug draw fixes 2022-07-28 02:07:13 +02:00
Kawe Mazidjatari
8af97beb57 Fix offMeshConnections debug draw 2022-07-28 01:48:17 +02:00
Kawe Mazidjatari
6a1b6c580a Increase debug arow size 2022-07-28 00:52:12 +02:00
Kawe Mazidjatari
37637bc56a Properly fix cylinder, circle and arrow debug draw for Recast. 2022-07-28 00:41:47 +02:00
Kawe Mazidjatari
f0eecc80ff Flip vertex order for convex hull properly 2022-07-27 21:13:36 +02:00
Kawe Mazidjatari
87a42efd72 Uncomment and fix crowd anticipate turn debug draw
Moved internal functions to their own translation unit.
2022-07-27 21:05:27 +02:00
Kawe Mazidjatari
88a29f2770 Improve crowd speed/acceleration/braking
Changed to values comparable to game.
Added sliders for acceleration and speed.
2022-07-27 20:08:17 +02:00
Kawe Mazidjatari
03698a4a5f Fix DetourCrowd
XZY -> XYZ.
Crowd agents now traverse over the poly surfaces properly.
2022-07-27 17:48:51 +02:00
Kawe Mazidjatari
6d4b2ea7ef Increase convex volume alpha and height 2022-07-27 15:12:47 +02:00
Kawe Mazidjatari
677d993403 Draw ground convex points red as well 2022-07-27 14:56:11 +02:00
Kawe Mazidjatari
369c92e358 Improve convex volume creation/drawing
* Improved ground convex visibility (changed to red as this acts as deletion).
* Default m_areaType to SAMPLE_POLYAREA_GROUND.
2022-07-27 14:44:42 +02:00
Kawe Mazidjatari
92ecdcf698 Increase default height for NavMesh convex hulls 2022-07-27 10:53:57 +02:00
Kawe Mazidjatari
8757d0a43f NavMesh convex volume drawing somewhat working 2022-07-27 03:50:11 +02:00
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
68440361cc Rename IMeshLoader members 2022-07-20 15:18:34 +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
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