4236 Commits

Author SHA1 Message Date
Kawe Mazidjatari
9462564761 Recast: check for poly intersection before creating traverse link
Don't generate if it intersects its own poly. Make sure it only links gaps.
2024-08-09 17:34:34 +02:00
Kawe Mazidjatari
52403f5161 Recast: fix typo (XZY -> XYZ)
Height axis = Z.
2024-08-09 17:32:55 +02:00
Kawe Mazidjatari
be69a8b533 Recast: make sure we always have 2 links before creating a traverse link
Need at least 2 links, one for the reverse link. Not adhering to this results in NULL reverse links which causes incorrect behavior in the renderer and in-game.
2024-08-09 16:11:26 +02:00
Kawe Mazidjatari
3ff36addbd Recast: clean up traverse link builder
Use existing math wrappers.
2024-08-09 14:41:16 +02:00
Kawe Mazidjatari
b63cb1d52c Recast: improve naming consistency for the traverse system
Traversal and traverse were mixed in variable/function naming. Forced consistency. No logic was changed this patch.
2024-08-09 14:35:47 +02:00
Kawe Mazidjatari
7cacc8ee03 Recast: fix static pathing build order
Traverse links should be build after the disjoint poly groups are created, but before the traverse tables are created. Previously, we created traverse links before disjoint poly groups causing isolated poly islands to be grouped under the same id.
2024-08-09 14:22:07 +02:00
Kawe Mazidjatari
d5ddaf3313 Recast: hook up traverse link dumper 2024-08-09 14:20:04 +02:00
Kawe Mazidjatari
c63061419a Recast: add ability to dump traverse link details
Detour dump utilities.
2024-08-09 14:18:33 +02:00
Kawe Mazidjatari
35b465d6c6 Recast: don't link poly edges facing the same direction
Only link them if they are perpendicular or facing the opposite direction.
2024-08-09 14:07:50 +02:00
Kawe Mazidjatari
1a393e6330 Recast: add helper function to calculate slope angle from 2 points 2024-08-09 12:49:11 +02:00
Kawe Mazidjatari
24e09b4b6c Recast: use edge mid point for distance calculation
Use the mid point which is the correct approach.
2024-08-09 12:48:05 +02:00
Kawe Mazidjatari
51eac9c91c Recast: add option to filter traverse links by distance 2024-08-08 19:52:28 +02:00
Kawe Mazidjatari
acaf4cf32b Recast: initial working implementation of traverse link generation algorithm
Traversing now works in-game, but there's still work needed to polish the algorithm and creating a proper lookup for jump types as currently only 1 jump type is supported.
2024-08-08 17:44:27 +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
Kawe Mazidjatari
c4ac63ed69 Server: disable view punch by default
View punch on player in Hip is also disabled in retail apparently. Reflect behavior in SDK.
2024-08-08 14:32:21 +02:00
Kawe Mazidjatari
55c230aab8 Recast: remove jumpType from off-mesh links
Probably incorrect for MSET 5, null it.
2024-08-08 11:59:24 +02:00
Kawe Mazidjatari
848fbabc79 Recast: simplify quantization 2024-08-08 01:33:27 +02:00
Kawe Mazidjatari
deb59074c1 Server: only disable view punch during aim by default 2024-08-07 17:35:29 +02:00
Kawe Mazidjatari
ffb8c5992d Server: add cvar that allows enabling/disabling view punch when taking damage 2024-08-07 13:01:50 +02:00
Kawe Mazidjatari
907e0fd8bc Recast: simplify default navmesh render options
Show a clean renderer of the navmesh, toggle higher details off by default for performance and clarity on larger scale maps.
2024-08-07 12:02:58 +02:00
Kawe Mazidjatari
8cfce5ea9a Client: cleanup and optimize C_Player::CurveLook
Don't call C_BaseCombatCharacter::GetActiveWeapon twice.
2024-08-06 20:30:07 +02:00
Kawe Mazidjatari
2348a2dc61 Client: make C_WeaponX::HasTargetZoomFOV() const 2024-08-06 20:29:16 +02:00
Kawe Mazidjatari
07fd1cef8e Client: add method to check if weapon is melee 2024-08-06 20:28:52 +02:00
Kawe Mazidjatari
2914027574 Client: fix aim magnet bug and several other issues with CurveLook
The decompile of this function was still incorrect, after looking at the raw disassembly, bool v36 and bool v35 are now set correctly. Also, a float was never set and the decompiler assigned a local to an incorrect one for some math that was supposed to set the inputSampleFrametime, causing it to work as a counter magnet when target compensation was activated. This now also has been set correctly according to the assembly of the function itself, and now works as intended. So far, all bugs appear to be fixed in this function, its pending tests by users.
2024-08-06 00:59:59 +02:00
Kawe Mazidjatari
886f1c6a53 Client: fix numerous issues with CurveLook rebuild
Fix incorrect type for g_aimCurveConfig, its a static array, so it needs to be a single pointer not a double. Also fixed several blocks inside CurveLook that did not match the assembly code of the game. The aim-assist code is still broken however, pending research.
2024-08-05 20:06:26 +02:00
Kawe Mazidjatari
08a69db020 Client: fix nullptr deref crash when auto aim is enabled 2024-08-05 02:09:03 +02:00
Kawe Mazidjatari
f8331d7ac7 Client: only run ADS per-optic when zoomed in
Should only fire this code when zoomed in.
2024-08-05 01:42:24 +02:00
Kawe Mazidjatari
d95d071afd Tier1: properly implement ConVar change callbacks
Change callbacks actually take a structure of 2 pointers, one being for the callback itself, and the other being 'userdata' which typically is used to sync the ConVar with VGUI slider elements. This issue was noticed after implementing the ADS scalars and attempting to hook them up to VGUI, only to find out it would crash due to this lacking detail. All change callback prototypes had to be adjusted.
2024-08-05 00:45:30 +02:00
Kawe Mazidjatari
2fd2873536 Client: properly clamp gamepad ads scalars 2024-08-05 00:39:40 +02:00
Kawe Mazidjatari
704498aecb Client: add per-optic sensitivity scalars to CurveLook
Implemented by popular demand. Allows setting different sensitivity values per optic zoom level on a weapon. The mouse input handler already had this, but the controller one didn't so it had to be implemented here.
2024-08-04 17:28:33 +02:00
Kawe Mazidjatari
c4098054fa Engine: rename CGlobalVarsBase
Might still not be fully correct, but its definitely more correct now.
2024-08-04 17:26:44 +02:00
Kawe Mazidjatari
f9eb989b3b Game: add method for calculating zoom FOV interp 2024-08-04 17:25:38 +02:00
Kawe Mazidjatari
bfdf601d0d Client: add note, cleanup curve look code and enable it
So far tested, works correctly. Pending test by community.
2024-08-04 14:59:57 +02:00
Kawe Mazidjatari
d298ad0c22 Client: initial rebuild of the curve look function
This function didn't decompile properly, so a bunch of manual assembly work had to be used to reconstruct the truncated bits. The code does work correct for the most part. The call to the subroutine 'sub_1405AD760' has been commented as the parameter appears incorrect; passes in the address of a bool but indexes 4 bytes outside the size of a bool. Most likely incorrect decompile/disasm. Currently being investigated.
2024-08-04 14:12:15 +02:00
Kawe Mazidjatari
74a58b2fd4 InputSystem: return the correct type on IInput::GetUserCmd()
Should return the extended class.
2024-08-03 15:19:31 +02:00
Kawe Mazidjatari
06ea5773d7 Game: rename header file for consistency
C_Player is not a base class.
2024-08-03 15:18:44 +02:00
Kawe Mazidjatari
6715c25b37 Client: add reversed C_WeaponX class
Partially reversed.
2024-08-03 14:21:11 +02:00
Kawe Mazidjatari
877d0f082f Tier0: make logger mutex static
There is no need to make this globally accessible.
2024-08-03 12:17:44 +02:00
Kawe Mazidjatari
55754adaa9 Tier0: use CThreadMutex instead for CFrameTask
Use the cirical_section based implementation instead of STD Mutex.
2024-08-03 12:12:00 +02:00
Kawe Mazidjatari
5223ac8631 RTech: refactor playlists reloading/caching
Mutex is technically no longer needed as imgui now draws in main and gets buffer swapped / rendered in the render thread just like the rest of the game. But the mutex was still in because of the shared script function 'Script_GetAvailablePlaylists' that can be used on the server. Both the 'playlist_reload' and 'downloadPlaylists' commands will now join the active server job if ran to prevent crashing in the engine or sdk when ran during the game.

