3968 Commits

Author SHA1 Message Date
Kawe Mazidjatari
c23c953be1 Recast: set window icon and title 2024-07-11 01:37:04 +02:00
Kawe Mazidjatari
4d94a9c1ba Recast: align file menu's with main menu's
Light UX improvement.
2024-07-11 00:29:44 +02:00
Kawe Mazidjatari
69e88229c0 Recast: fix typo in comment 2024-07-10 20:38:15 +02:00
Kawe Mazidjatari
eff312acf5 Recast: fix dtRandomPointInConvexPoly (XZY -> XYZ)
Commit 11a827d54805b605a2500b4f6f13b8237bfffffd fixes 'dtNavMeshQuery::findRandomPoint' and 'dtNavMeshQuery::findRandomPointAroundCircle' never returning a poly as the vert indexing was inverted.

Although random positions are returned now, they are always either on a tile border, or a poly triangle.  This patch fixes the incorrect calculation of triangle area, and output position writing caused by a similar mixup of verts.
2024-07-10 20:36:24 +02:00
Kawe Mazidjatari
5cf3fd302f Recast: use the correct vertex order instead of flipping them
Instead of flipping them in dtNavMeshQuery::getPortalPoints, check them in the right order in dtNavMeshQuery::findStraightPath since other code depend on getPortalPoints's results not being flipped. Also fixed some types in comments.
2024-07-10 17:52:12 +02:00
Kawe Mazidjatari
63d85f0db5 Recast: some minor consistency changes
UI displays navmesh as NavMesh, changed it everywhere for consistency.
2024-07-10 11:13:06 +02:00
Kawe Mazidjatari
11a827d548 Recast: fix missed XZY -> XYZ conversions in dtNavMeshQuery
ZY needs to be flipped for YZ, previously the function would never find a poly as the reservoir sampler always failed (polyArea was always a large negative number).
2024-07-10 11:12:13 +02:00
Kawe Mazidjatari
df94ba0314 Recast: fix user interface bug
"Pathfind Sliced" was checking on the wrong member variable, and the check for enabling "Set Random End" and "Make Random Points Around" was inverted.
2024-07-10 11:09:30 +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
2f9908928c
Merge pull request #122 from Mauler125/recast_imgui_upgrade
Recast NavMesh editor ImGui upgrade
2024-07-09 20:19:26 +02:00
Kawe Mazidjatari
8f20326983 Recast: create a nice gradient background
Makes the application look more solid.
2024-07-09 20:15:54 +02:00
Kawe Mazidjatari
76ecbd8062 Recast: polish GUI layout
Make sure nothing clips outside the rects and make it look good.
2024-07-09 19:40:28 +02:00
Kawe Mazidjatari
42e2c8d309 Recast: fix level name truncation
Make sure the largest map name fits in the window.
2024-07-09 16:49:49 +02:00
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