3844 Commits

Author SHA1 Message Date
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
Kawe Mazidjatari
57484ee163 Server: reimplement Detour_IsGoalPolyReachable
The function is simple and everything for it has been reversed. Function has been rebuilt to make debugging easier, and confirmed to work as designed.
2024-07-05 18:02:56 +02:00
Kawe Mazidjatari
1a3f7b6bda Recast: rename reachability table to traversal table
The static pathing code is split into 2 elements, the disjoint sets (poly groups), and the traversal table (which links poly groups, visually known as poly islands) together through jump or offmesh links. Reachability covers more than just traversal in the context of this game engine, therefore it has been renamed to avoid future confusion.
2024-07-05 17:48:48 +02:00
Kawe Mazidjatari
44928a3c7c CMake: reorganize Recast & Detour projects
Move under "Thirdparty/Navigation".
2024-07-05 15:56:48 +02:00
Kawe Mazidjatari
20e0d0ee53 Client: add note for reconnect logic
Potential engine bug that needs to be fixed to allow reconnecting to listen server without killing it.
2024-07-05 15:56:07 +02:00
Kawe Mazidjatari
f2c64b390c DataCache: add note for future improvements
error.rmdl is in common.rpak but it should be in common_early.rpak.
2024-07-05 15:54:53 +02:00
Kawe Mazidjatari
cc2ed85847 Public: fix typo 2024-07-05 15:53:20 +02:00
Kawe Mazidjatari
568265a330 Server: refactor AI detour implementation
The current implementation was mixing several types with each other, making it hard to determine what a hull and what a navmesh type is. Code has been refactored to use the new types and names introduced in commit e638cc9323c7b74279f0274591264efc53c29d4d.
2024-07-05 15:52:43 +02:00
Kawe Mazidjatari
d2cf0ebac6 Server: create new hull types
Add reverse engineered hull types and globals in the SDK which will be used to debug and implement AI code in the future.
2024-07-05 15:49:57 +02:00
Kawe Mazidjatari
e638cc9323 Server: create new core NavMesh types
Create new types which will be used to refactor the current Detour implementation in the SDK.
2024-07-05 15:47:56 +02:00
Kawe Mazidjatari
089dddf2c4 Server: add note for finishing NavMesh hotswap implementation
this has to be done in the future to finalize this, for the time being, a workaround in scripts can be implemented using CodeCallback_OnNavMeshHotSwapBegin and CodeCallback_OnNavMeshHotSwapEnd (destroyingon begin, restoring on end).
2024-07-05 15:00:03 +02:00
Kawe Mazidjatari
4503543314 GameShared: render stray polygroups as red 2024-07-05 14:58:25 +02:00