There was also a performance difference between 'playlist_reload' and 'downloadPlaylists' while the commands are identical. There was a bug where the 'playlist_reload' one called 'Playlists_SDKInit' twice. This has also been fixed in this commit.
2024-08-03 12:06:42 +02:00
Kawe Mazidjatari
77b6c2256e NetCon: use CThreadMutex instead 2024-08-03 11:11:57 +02:00
Kawe Mazidjatari
d9adce6448 Tier1: use CThreadMutex instead of CThreadFastMutex for CKeyValuesSystem
The class uses CThreadMutex in the engine. Adjust type accordingly.
2024-08-03 11:07:59 +02:00
Kawe Mazidjatari
1e667c8f30 Engine: use CThreadMutex for installed maps global
Use the type used by the engine instead of STD.
2024-08-03 11:03:39 +02:00
Kawe Mazidjatari
93eb3ab3a3 Tier1: make CDepthCounter::Get const 2024-08-03 11:02:21 +02:00
Kawe Mazidjatari
510fb27392 Tier0: make clock speed singleton static
Improve CFastTimer's performance.
2024-08-01 12:39:34 +02:00
Kawe Mazidjatari
0f7e7d2825 Curl: fix CVE-2024-7264
Merge: curl/curl@27959ecce7
2024-08-01 12:07:46 +02:00
Kawe Mazidjatari
90aa3a7bde Game: fix compile error
Invalid EHandles are always -1. INVALID_EHANDLE tag has been removed in commit 084f94aefd23e250f30f700acbe7cce343d78b75.
2024-07-31 22:39:44 +02:00
Kawe Mazidjatari
1c2c61a397 Engine: fix compile error
Preprocessor directive should've been used on newly added CHLClient::Init + fixed missing include.
2024-07-31 22:38:44 +02:00
Kawe Mazidjatari
2dcc849e2d Recast: fix compile error
Editor::loadNavMesh was never declared in the class.
2024-07-31 22:38:02 +02:00