57 Commits

Author SHA1 Message Date
Kawe Mazidjatari
b8035120de Assign unused constructor parameter 2023-04-16 01:23:38 +02:00
Kawe Mazidjatari
4079956356 Fix non-portable include paths
Portable include paths are case sensitive.
2023-04-08 18:52:33 +02:00
Kawe Mazidjatari
b0d2665550 /W4: Fix compiler compatibility
Clang doesn't support function-style casts with types containing a space.
2023-04-02 17:34:42 +02:00
Kawe Mazidjatari
4e7693bae6 /W4: Fix name shadowing warnings 2023-04-02 17:25:18 +02:00
Kawe Mazidjatari
42b3e49840 /W4: Properly pack server animation structures
Manually add fields to align structure properly. This suppresses many pesky compiler warnings.
2023-04-02 17:19:13 +02:00
Kawe Mazidjatari
a4a2f34c10 /W4: Fix signed/unsigned mismatch
This commit fixes warnings and bugs caused by signed/unsigned mismatch.
2023-04-02 12:09:43 +02:00
Kawe Mazidjatari
e9fac084fe Fix struct -> class compiler warning
'dtMeshTile' is defined as struct, but declared as class, causing a compiler warning. Fixed by declaring it as struct.
2023-04-02 01:23:07 +02:00
Kawe Mazidjatari
69624baa10 NavMesh debug draw code refactor
* Use mathlib SIMD wrappers instead, this is to maintain compatibility across different platforms/compilers.
* Moved camera distance logic to separate method.
2023-04-01 20:54:10 +02:00
Kawe Mazidjatari
f2d1b9e643 Fix crash caused by returning unsigned values
Function returned '-1' as 'ULONG_MAX'. This patch fixes this problem while suppressing compiler warnings.
2023-04-01 17:39:22 +02:00
Kawe Mazidjatari
371e15db41 Fix many verbose compiler warnings
Many compiler warnings regarding implicit conversions.
2023-03-18 16:45:43 +01:00
Kawe Mazidjatari
0b85476011 Belongs to the previous commit 2023-02-13 23:47:12 +01:00
Kawe Mazidjatari
b1f2f47058 Update names across codebase 2023-02-12 15:06:08 +01:00
Kawe Mazidjatari
918535ff0f Fix crash during bots simulation
Wrong ptr to 'CUserCmd::Reset'.
2023-01-31 00:03:40 +01:00
Amos
d76ed1098a Improve VFTable address logging
More standardized VFTable address logging.
2023-01-25 11:19:53 +01:00
Kawe Mazidjatari
a618990937 Detour code refactor
This change was planned for a long time. This moves all REGISTER calls to a single translation unit, this is required as we currently added a very dirty workaround for not registering duplicates by checking if VFTable pointer was already present in the vector... Registering from single translation unit prevents duplicate instances that gets created if header is included by more cpp files.
Reworking this reduced 100kb+ of compiled code. This commit also reworked the way functions/variables/constant gets logged with their addresses; the new code formats them on the fly, and allows for resize at any time. Formatting is no longer required by programmer.

