4055 Commits

Author SHA1 Message Date
Kawe Mazidjatari
6fd9a5b936 Recast: allow closing the testcase window
If the testcase window was opened, there was no way to close it without opening a test case. This patch allows you to toggle it.
2024-07-09 16:40:09 +02:00
Kawe Mazidjatari
f843c69672 Recast: properly render text over screen
Use the drawlist wrapper instead of relying on ImGui windows (which didn't work to begin with). Also fixed all text colors that weren't converted from the previous library.
2024-07-09 16:40:08 +02:00
Kawe Mazidjatari
f964db2ccf ImGui: create dedicated file for wrappers and implement RenderText
All future wrappers go here.
2024-07-09 16:31:05 +02:00
Kawe Mazidjatari
9623c1640d Recast: initialize theme and improve UX
New theme and allow user to resize or move all the panels around.
2024-07-09 12:31:35 +02:00
Kawe Mazidjatari
f01fef72cc ImGui: move style initialization code to separate file
Make it easier for shared to to utilize this.
2024-07-09 12:30:34 +02:00
Kawe Mazidjatari
ffeebd96d2 Recast: remove comment of a fixed issue
Fixed in commit 1dbc9cd52adc99c537a45215ab1761d3a53e2306.
2024-07-09 11:46:29 +02:00
Kawe Mazidjatari
9bbab5b15e Recast: remove unused tool parameters
These parameters are unused, but since they are checked on and unset, they caused certain elements to not display. Removed them since the expansion logic is now fully handled by Dear ImGui.
2024-07-09 11:45:21 +02:00
Kawe Mazidjatari
fdfd7ef416 Recast: replace old graph plotter with ImPlot
The old one doesn't work properly with the new ImGui library since the upgrade in commit 949d01da7935d957e0a01cbd592364e74008d8c4. Moved to the use of ImPlot which was added in commit c2df5e19bf332db0ff24849ee5bbb4c033c51117.
2024-07-09 11:41:05 +02:00
Kawe Mazidjatari
1dbc9cd52a Recast: fix crash caused by uninitialized member variable
Should've been initialized. Caused a crash sometimes when loading up the NavMeshTesterTool as this will be some random value.
2024-07-09 11:41:05 +02:00
Kawe Mazidjatari
e2c48c49db Recast: upgrade legacy ImGui implementation to 1.90.4 (WIP)
Major upgrade to newer library. This is still work in progress, there are many bugs.
2024-07-09 11:41:05 +02:00
Kawe Mazidjatari
4c37d8fc69 Recast: fix crash caused by uninitialized member variable
Should've been initialized. Caused a crash sometimes when loading up the NavMeshTesterTool as this will be some random value.
2024-07-09 01:16:28 +02:00
Kawe Mazidjatari
c2df5e19bf ImGui:: add ImPlot (ImGui Plotter tools)
Will be used for upgrading ImGui in the Recast NavMesh editor, and future tooling in-game.
2024-07-09 00:57:31 +02:00
Kawe Mazidjatari
4c43f08248 ImGui: move core demo to 'demo' directory
Light cleanup.
2024-07-09 00:56:11 +02:00
Kawe Mazidjatari
c813667d61 ImGui:: add SDL2 and OpenGL2 backends
Will be used for upgrading ImGui in the Recast NavMesh editor.
2024-07-09 00:30:18 +02:00
Kawe Mazidjatari
ca385bd37d Recast: improve poly groups text overlay
Temporary improvement.
2024-07-08 17:29:22 +02:00
Kawe Mazidjatari
5ab83f2db4 Recast: improve performance of dtDisjointSet::setUnion
Don't index multiple times into the same array with the same index.
2024-07-08 16:03:04 +02:00
Kawe Mazidjatari
e28ea6cab1 Recast: add path compression to disjoint set algorithm
Improve performance for future lookups.
2024-07-08 15:57:06 +02:00
Kawe Mazidjatari
4801435d42 Recast: fix disjoint poly group builder bug
The new mapping was never applied on the disjoint set, causing the indices to be off during traversal table building. Also made the initialization of the disjoint set the responsibility of dtCreateDisjointPolyGroups.
2024-07-08 15:40:24 +02:00
Kawe Mazidjatari
7875cb6310 Recast: select traverse type during init in NavMeshTesterTool
Set it to the first usable one instead of "none" since we will be using the anim types a lot more often than "none". Also removed some extraneous separators to enhance the UX.
2024-07-08 12:31:25 +02:00
Kawe Mazidjatari
aaaca914a6 Recast: union poly groups connected through off-mesh connections
Poly groups connected though off-mesh connections should be unioned. Confirmed working during in-editor tests.
2024-07-08 12:29:44 +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
c64ebe12c2 Recast: fix incorrect renaming
Everything 'dtAlloc', 'rcAlloc', 'dtAlloc', 'dtFree', got renamed into 'rdAlloc', 'rdFree'. There were a lot of object allocators that used these suffixes which were not accounted for causing those to be renamed. Everything has been renamed back to their original names (excluding the actual rdAlloc/rdFree functions as these were supposed to be renamed).

No code logic was changed in this commit.
The accidental renaming was caused in commit fa8d89d287752782ebdd5d9563f04fa72ef0bee9
2024-07-07 17:25:42 +02:00
Kawe Mazidjatari
3fbe657577 Recast: implement static pathing logic in editor
The editor now takes the static pathing data into account when creating paths/testing the navmesh using the NavMeshTesterTool or CrowdTool. An option is made allowing you to select which traverse anim type you want to use for pathing (each of them uses a different traversal table, thus giving them different options as to which links and jumps they can take).

This allows us to test AI withing the editor itself, thus saving a lot of time shuffling navmesh files around and reloading them in-game.
2024-07-07 17:04:00 +02:00
Kawe Mazidjatari
86bdbce7b1 Server: add indices for first traverse anim types per navmesh type 2024-07-07 16:58:04 +02:00
Kawe Mazidjatari
446aef8b7c Recast: add isGoalPolyReachable to dtNavMeshQuery
A simple proxy from dtNavMeshQuery to dtNavMesh::isGoalPolyReachable.
2024-07-07 16:56:18 +02:00
Kawe Mazidjatari
917b33bb71 Recast: move Detour_IsGoalPolyReachable to dtNavMesh
Make the code shared so we can also use it in the Recast editor.
2024-07-07 12:05:35 +02:00
Kawe Mazidjatari
c56e1cc801 Recast: reorder mesh params properties display
Move mesh above tile (mesh -> tile -> poly).
2024-07-07 01:51:55 +02:00
Kawe Mazidjatari
ca08d290db Recast: improve readability of disjoint poly group builder 2024-07-07 01:15:43 +02:00
Kawe Mazidjatari
9b2fc8e183 Recast: increase adjustability of convex volume shape
Make it MAX_COORD_FLOAT so it could cover the entire map regardless of where it is.
2024-07-07 01:15:12 +02:00
Kawe Mazidjatari
23703dcd2a Recast: display details about built/loaded navmesh 2024-07-07 01:13:35 +02:00
Kawe Mazidjatari
fc18050b29 Recast: use '0' as null poly group identifier
(unsigned short)-1 (65535) is technically a valid poly group. We also count from 2 as 1 is reserved for unusable poly's, and 0 was reserved kept reserved for simplicity so just use 0 as the null identifier.
2024-07-07 00:00:06 +02:00
Kawe Mazidjatari
d7235a799a Recast: light variable name cleanup
Enforce consistency
2024-07-06 20:02:37 +02:00
Kawe Mazidjatari
602fa7d1ec Recast: editor improvements
- Separate disjoint set and traversal table building code
- Use game types and data to determine what to build into the traversal tables (e.g., 5 traversal tables for _small and only 1  for the rest).
- Automatically initialize the editor using the _small navmesh parameters instead of the broken defaults.
2024-07-06 19:51:31 +02:00
Kawe Mazidjatari
b456825016 Server: add traverse table count array for navmesh
Allows for quick lookups to check how many traverse tables a certain navmesh has.
2024-07-06 18:43:12 +02:00
Kawe Mazidjatari
1346a74933 Server: add traverse anim type name array 2024-07-06 18:41:55 +02:00
Kawe Mazidjatari
6c6a9b0140 Core: move all base integral types to dedicated header
There was always a problem dealing with core integral types accros various projects, since we typically only use IDA's pseudo definitions for rebuilding decompiled functions. It however did define almost all the integral types we use throughout the SDK. These types have been commented out and a new header has been made that defines everything we need (and we can add more in the future if this deems necessary). This new header is included with tier0/basetypes.h, so all projects have access to it and the tier0 headers will work out of the box without defining anything new.
2024-07-06 17:10:21 +02:00
Kawe Mazidjatari
a3fb26dab6 Server: add missing implementation of NAI_Hull::Scale
Should've been committed with 4134cd9f42eef045f63359ad4b961007e09bced0
2024-07-06 11:51:34 +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
4134cd9f42 Recast: use actual hull values of the game for navmesh generation
These values seem to generate navmeshes that are almost identical to Titanfall 2 single player navmeshes in terms of geometry calculations per navmesh size. Its likely these are the actual values used internally to create these.
2024-07-06 11:46:34 +02:00
Kawe Mazidjatari
de1ec81690 Core: SDK init code should be exported as well
Regression caused in commit f989061e2d651da7f2559aee2cfc41b1f20f4790
2024-07-06 09:59:27 +02:00
Kawe Mazidjatari
d9c6ec7786 Recast: setup project for using shared sdk code
Allows Recast editor to use shared SDK code.
2024-07-06 09:39:37 +02:00
Kawe Mazidjatari
fa352344f3 Recast: set some new render options enabled by default 2024-07-06 09:37:58 +02:00
Kawe Mazidjatari
f989061e2d Tier0: drop SDK specific code for tools
Mathlib doesn't use some of the game-specific mutex stuff, but since our tools is now also including the mutex utilities, we have to block them out for _TOOLS as well.
2024-07-06 09:33:31 +02:00
Kawe Mazidjatari
a03603b0bd Tier0: define STATIC_TIER0
This fixes a bunch of linker errors when trying to use tier0 utility code in new projects while not utilizing the rest of the library. We don't need to export the CThreadMutex stuff as everything we build is static. Only the logging functions should be exported, these are therefore using DLL_EXPORT explicitly.
2024-07-06 09:31:35 +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
025a23991f Recast: fix editor settings bug causing a crash
Make sure Sample Distance cannot be set lower than 1, doing so will cause crash in sampling code. Clamp between 1 and 16.
2024-07-06 01:57:03 +02:00
Kawe Mazidjatari
df1dfea806 Recast: add more documentation about traversal tables
Important notes for the future.
2024-07-06 01:56:01 +02:00
Kawe Mazidjatari
0a296c5a5f Recast: fix group merging bug in static path building
Don't merge poly islands under the same group id if there's an off-mesh connection linking the 2. The off-mesh connection polygon also gets its own group id now.

The reason we don't want to merge them is because not all ai can take the off-mesh link under on the same navmesh, and if we merge them the ai would still try and reach a goal poly it couldn't, causing it to become hard stuck on the poly island's boundary.
2024-07-05 22:24:54 +02:00