68 Commits

Author SHA1 Message Date
Kawe Mazidjatari
564efaf394 Recast: reverse some fields 2024-04-05 18:40:36 +02:00
Kawe Mazidjatari
1f7bbe5b92 Recast: make detail mesh edge detection more robust
Merge recastnavitagion/recastnavitagion@c393777d26
Instead of using a distance check which can fail at large magnitudes due
to low precision we can check whether the edges are actually on the
hull.
2024-04-05 17:19:29 +02:00
Kawe Mazidjatari
e3bf2036b3 Recast: fix:rcBuildLayerRegions missing areaType
Merge recastnavitagion/recastnavitagion@ddaa361b08
2024-04-05 17:19:28 +02:00
Kawe Mazidjatari
abaab38d9d Rename dtOffMeshConnection field
CAI_Navigator::m_traverseRefYaw gets set to this field.
2023-08-29 00:33:48 +02:00
Kawe Mazidjatari
9049e61d34 Move pointers to 'dtQueryData' struct
In the engine, m_query gets memset to size '0x58', and it passes this field as reference to other functions which then access the 3 pointers. Moving the 3 pointers there made the struct size 0x58, and showed a much better disassembly. Moved these type here to reflect the changes made in the engine.
2023-08-27 23:56:11 +02:00
Kawe Mazidjatari
1878c92211 Merge recastnavigation/recastnavigation#619 2023-07-15 16:53:01 +02:00
Kawe Mazidjatari
e57294a1c4 Merge recastnavigation/recastnavigation#455 2023-07-15 16:49:55 +02:00
Kawe Mazidjatari
8468fe011d Merge recastnavigation/recastnavigation#645
Merged the fix, but without the catch upgrade.
2023-07-15 16:40:12 +02:00
Kawe Mazidjatari
0110cd91c2 Fix typos 2023-07-08 02:20:33 +02:00
Kawe Mazidjatari
deb913e47b Merge recastnavigation/recastnavigation@603dc88e5d 2023-07-06 10:10:50 +02:00
Kawe Mazidjatari
3f8baf6f68 Allow setting compile options for specific targets
Previously, it was all controlled from the global init (applied to all projects), but some projects need different options. With these changes, you can disable the common options applied in the 'add_module' macro, and set your own if desired.
2023-06-17 00:45:27 +02:00
Kawe Mazidjatari
417e91b8d9 Merge recastnavigation/recastnavigation@9432fd6381 2023-05-27 16:02:48 +02:00
Kawe Mazidjatari
f943fe8509 RecastMesh.cpp: Fix compiler warning
2 warnings:
Operation 'lkup[arr[i] & 0xF] | 0x8000;' returns an int, but should return a unsigned short; added explicit cast.
Operation 'arr[i] & 0xF' could read up to 64 bytes, while the stack buffer is only 16 bytes. Switched to operation: ''arr[i] & 0x3'.

