36 Commits

Author SHA1 Message Date
Kawe Mazidjatari
07f495e153 Recast: improve Detour rendering enumerant naming 2024-08-11 11:15:37 +02:00
Kawe Mazidjatari
fd587978b5 Recast: cleanup tile renderer 2024-08-11 11:09:39 +02:00
Kawe Mazidjatari
4c2f4e39a0 Recast: optimize and improve traverse link renderer
Only render the cross at the start as the reverse link will render the 2nd one. Else we render 4 crosses. Also made the alpha of the line around 50%, since we render the forward and reverse link, it will render with 100% opacity, if the reverse link is missing, the crosses will disappear and the line will only render at 50% opacity to make it more clear something is wrong.
2024-08-11 02:48:28 +02:00
Kawe Mazidjatari
3fade09920 Recast: add option to draw tile bounds 2024-08-11 02:42:35 +02:00
Kawe Mazidjatari
51eac9c91c Recast: add option to filter traverse links by distance 2024-08-08 19:52:28 +02:00
Kawe Mazidjatari
c12690b33c Recast: use the constants 2024-08-08 16:02:16 +02:00
Kawe Mazidjatari
55c98902f3 Recast: optimize traverse link debug draw
Should be checked in the outer loop.
2024-08-08 15:46:24 +02:00
Amos
c7adefa56c Recast: update poly area's for MSET >= 7
These should be the poly area enumerants for MSET version 7 or higher.
2024-07-24 23:39:39 +02:00
Amos
2a45ced5f4 Recast: fix compile error caused by missed version checks 2024-07-24 10:26:41 +02:00
Amos
99db511930 Recast: add option to draw tile cells
MSET 8 or higher only.
2024-07-22 18:49:12 +02:00
Kawe Mazidjatari
b56649facb Recast: add some debug drawing for unknown dtOffMeshLink field 2024-07-19 01:09:15 +02:00
Kawe Mazidjatari
193ec6aec7 Recast: fix compile error
Should've been pushed with commit fce53b6eed985a323846dff7dbcbd0b67cae7928
2024-07-18 15:56:36 +02:00
Kawe Mazidjatari
fce53b6eed Recast: update dtLink variable names and assignments
Light cleanup and added new names and documentation of what's currently know.
2024-07-18 15:49:51 +02:00
Kawe Mazidjatari
12f39f1c44 Recast: add traverse links debug drawing
Originally taken from https://github.com/ASpoonPlaysGames/r2recast, slightly modified to use the new constants added in commit 78a632eec85ca5406adb03617084746b446b0044, and now renders white crosses if reverse links are set.
2024-07-18 14:22:14 +02:00
Kawe Mazidjatari
93439d9055 Recast: make polygon draw softening optional 2024-07-18 00:58:20 +02:00
Kawe Mazidjatari
3b10774ca4 Recast: light cleanup in off-mesh connection renderer 2024-07-17 02:03:37 +02:00
Kawe Mazidjatari
fd234b8550 Recast: improve rendering of off-mesh connections
Make the line always blue, and render a cross if the start and/or the end position has been set correctly.
2024-07-17 00:40:44 +02:00
Kawe Mazidjatari
f64696d18b Recast: improve unlinked poly bounds color
The thickness of the bounds were increased, so the red one doesn't need to be darker anymore. Previously it was hard to see compared to the blue poly's.
2024-07-16 11:51:33 +02:00
Kawe Mazidjatari
1853b571c5 Recast: use math functions from Recast & Detour itself
Make the code base more consistent.
2024-07-16 02:08:06 +02:00
Kawe Mazidjatari
5c467f5a49 Recast: also hook up depth test option for duDebugDrawNavMeshPoly 2024-07-16 00:58:50 +02:00
Kawe Mazidjatari
5f90ea08f2 Recast: make all math helpers shared
There was an issue where Recast's common math library was less complete than that of Detour. Some common math operations were also isolated in specific translation units causing copies everywhere. All common math operations have been moved to the Shared library ultimately fixing all the above issues.
2024-07-15 19:27:55 +02:00
Kawe Mazidjatari
3f2de9ac6d Recast: improve navmesh rendering
Make boundaries and vertices a bit more thin and make vertices more dark.
2024-07-14 20:43:57 +02:00
Kawe Mazidjatari
0edf5c1717 Recast: add ability to offset Recast and Detour debug drawing
New ability to adjust it in all directions, recast and detour offsets are separate. By default, the Recast mesh renders 20 units from the input geom and Detour 30 units to avoid z-fighting.
2024-07-14 18:34:13 +02:00
Kawe Mazidjatari
218634cb7e Recast: slight rendering improvements
- Make NavMesh light blue (original color, but more solid and vibrant).
- Make Recast poly mesh and height field's darker blue, but more opaque.
- Increase render thickness of outer poly boundaries (should and will be an option in the debug class soon).
- Increase render size of poly verts (should and will be an option in the debug class soon).
- Make gradient background color slightly more uniform with the GUI.
2024-07-13 21:29:37 +02:00
Kawe Mazidjatari
192f5dd326 Recast: rework render options
Also used flag approach for tilemesh rendering, previously you could only render one thing, or a hardcoded set of things at a time. Now you can toggle what you want to draw (e.g. the voxels and detail polys). Also moved all NavMesh drawing options to the NavMesh category instead of TileMesh, e.gm the BVTree drawing options. This patch also allows you to toggle the input mesh off separately from the NavMesh, which is useful for larger levels.
2024-07-10 11:06:50 +02:00
Kawe Mazidjatari
6a9599ca2e Recast: make navmesh debug draw flags an int
Should be an int not a char, we use more bits than a char can store now.
2024-07-08 01:39:19 +02:00
Kawe Mazidjatari
94e2df9542 Recast: add option to render poly's by group id
Useful for debugging static pathing data.
2024-07-06 11:48:14 +02:00
Kawe Mazidjatari
b5afdfe2f3 Recast: add more render options 2024-07-06 09:24:39 +02:00
Kawe Mazidjatari
601d958e14 Recast: invert render toggle flags 2024-07-06 02:20:17 +02:00
Kawe Mazidjatari
33b6d9e351 Recast: add new render toggle settings
Synced from Perforce.
2024-07-06 02:12: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
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
97204c20dc Recast: light formatting improvements
Keep the style consistent with the rest.
2024-07-02 14:13:05 +02:00
Kawe Mazidjatari
1e9363f9eb Recast: draw poly centers 2024-06-30 17:42:46 +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
fd3e227a86 Align folder structure with p4 2023-09-19 22:13:22 +02:00