188 Commits

Author SHA1 Message Date
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
Marvin D
4af22ede90 fix compilation. 2022-11-09 23:37:33 +01:00
Kawe Mazidjatari
8147431b0f Rename Detour_Free() to Detour_LevelShutdown()
Added the missing call to v_Detour_LevelInit(), which was removed for debugging purposes.
2022-11-05 00:11:17 +01:00
Kawe Mazidjatari
4bd164a535 NavMesh hot swap system improvements
* Check if server is active in command callback before attempting to hot swap.
* Hook 'v_Detour_LevelInit', and log NavMeshes that failed to load.
* Split free/destroy logic into separate function.
* Created constants for NavMesh and AI Network paths/extensions.
* Added performance profiler for hot swap logic in command callback.
* Renamed "navmesh_reload" to "navmesh_hotswap".
* "navmesh_hotswap" is now development only.
2022-11-03 17:12:22 +01:00
Kawe Mazidjatari
ba252c8e98 Implement logic for hot swapping NavMesh
The new command 'navmesh_reload' hot swaps the current NavMesh for all hulls in memory, with that of the 'new' files on the disk. The memory of the old NavMesh gets freed and destroyed.
2022-11-03 10:44:59 +01:00
Kawe Mazidjatari
f27ff874c2 Add hexadecimal prefix to NavMesh checksum debug 2022-11-03 02:24:04 +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
ad844269b8 Update ai_networkmanager.cpp 2022-10-20 12:29:49 +02:00
Kawe Mazidjatari
50fee7414d Missing material error logging
This commit implements missing material error logging.
When a material does not exist, it will get replaced with an error material, we log which material is missing, and with which error material it gets replaced with.
This commit also comes with some updates regarding the CMaterialGlue class, and some new types used by this class from the RePak project.
2022-10-13 02:22:50 +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
33e1795cf1 NavMesh util assert cleanup
Use actual array size for array access asserts.
2022-10-02 02:19:07 +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
Kawe Mazidjatari
cc26113c9e Implement debug draw AIN node links to nearest node
Feature can be toggled using the "ai_script_nodes_draw_nearest" cvar.
2022-09-28 00:14:33 +02:00
Kawe Mazidjatari
0b77621129 Add missing function dbg print 2022-09-21 21:07:43 +02:00
rexx
7d8d515190 add global text chat
use sv_forceChatToTeamOnly 0 to enable global chat
2022-09-18 20:42:16 +01:00
Kawe Mazidjatari
729475c74c Light cleanup
Use NO_ERROR instead of NULL for error code parameter passed to Error(..).
2022-09-14 01:14:51 +02:00
Kawe Mazidjatari
3d6d6644bd Logging bug fix and error handling improvements
* Replaced the boolean 'fatal' parameter with a error code parameter, anything non-null will prompt a message (fatal) and terminate the process with given error code.
* Fixed bug where the global ostreamsink for spdlog did NOT get cleared in 'SQVM_PrintFunc' when cvar 'sq_showvmoutput' was < 3. Moved to global scope.
* Added error message for when detouring the process has failed, with the error code.
* Only call 'Plat_GetProcessUpTime()' once per log, (improves performance and fixes bug where the error message box would show a different time stamp than what is logged into the console or file).
* All TIER0 loggers only log to notify and console when the SDK engine has fully initialized and detoured all functions.
2022-09-14 00:39:38 +02:00
Kawe Mazidjatari
34a06147d7 Fix spelling errors
Overall spelling improvements and cleanup..
2022-09-09 19:47:31 +02:00
Kawe Mazidjatari
c35829013e Change VFTavle indexes from read only to contant 2022-08-31 14:38:49 +02:00
Kawe Mazidjatari
1f41f3c9d0 Update ai_networkmanager.cpp 2022-08-31 12:49:48 +02:00
Kawe Mazidjatari
8dd7b70d61 Fixed small bug in DevMsg log from 'CAI_NetworkManager::LoadNetworkGraph()'
'(checksum: '0x%X' expected: '0x%X')': checksum was NavMesh, and expected is the nodegraph.
'checksum' should be the nodegraph crc (what we obtain from the AINet header), and expected should be the computed NavMesh crc, since we consider the AIN 'out of date' when its checksum doesn't match the NavMesh one.
2022-08-31 03:00:50 +02:00
Kawe Mazidjatari
cf5ab260da Improve spelling 2022-08-24 00:42:59 +02:00
Kawe Mazidjatari
6af5c7cdcf Use internal FileSystem for loading and handling
AIN files are now written to GAME dir, and the engine attempts to load the AI files from any GAME dir (search includes the VPK's).
2022-08-23 21:32:12 +02:00
Kawe Mazidjatari
5548a74d59 Major cleanup (see description)
* Fix all compiler error for GameSDK on S0 and S1.
* Remove some unused patterns and globals (launch performance gains of 100ms).
* Remove most duplicate patterns.
* Relocate globals from engine to a more appropriate location.
* Renamed some unknown vars to a more appropriate name (most of these where obtained a while back, but as we reversed more parts of the engine, some of these vars become known).
* Renamed some vars to fit the naming convention used in the SDK.
* Fixed pattern debug logging using the wrong pointer, thus displaying the wrong address.
2022-08-18 02:15:23 +02:00
Kawe Mazidjatari
52ee409f5f Use CIOStream for reading NavMesh and AIN files 2022-08-11 12:09:38 +02:00
Kawe Mazidjatari
88b3336758 Many small code improvements and optimizations
* Use c++ methods as much as possible.
* Use enum types for accessing NavMesh objects from array.
* Use size_t for for loops when testing against size types.
* Don't compute strlen twice of more on the same string.
* Don't use unnecessary c string casts if there is a method with a std::string overload.
* Don't create string objects from string pointers if we could use them directly.
* Don't initialize RCON password twice on each change, and don't set if the new password equals the old.
2022-08-11 11:07:45 +02:00
Kawe Mazidjatari
329621c6ad Move all public headers into root of 'public' 2022-08-09 17:18:07 +02:00
Kawe Mazidjatari
e92b5d1300 General cleanup
Use c++ methods, remove unnecessary casts, unnecessary use of auto, etc..
2022-08-09 15:19:12 +02:00
Kawe Mazidjatari
8c6ee8a834 Remove 'm' prefix from dll globals
Large commit.
2022-08-09 03:02:00 +02:00
Kawe Mazidjatari
9d06a02614 General cleanup
* Use Cbuf functions for executing commands in ImGui panels.
* Use const qualifiers for all vftable indexes.
2022-08-09 02:35:00 +02:00
Kawe Mazidjatari
93375d9a1f Improve NavMesh debug draw colors 2022-07-25 20:40:28 +02:00
Kawe Mazidjatari
086489a000 AIN/NavMesh debug draw improvements
* Move AIN/NavMesh debug draw to ai_utility_shared.cpp.
* Use shift index + range for AIN debug draw.
* Added cvar for determining max distance between camera and tile (anything outside this range doesn't get draw).
2022-07-25 16:39:07 +02:00
Kawe Mazidjatari
799dac882a Add 'MainViewOrigin()' and 'MainViewAngles()'
Implemented g_vecRenderOrigin and g_vecRenderAngles to SDK.
2022-07-25 12:46:57 +02:00
Kawe Mazidjatari
f314b9b4e7 Start of C_Player reversing 2022-07-24 12:59:40 +02:00
Kawe Mazidjatari
be42e98197 CAI_NetworkBuilder::SaveNetworkGraph improvements 2022-07-20 21:06:19 +02:00
Kawe Mazidjatari
5486923f47 Improve CAI_NetworkBuilder::SaveNetworkGraph
* Use proper format specifier for short.
* Remove redundant IsBadReadPtrV2 call when writing script nodes (this was initially for debugging but hasn't been removed after development finished).
2022-07-20 16:22:03 +02:00
Kawe Mazidjatari
bd0edc663d Add 'g_pHullMasks' into SDK
Static array of hull masks
2022-07-20 12:33:39 +02:00
Kawe Mazidjatari
59dd3e2228 NavMesh system improvements
* Confirmed DT_MAX_AREAS size being 32 (originally 64).
* header->offMeshEnds to -1.
* Added pointer to 'g_pHullMask'.
2022-07-19 22:00:40 +02:00
Kawe Mazidjatari
0026723aef Add g_pNavMeshQuery signature to SDK 2022-07-17 12:55:38 +02:00
Kawe Mazidjatari
c79cfa4968 Declare GetNavMeshForHull() 2022-07-13 11:44:38 +02:00
Kawe Mazidjatari
2dd66662b2 Add g_pNavMesh to SDK
Add g_pNavMesh to SDK and a simple wrapper for obtaining NavMesh from array.
2022-07-13 11:42:07 +02:00