The static buffer has also been declare const now.
2023-05-15 09:51:27 +02:00
Kawe Mazidjatari
310264c66d RecastMeshDetail.cpp: Fix compiler warning
Function 'updateLeftFace' is static, and when 'REVERSE_DIRECTION' is set to 1, its not getting used anywhere leading to a compiler warning as it has internal linkage with no references, and thus its getting pruned. Only define the function when 'REVERSE_DIRECTION' is 0.
2023-05-15 09:46:51 +02:00
Kawe Mazidjatari
9f44bcc818 Treat compiler warnings as errors
Treat them as errors globally. Most of the time a warning is a bug, or problem in code that could be solved in a different (better) manner. Thirdparty code have this disabled. The warnings as errors option can be globally disabled through the CMake GUI, but this is not recommended.
2023-05-15 09:44:26 +02:00
Kawe Mazidjatari
e5a455e7c7 Apply whole program optimization for certain targets
Only applied to certain targets to prevent bombing compile times; other projects don't really benefit of this.
2023-05-13 11:57:57 +02:00
Kawe Mazidjatari
8dbc2024c6 CMake code improvements
Use the 'add_module' macro to add modules without creating duplicate code. This macro also takes a reuse PCH as parameter, so modules that need a precompiled header, could reuse those from different targets that compile them. This commit also restructures the group order of the generated solution files for easier code navigation.
2023-05-13 00:14:53 +02:00
Kawe Mazidjatari
f120354e96 Initial port to CMake
* All libraries have been isolated from each other, and build into separate artifacts.
* Project has been restructured to support isolating libraries.
* CCrashHandler now calls a callback on crash (setup from core/dllmain.cpp, this can be setup in any way for any project. This callback is getting called when the apllication crashes. Useful for flushing buffers before closing handles to logging files for example).
* Tier0 'CoreMsgV' function now calls a callback sink, which could be set by the user (currently setup to the SDK's internal logger in core/dllmain.cpp).

TODO:
* Add a batch file to autogenerate all projects.
* Add support for dedicated server.
* Add support for client dll.

Bugs:
* Game crashes on the title screen after the UI script compiler has finished (root cause unknown).
* Curl error messages are getting logged twice for the dedicated server due to the removal of all "DEDICATED" preprocessor directives to support isolating projects. This has to be fixed properly!
2023-05-10 00:05:38 +02:00
Kawe Mazidjatari
9dd34ef53a Merge recastnavigation/recastnavigation@8e9c308afd 2023-03-25 17:17:45 +01:00
Kawe Mazidjatari
cea69d3637 Merge recastnavigation/recastnavigation@3c4a34968a 2023-03-25 17:17:12 +01:00
Kawe Mazidjatari
3649f9be5c Remove old comment
This field has been reverse engineered.
2023-03-25 17:14:04 +01:00
Kawe Mazidjatari
dd48093c23 Add experimental switch header
This header allows us to properly switch between experimental/finished STD implementations without having to adjust the source code (required for compiling on older versions of the Visual Studio 2017 compiler).
2023-03-20 00:17:29 +01:00
Kawe Mazidjatari
227885a69f Merge recastnavigation/recastnavigation@b51925bb87, recastnavigation/recastnavigation@7501007439 and recastnavigation/recastnavigation@405cc095ab
Everything has been adjusted to maintain compatibility with the game engine.
2023-02-21 18:19:03 +01:00
Kawe Mazidjatari
4e396728c3 Fix typos 2023-02-21 17:56:56 +01:00
Kawe Mazidjatari
ea18f30eda Fix incorrect rasterization at tile borders (recastnavigation/recastnavigation#476)
Merge recastnavigation/recastnavigation@3901c5854c
2022-11-25 00:05:36 +01:00
Kawe Mazidjatari
edd1c62352 Change vperpXZ to vperpXY 2022-10-22 21:59:57 +02:00
Kawe Mazidjatari
8709a256d9 Use closestPointOnPoly instead of getPolyHeight in dtNavMeshQuery::findRandomPoint 2022-10-22 21:59:57 +02:00
Kawe Mazidjatari
56dd3802f8 Recast & Detour XZY left overs to XYZ
Height should be set on the z axis.
2022-10-22 21:47:07 +02:00
Kawe Mazidjatari
c1ca5d0878 Fix spelling mistakes in Recast & Detour library 2022-10-07 22:32:08 +02:00
Kawe Mazidjatari
9d06a02614 General cleanup
* Use Cbuf functions for executing commands in ImGui panels.
* Use const qualifiers for all vftable indexes.
2022-08-09 02:35:00 +02:00
Kawe Mazidjatari
ea5f17b4ca Light cleanup
* Moved ConVar usage text that where part of the help string to the usage string parameter.
* Flagged ConVar 'bhit_abs_origin' as FCVAR_DEVELOPMENTONLY | FCVAR_REPLICATED.
* Flagged ConCommand 'bhit' as FCVAR_DEVELOPMENTONLY | FCVAR_GAMEDLL.
* Check 'bhit_enable' before running the 'bhit' command callback.
* Fixed spelling in a few area's.
2022-08-04 16:34:23 +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
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
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
0576749de0 Use transparent area color for polymesh debug draw 2022-07-27 14:30:30 +02:00
Kawe Mazidjatari
c16d87ebc5 Fix more Recast & Detour debug drawing
* XZY -> XYZ.
2022-07-27 14:29:54 +02:00
Kawe Mazidjatari
4c8027b319 Fix duDebugDrawHeightfieldLayer and RecastDebugDraw cleanup 2022-07-27 12:38:02 +02:00
Kawe Mazidjatari
df99664d2a Working Recast convex hull 2022-07-27 11:11:41 +02:00
Kawe Mazidjatari
da77600baa More XZY->XYZ places 2022-07-27 10:58:54 +02:00
Kawe Mazidjatari
8757d0a43f NavMesh convex volume drawing somewhat working 2022-07-27 03:50:11 +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
ff0ae1c13b Fix dtMeshTile structure
Removed old member that should had been removed earlier. All members align now.
2022-07-22 12:28:39 +02:00
Kawe Mazidjatari
c850d52d1b Add NavMesh poly bounds debug overlay 2022-07-21 02:21:59 +02:00