668 Commits

Author SHA1 Message Date
Kawe Mazidjatari
a23c0b1ba9 Merge branch 'indev' of https://github.com/Mauler125/r5sdk into indev 2022-05-01 21:09:06 +02:00
Kawe Mazidjatari
8ad4350f9f Improved BuildPropStaticFrustumCullMap
* Fixed bug where the address of g_pStaticPropMgr wasn't properly dereferenced and passed to function via its reference (engine addr).
* Fixed dword dereference.

Problems: engine still culls models improperly.
2022-05-01 21:09:05 +02:00
PixieCore
83048e856c Removed debug code. 2022-05-01 20:58:24 +02:00
PixieCore
51ace16074 Fix CBaseClientState pointer vars. 2022-05-01 20:57:08 +02:00
Kawe Mazidjatari
4877666fe9 Update bsplib.cpp 2022-05-01 18:00:15 +02:00
Kawe Mazidjatari
f036f2cc44 BuildPropStaticFrustumCullMap optimizations 2022-05-01 17:59:56 +02:00
Kawe Mazidjatari
a479b4ac78 See description
Fixed rare crash in CMDLCache when buffer itteration returns invalid pointer (not null!) for handle.

Made all variables and functions used by BuildPropStaticFrustumCullMap searched dynamically (these should also work on s0, s1 and s2, they are compared but at the moment untested).

