Commit Graph
5435 Commits
Author SHA1 Message Date
Kawe Mazidjatari 9ad1cae791 Thirdparty: fix Detours system DLL memory avoidance when ASLR is disabled
Some users reported issues with the game no longer launching if operated on a system with ASLR disabled. This patch takes these scenarios into account. We should not look for ASLR address space if ASLR is disabled as this will fail.
2025-05-22 14:28:09 +02:00
Kawe Mazidjatari e1bc098a70 Resource: update NavMesh build script
Updated to use the Recast project files instead now, and added newly shipped maps.
2025-05-21 18:09:48 +02:00
Kawe Mazidjatari 4547884a30 Resource: add RPak build script
Script for RPak build automation.
2025-05-21 18:08:02 +02:00
Kawe Mazidjatari d45c792dcd Resource: update VPK build script
Updated to reflect new changes in commit 7acac73432, and added newly shipped maps.
2025-05-21 18:07:34 +02:00
Kawe Mazidjatari 7acac73432 ReVPK: improve command line interface
Use '-' prefix for consistency with the rest of the tools and code base. Also slightly improved usage guide print.
2025-05-21 17:56:00 +02:00
Kawe Mazidjatari e7210b7107 Resource: enable rui_codeAsserts by default on dev
Enabled by default on development configurations.
2025-05-17 23:22:23 +02:00
Kawe Mazidjatari c2765e1f0c RTech: disable rui_codeAsserts by default
Can get verbose on level changes.
2025-05-17 23:19:12 +02:00
Kawe Mazidjatari eb9cd4be24 RTech: implement code assertion handler for Rui library
The Rui library contains assertions but if they fail they never get logged anywhere. Implemented handler that will log it to the console if cvar `rui_codeAsserts` is set (enabled by default because these are very rare/never happen and we should catch and fix them at all times).
2025-05-17 18:10:22 +02:00
Kawe Mazidjatari cc2e24cf57 Engine: fix incorrect member order for clock drift mgr tick counts
Server tick comes before Client tick. Server tick is at 0x8C while Client tick is at 0x90.
2025-05-17 18:03:27 +02:00
Kawe Mazidjatari 3ed1b67663 Recast: make application background uniform
Make it uniform until an artificial horizon or skybox variant is implemented.
2025-05-14 20:37:15 +02:00
Kawe Mazidjatari 7991c2e18d Recast: fix typo in comment 2025-05-14 20:30:08 +02:00
Kawe Mazidjatari 6f106998bc RTech: rename array manager class
Its not a hash map but a fixed array manager.
2025-05-14 20:29:49 +02:00
Kawe Mazidjatari 2e1f967bf8 Resource: properly fix the HUD scaling regression
This fixes every overlay (including the VGui sprite animations for the SRAM rocket launcher). This is the correct way of fixing the function as it was clearly not updated to match the new changes unlike Hud_SetScaleX() and Hud_SetScaleY().
2025-05-11 13:57:50 +02:00
Kawe Mazidjatari 9a73a944ad Common: cmd "weapon_reparse" should be FCVAR_GAMEDLL for dedicated
If sv_cheats is 1 and we run "weapon_reparse" on the client, the client will forward this command to the server as well so the server could reload its weapon scripts and be in-sync. However this command did not have the proper flags for this to function. Dedicated builds now have the right flags for this command, it now functions as intended.
2025-05-10 15:32:17 +02:00
Kawe Mazidjatari 5d05b1d7ab Recast: minor optimization for dtUpdateNavMeshData()
The std::set::insert() call already deals with finding the entry, we only have to check if we inserted it or not.
2025-05-10 15:30:01 +02:00
Kawe Mazidjatari 3e9e45e6b2 Resource: fix rare crash if we run out of tracing slots
We should return with the result -1 instead of executing the rest of the code because a slot idx of -1 is invalid and our structure pointer will be NULL. Very rare crash but it has happened a few times since the initial release of this project!
2025-05-10 14:42:58 +02:00
Kawe Mazidjatari dcc4cf7831 Tier0: bump SDK version 2025-05-09 16:42:17 +02:00
Kawe Mazidjatari e6b7c62454 Resource: fix smart weapon overlays regression
Engine bug that was caused after a refactor of the HUD system. The scalars were set to a child object instead of the root structure which is what Hud_SetScale() expects. Reworked the assembly code and the overlays now draw properly on the smart pistol and rocket launcher.
2025-05-09 16:41:18 +02:00
Kawe Mazidjatari df4e182160 Engine: fix crash when using IVEngineClient VFTable
g_pEngineClient is an interface only class (does not contain any members), however it was pointing directly to the vftable instead of to a pointer to a vftable, therefore, using its vftable would cause a crash or otherwise undefined behavior. Changed initialization to point to the pointer to the vftable instead to yield correct behavior.
2025-05-09 11:22:43 +02:00
Kawe Mazidjatari b9f1af341e Resource: improve instruction encoding for tex stream mgr patch
All 3 elements are of type i32, set dword instead of qword wide; reduces stack frame with 2 bytes and ensures we do not write past our array. Also fixed a type in a comment.
2025-05-09 01:35:35 +02:00
Kawe Mazidjatari 6fe852f51f MaterialSystem: fix alphasort world textures not streaming when GPU driven
When using the gpu driven texture streaming system, alphasort world textures wouldn't stream because the compute shader was never executed during the alphasort render pass. The system has been modified to accomodate for the 3rd render pass, and the compute shaders now gets executed when alphasort gets rendered. Translucent materials now appear correct and stream in properly on all levels.
2025-05-08 16:55:15 +02:00
Kawe Mazidjatari d05db5bb92 Resource: fix texture streaming crash on 'all' mode
A code path was missed during the static texture array increase; r15 was set to module base but should've been set to the address of our new static texture array. The crash occurs when setting the cvar `stream_mode` to "all". After this change, all stream modes work as intended. This is so far the only issue that has encountered after increasing the array in commit 4de8a7d8ae.
2025-05-08 12:41:33 +02:00
Kawe Mazidjatari 07cf3fca0b BanSystem: rework and improve banned list format
The JSON root is now an array of objects, instead of an object with enumerated objects who's total size was controlled by another field name. This significantly simplifies the file format and parsing code. Also added a object type check for each ban entry to make sure we don't process faulty entries; these get reported to the console as a warning.
2025-05-07 14:40:32 +02:00
Kawe Mazidjatari 062da45499 BanSystem: allocate buffer of optimal read size and handle unicode files
Use an optimal read size for buffer size, and allocate enough to allow null-terminating unicode files as well in case we encounter one.
2025-05-07 14:31:54 +02:00
Kawe Mazidjatari 16e8ad8f79 RTech: allocate buffer of optimal read size and handle unicode files
Use an optimal read size for buffer size, and allocate enough to allow null-terminating unicode files as well in case we encounter one.
2025-05-07 14:26:16 +02:00
Kawe Mazidjatari 83b4460c79 Tier1: allocate buffer of optimal read size and handle unicode files
Use an optimal read size for buffer size, and allocate enough to allow null-terminating unicode files as well in case we encounter one.
2025-05-07 14:25:41 +02:00
Kawe Mazidjatari a0c93d410e Tier1: fix resource leak in KeyValues::LoadFromFile()
Resource leak if file is empty as the handle was never closed. filesystem->Size() can also return <0, so we need to check for that as well.
2025-05-07 13:59:00 +02:00
Kawe Mazidjatari 687ac01c59 FileSystem: implement GetOptimalReadSize()
Simple helper for optimimal filesystem reads.
2025-05-07 13:56:35 +02:00
Kawe Mazidjatari c387b6854e FileSystem: fix prototype for AllocOptimalReadBuffer()
The prototype was incorrect; filesystem_std now also implements a minimal version AllocOptimalReadBuffer() and FreeOptimalReadBuffer().
2025-05-07 13:55:31 +02:00
Kawe Mazidjatari 1ef40e7d51 VpkLib: improve debug logging formatting 2025-05-07 11:52:07 +02:00
Kawe Mazidjatari d40d413871 RTech: improve debug logging formatting 2025-05-07 11:50:57 +02:00
Kawe Mazidjatari d426d1d57b Recast: improve debug logging formatting 2025-05-07 11:48:14 +02:00
Kawe Mazidjatari 77a6c7fdba ReVPK: improve debug logging formatting 2025-05-07 11:47:54 +02:00
Kawe Mazidjatari dcf659facb Server: improve debug logging formatting 2025-05-07 11:47:33 +02:00
Kawe Mazidjatari 8c47399aa8 FileSystem: improve debug logging formatting 2025-05-07 11:46:57 +02:00
Kawe Mazidjatari cf7e645d18 Common: improve debug logging formatting 2025-05-07 11:46:40 +02:00
Kawe Mazidjatari ee05ebd1c3 Miles: improve debug logging formatting 2025-05-07 11:46:27 +02:00
Kawe Mazidjatari 20c3803a51 Engine: improve debug logging formatting 2025-05-07 11:46:10 +02:00
Kawe Mazidjatari a0b540c247 Loader: remove extraneous statics for NtCurrentPeb()
NtCurrentPeb() is extremely cheap, no need to cache the pointers off.
2025-05-06 19:51:40 +02:00
Kawe Mazidjatari 46e1414550 Launcher: adjust parameter builder for -norandomkey
Use the new -norandomkey command line argument introduced in 53c104670c.
2025-05-06 19:48:19 +02:00
Kawe Mazidjatari 360d3f153d Resource: adjust development autoexec for -norandomkey
Use the new -norandomkey command line argument introduced in 53c104670c.
2025-05-06 19:47:20 +02:00
Kawe Mazidjatari 53c104670c Engine: create dedicated command line argument to disable random net keys
The net key is configured before the first Cbuf_Execute() call is fired, this results in the key getting configured twice when using  `+net_useRandomKey <val>` over the command line. Make a dedicated command line argument (`-norandomkey`) to fix this problem.
2025-05-06 19:29:07 +02:00
Kawe Mazidjatari 1ff08210de Miles: fix regression when selecting Mandarin language
The game is supposed to load the Mandarin streaming source file when schinese or tchinese is selected, however this didn't happen as the game's language is handled slightly different. Load mandaring streaming source files when either of the 2 languages are selected as these files contain the required audio for both. Fixes the issue where Mandarin audio couldn't be used when using schinese or tchinese language.
2025-05-06 19:24:52 +02:00
Kawe Mazidjatari f5c760aafb PluginSDK: function PluginSDK_LoggerSink() can be static 2025-05-05 00:04:03 +02:00
Kawe Mazidjatari c83ba30ce9 Loader: fix declaration regression
DllMain() cannot be static.
2025-05-04 12:23:37 +02:00
Kawe Mazidjatari 0937d65681 Loader: move assert to Loader_FatalError()
Make sure we always assert in case of an error.
2025-05-04 12:12:12 +02:00
Kawe Mazidjatari f724d04e9b Loader: add error for when process module name couldn't be retrieved
Very rare edge case, but error here as well in case it does happens.
2025-05-04 12:10:15 +02:00
Kawe Mazidjatari df4b388798 Loader: improve SDK load failure prints
Make it more specific.
2025-05-04 12:08:45 +02:00
Kawe Mazidjatari 66dfebe0d2 Loader: minor code cleanup
- Use static where possible.
- Use const where possible.
- Make symbol naming consistent with the rest of the SDK.
2025-05-04 12:05:21 +02:00
Kawe Mazidjatari ad3c5516a2 Engine: normalize slashes in Mod_FormatPakPath()
Small consistency improvement; FS_OpenAsyncFile directly interfaces with the OS file system API, which technically expects normalized slashes.
2025-05-04 01:50:35 +02:00