TODO: currently there are some compile errors for dedicated and client dll's. These will be resolved very soon as they need to be properly worked out still (server & client only stuff needs to be properly split). Use the 'main' (stable) branch for the time being if you need to compile these dll's.
2023-01-25 02:26:52 +01:00
Kawe Mazidjatari
19447f1122 Improve debug draw depth test toggle logic
* Add box depth test cvar from engine for 'CBaseAnimating::DrawServerHitboxes'.
* Use noDepthTest field from OverlayBox_t instead of the cvar.
2023-01-24 12:05:09 +01:00
Kawe Mazidjatari
66ef9fb6a0 Fix crash in hitbox drawing code and light restructure
* Fix null pointer dereference crash in server hitbox drawing code; implemented a proper getter for CStudioHdr.
* Moved 'baseentity.h/cpp' to 'game/server/' instead.
* Overall light cleanup.
2023-01-23 23:21:29 +01:00
Kawe Mazidjatari
502a1d2324 Switch box overlay transform type to 'matrix3x4_t'
Actual type turned out to be 'matrix3x4_t' after further reverse engineering.
2023-01-23 02:20:21 +01:00
Kawe Mazidjatari
07ef57536d Add modelinfo vftable pointers 2023-01-22 16:48:16 +01:00
Kawe Mazidjatari
4b5d24a51f Fix trace filter shadow bug
Shadow: VFTable was never set.
2023-01-22 13:05:26 +01:00
Kawe Mazidjatari
d7f3209525 Mapped out hit group standards
Mapped out from Squirrel code.
2023-01-22 12:06:05 +01:00
Kawe Mazidjatari
15429d3f8f Add 'CTraceFilterSimple' to SDK 2023-01-21 16:22:16 +01:00
Kawe Mazidjatari
eff106e415 Improve CCollisionProperty
Set 'm_pOuter' to CBaseEntity*.
2023-01-21 16:18:12 +01:00
Kawe Mazidjatari
9720d8b0f1 Fix 'g_pGlobals' and 'UTIL_PlayerByIndex()'
'UTIL_PlayerByIndex' now returns the player from the edict array properly, 'g_pGlobals' had to be dereferenced twice.
2023-01-20 14:07:25 +01:00
Kawe Mazidjatari
4710b51fa3 Experimental bot simulation implementation
Simulate bot user commands on the server. The simulation system is experimental and only runs if cvar 'sv_simulateBots' is set, and bots are created on the server.
2023-01-20 01:23:08 +01:00
Kawe Mazidjatari
dcf05a0adf CClientEntityList reversal
Slightly reversed CClientEntityList while looking around its singleton.
2023-01-20 00:28:49 +01:00
Kawe Mazidjatari
119bd9ae61 CUserCmd improvements
* Adjust structure size to that of the implementation in the S3 executable.
* Added copy method (copies a source usercmd into current).
2023-01-19 20:45:59 +01:00
Kawe Mazidjatari
754c986e3d Add server movehelper to SDK
Initial implementation of server movehelper. IMoveHelper interface class is fully reversed and aligns with implementation in engine. CMoveHelperServer is also reversed, excect for CGameTrace, though this isn't necessary for now.
2023-01-19 18:52:46 +01:00
Kawe Mazidjatari
afe8efbc2a Add CUserCmd class to SDK
Implemented CUserCmd to SDK. Constructor resets the class using the game's 'Reset' implementation as the majority of the structure is unknown.
2023-01-19 16:11:48 +01:00
Kawe Mazidjatari
54f08bd887 Work-in-progress user command executor
* Added some getters in 'CBaseEntity' and 'CServerNetworkProperty'.
* Implemented 'CPlayer::SetTimeBase'.
* WIP implementation of 'CPlayer::RunNullCommand'.
2023-01-19 15:25:45 +01:00
Kawe Mazidjatari
1cf03355a5 Light cleanup and work for future
Moved some structures around and added ehandle headers.
2023-01-19 02:03:36 +01:00
Kawe Mazidjatari
c0d9d4462b Improve CAnimationLayer
Field 'm_animationLayerOwner' is CBaseEntity*.
2023-01-19 01:59:11 +01:00
Amos
b63765e1dc Finished CPlayer inheritance 2023-01-18 12:39:18 +01:00
Kawe Mazidjatari
3ed423543e Add more entity structures to the SDK
Stuff will be separated properly very soon.
2023-01-18 01:34:40 +01:00
Kawe Mazidjatari
217bbc8ea1 Add new work-in-progress entity structures to SDK
Thanks to rexx for the structures.
2023-01-18 00:46:17 +01:00
Kawe Mazidjatari
2501c37044 Globally convert all byte patterns to strings
These get reconverted to masked byte patterns at runtime. With the signature map cache system, this will only happen when building the cache.
2022-12-01 22:44:55 +01:00
Kawe Mazidjatari
4bf0e2f544 Add camera range culling logic to 'CAI_Utility::DrawAIScriptNetwork'
Uses the same camera range cvar used by the NavMesh renderer: 'navmesh_debug_camera_range'. This allows for rendering them nicely on top of the NavMesh.
2022-11-17 20:49:23 +01:00
Marvin D
d00aaa933d CRenderView init, GetWorldMatrixForView()
* Fixed .gitignore for root /game/
* Fixed bug in WalkVTable where it would offset self.
* General clean up: VAR -> CON, CON -> VAR
2022-11-10 00:53:12 +01:00
Kawe Mazidjatari
b5b56c83ea CAI_Utility::DrawAIScriptNetwork: light cleanup 2022-10-24 00:52:32 +02:00
Kawe Mazidjatari
0f920ff602 Update comment in CAI_Utility::DrawNavMeshBVTree 2022-10-21 21:27:37 +02:00
Kawe Mazidjatari
530b645a4d Additional AI Network render optimizations
* Make box's mins and maxs static const.
* Use SSE to pack 4 indices into 1 128bit register, and shuffle to prevent duplication. Only 2 indices are used at the moment.
2022-10-11 01:20:59 +02:00
Kawe Mazidjatari
70153d209c Additional NavMesh debug draw optimizations
* Init vCamera once during call (MainViewOrigin() won't change during the execution of this function).
* Construct Vector3D for camera distance only once, using SIMD.
2022-10-05 00:55:29 +02:00
Kawe Mazidjatari
31903be52e Use Hungarian notation throughout rest of the file
For consistency, we use Hungarian notation.
2022-10-04 23:00:33 +02:00
Kawe Mazidjatari
036d2e8e80 CAI_Utility::DrawAIScriptNetwork: light cleanup 2022-10-03 01:15:29 +02:00
Kawe Mazidjatari
dbc47f81aa CAI_Utility: only check ConVar's once a frame
Obtain values of ConVar once a frame instead of checking within loop. There is no point changing the values while we are rendering. Thi sshould increase performance when drawing larger NavMeshes.
2022-10-01 00:25:21 +02:00
Kawe Mazidjatari
69491acb49 Additional NavMesh draw optimizations using SIMD
* Construct min/max for AI Script Network boxes using SIMD (significantly reduced instruction count!).
* Move NavMesh debug draw to dedicated class for future changes.
2022-09-30 01:16:26 +02:00
Kawe Mazidjatari
e111587dd7 Utilize SIMD for 'DrawNavMeshPortals'
* Use SIMD to construct vertices into single XMM register.
* Use SIMD to construct origin and destination vectors from vertices.
* Deref 'navmesh_debug_camera_range' only once outside the render loop.
* Light code cleanup.
2022-09-29 22:26:27 +02:00
Kawe Mazidjatari
f06c9a01e2 Utilize SIMD for 'DrawNavMeshPolys'
* Use SIMD to construct a Vector3D in a single instruction, instead of setting the vector fields individually.
* Store ConVar value as const bool outside loop.
* Slightly improved variable naming.
2022-09-29 20:14:39 +02:00
Kawe Mazidjatari
a6a44feb4d More NavMesh visualization SIMD optimizations
Use SIMD to construct Vector3D's for the BVTree's min/max.
2022-09-29 15:59:48 +02:00
Kawe Mazidjatari
2df13ecdfc NavMesh optimizations
Use SSE for subtraction of origin scalars
2022-09-29 10:59:27 +02:00