TODO: Fix deref crash properly (see bsplib.cpp l291).
2022-05-01 05:38:51 +02:00
Kawe Mazidjatari
f8f2ce6fa4 Initial working implementation of frustum building in SDK 2022-05-01 01:32:23 +02:00
Kawe Mazidjatari
4ead3ab1c9 Fix rare crash
This crash happens when the BSP is missing a lot of shaders and materials.
The call originates from 'R_DrawWorldMeshesDepthOnly()', but it is unclear which missing shader is causing the nullptr.  checking for a nullptr here should be sufficient to deal with this kind of missing shader
2022-04-30 20:35:08 +02:00
Kawe Mazidjatari
a4314b1c37 Add to other project 2022-04-30 19:05:56 +02:00
Kawe Mazidjatari
7dd107916c Fix rare crash
Rare crash when the sqvm tries to look for an animation sequence on a missing prop_dynamic model (mdl/error.rmdl doesn't support animations), its purely to indicate there is a problem).
2022-04-30 18:59:55 +02:00
Kawe Mazidjatari
97fb3fd8d4 Also lock the upgrade error behind already known bad model handles
Reduce console verbosity
2022-04-30 05:06:59 +02:00
Kawe Mazidjatari
a496254b93 Add mutex for CMDLCache methods
Als fall back to old GatherProps when at least one model is replaced with mdl/error.rmdl as the new GatherProps function does not support this yet.
2022-04-30 03:30:16 +02:00
PixieCore
73dd49e8d1 Start processing of unknown commands print.
* UserMessages need to be properly read like in sub_14028E890
* Started building bf_read
* Clean up will follow later.
2022-04-30 03:00:24 +02:00
Kawe Mazidjatari
1bf7b96641 Only print out missing models once
Don't print duplicated
2022-04-29 22:46:37 +02:00
Kawe Mazidjatari
7441bf156b Return proper studio hardware for mdl/error.rmdl
Now mdl/error.rmdl draws properly
2022-04-29 22:11:35 +02:00
Kawe Mazidjatari
192f9b4a9b Fixup pattern for P_DrawWorldMeshes 2022-04-29 22:07:30 +02:00
Kawe Mazidjatari
d569d58378 Made missing model error handling more robust 2022-04-29 21:05:26 +02:00
Kawe Mazidjatari
30ce3e949f Add ConVar's and hooks for disabling the rendering of world brush entity
This is mainly for development only and in the event so many models/textures/shaders are missing, the engine would effectively crash otherwise (if some of these aren't disabled).
2022-04-29 20:12:54 +02:00
Kawe Mazidjatari
827641b9b1 Early working implementation of the 'mdl/error.rmdl' fallback
Only works for prop_static (for the time being)
Only works for the S3 game_dll.

In order to get this to work: you must set 'old_gather_props' to nun-null and (for certain maps) perform the patch to prevent the frustum culling code to deref a bad pointer (see command 'opcodes test').
2022-04-29 18:25:54 +02:00
Kawe Mazidjatari
3cb4976c23 Start or 'mdl/error.rmdl' fallback implementation (see description)
In 'datacache/mdlcache.cpp' the function 'CMDLCache::FindMDL' attempts to find 'mdl/error.rmdl' and assigns the studiohdr and handle to the members of CMDLFallback.

In 'CMDLCache::FindUncachedMDL' we check if a model exists, if a model does not exist, we replace the studiohdr with the one of error.rmdl we stored in the CMDLFallback structure.

This does actually work (on the dedicated server it doesn't crash at all!), but on the client it crashes when trying to gather props (right before rendering), setting the ConVar* 'old_gather_props' does interesting things (check IDA around this ConVar*). setting this to 1 causes it to crash in another CMDLCache method when trying to deref something in the global cache pool.

This method is easy to rebuild. I will do this soon and attempt to return error.rmdl parts from here as well if results are null (this might actually just work).

Leaving 'old_gather_props' to 0 causes it to crash in the middle of the function which is supposed to gather the props the 'new' way.

The gather props functions are kind of daunting

NOTE: Currently only confirmed to work somewhat properly on the dedicated server for prop_static. prop_dynamic is unconfirmed. And (almost?) works on the client.
2022-04-29 05:30:06 +02:00
PixieCore
1ea4dd6163 Moved SVC_Print::Process to a class method.
* Virtual Method Swap also points to the class method now with some dodgy memory dereferencing.
2022-04-27 18:42:49 +02:00
Kawe Mazidjatari
3736d71bb1 Implement 'net_encryptionEnable' ConVar
This ConVar governs the use of encryption on game packets.
Also removed 'net_toggletrace' ConCommand and added 'net_tracePayload' ConVar as we can no longer hook on-demand as we bound the encryption parameter of the function to a ConVar.
2022-04-27 18:22:08 +02:00
PixieCore
a874d086cb Some defines for clientsdk compilation. 2022-04-27 16:48:18 +02:00
PixieCore
867072e814 SVC_Print::Process will print the server message to console now.
* Added new function to CMemory allowing you to hook a virtual method from a virtual method table.
* Added SVC_Print Class
* Hooked SVC_Print::Process and print the messages the server sends.
*!! Still needs verification for earlier seasons.
2022-04-27 16:29:14 +02:00
Kawe Mazidjatari
6ff10228ee Fix incorrect color code
Added FCVAR_DEVELOPMENTONLY | FCVAR_HIDDEN and fixed FCVAR_DEVELOPMENTONLY | FCVAR_CLIENTDLL
2022-04-26 20:35:51 +02:00
Kawe Mazidjatari
c0511fa8e4 See description
* Add ConVar to allow user to set/unset FCVAR_DEVELOPMENTONLY ConVar's (default behavior would never be hit without this ConVar).
* Add icons to display the flags of a certain CommandBase.
* Fixed Dear ImGui not displaying images correctly (descriptor needs DXGI_FORMAT_R8G8B8A8_UNORM_SRGB due to the nature of this game).
* Dynamically obtain buffer sizes of resources taken from modules.
* Light SDK cleanup.
2022-04-26 20:24:51 +02:00
PixieCore
daf1cfe14d Added CreateInterface typedef to new interaces.h 2022-04-26 16:14:39 +02:00
PixieCore
d5a2c2de09 Forgot proj removes. 2022-04-26 16:11:15 +02:00
PixieCore
8fc2e03772 Remove old interface.h 2022-04-26 15:57:44 +02:00
Kawe Mazidjatari
34502e5147 Make loading required paks per level more reliable
Also seems to work good on the dedicated server
2022-04-25 04:05:42 +02:00
Kawe Mazidjatari
624f91a054 Offset by 12 instead 2022-04-25 03:14:49 +02:00
Kawe Mazidjatari
f425c09608 Default SDL to MSVC 2022-04-25 02:28:02 +02:00
Kawe Mazidjatari
84fe122e43 Update ImGui lib
Update to 1.87
2022-04-24 20:52:40 +02:00
Kawe Mazidjatari
3a46bff5ee Don't update material system configs on the dedicated server 2022-04-24 19:34:14 +02:00
Kawe Mazidjatari
82261f6c56 Small improvements 2022-04-24 19:32:47 +02:00
Kawe Mazidjatari
31b95f41e8 Don't initialize SDL when running naveditor from the commandline
+ some additional cleanup.
TODO: get logging working on command line
2022-04-22 02:33:26 +02:00
Kawe Mazidjatari
a778d910e7 Fix rare crash in naveditor
Running tests in the naveditor without building navigation segfaults the application.

Reduced verbose prints when building navigation.
2022-04-22 02:31:06 +02:00
Kawe Mazidjatari
3ad668e37a Fix script command
Fixed problem where in certain cases input doesn't get compiled at all.
Fixed problem where quote marks don't get passed correctly to the execute wrapper function.

problems:
passing non-string object as reference to constructor.
using CCommand::Arg(index) seems to 'strip' quote marks from the actual buffer.
2022-04-22 02:27:35 +02:00
Kawe Mazidjatari
02cbb36474 Improved script commands
Quotes are no longer needed
2022-04-19 22:47:58 +02:00
Kawe Mazidjatari
b421a17d2b Dedicated server optimizations
Removed all ui.rpak/ui.dll assets loading on the dedicated server.
Moved AsyncLoad to CPakFile class.
Moved g_pMallocPool to tslist.h.
2022-04-19 03:55:20 +02:00
Kawe Mazidjatari
3d32346b39 Fix patterns for S1 and removed redundant code 2022-04-19 00:00:45 +02:00
Kawe Mazidjatari
642d852e69 Fix pattern mismatch for S2 2022-04-18 22:25:03 +02:00
Kawe Mazidjatari
987fc6f78e Update casts 2022-04-18 20:15:23 +02:00
Kawe Mazidjatari
1e7b746356 More detailed system stats
Fixed physical core count always returning logical core count (this engine does not run on the AMD Phenom processor).
2022-04-18 16:45:26 +02:00
Kawe Mazidjatari
ecfc380f84 Sort IConsole autocomplete list lexicographically
QoL update for the console.
2022-04-18 05:34:21 +02:00
Kawe Mazidjatari
8ebdf6fa65 Add performance metrics and supplemental CPU details on startup 2022-04-18 03:46:26 +02:00
Kawe Mazidjatari
5c2c5709e5 Update gl_screen.cpp 2022-04-18 03:35:24 +02:00
Kawe Mazidjatari
e32cc6ae6a Code overhaul
Moved every pattern to IDetour interface. This allows for debugging patterns scans more easily, and create threads during pattern searching (Operation is now fired in APIENTRY).

Also cleaned up some unused code/extraneous comments.
Slightly increased performance by purging duplicate patterns.
Made variable search less dependent from other results (except if pattern-to-scan results is within the same header)
2022-04-18 03:35:08 +02:00
Kawe Mazidjatari
7d869ca189 Extra dedicated server optimizations 2022-04-17 02:00:06 +02:00