3182 Commits

Author SHA1 Message Date
Kawe Mazidjatari
fd3e227a86 Align folder structure with p4 2023-09-19 22:13:22 +02:00
Kawe Mazidjatari
37ab1cfad5 Add new RPak types and rename existing
Rename to enforce consistency.
2023-09-19 20:43:01 +02:00
Kawe Mazidjatari
156e31404e Light protobuf cmakelist cleanup
Add missing files and remove unused version file (version file was also incorrect, it mentions version 3.19 but we have 3.21.12).
v2.3_rc4 v2.3_rc0 v2.4_rc4 v2.4_rc3 v2.4_rc2 v2.4_rc1 v2.4_rc0 v2.3_rc9 v2.3_rc8 v2.3_rc7 v2.2_rc11 v2.3_rc6 v2.3_rc2 v2.3_rc3 v2.2_rc12 v2.3_rc1 v2.4_rc5 v2.3_rc5
2023-09-17 22:06:15 +02:00
Kawe Mazidjatari
7b5f40fb9d Upgrade spdlog library to 1.12.0 2023-09-17 20:37:44 +02:00
Kawe Mazidjatari
feffcdfa94 Light pluginsystem cleanup
Light cleanup and improvements. Always load plugin dll's from "GAME" first before searching through mods to prevent mods from overriding them.
2023-09-17 20:33:57 +02:00
Kawe Mazidjatari
5af364f325 Remove extraneous check
Should not fire this code if that cvar is set.
2023-09-17 17:19:32 +02:00
Kawe Mazidjatari
71d0332dca Add CCommonHostState to SDK
The previous 'interval_per_tick' global belongs to the 'g_pCommonHostState' singleton.
2023-09-17 16:44:18 +02:00
Kawe Mazidjatari
b723cb35cc Combine methods
Combine ClearAutoComplete with ResetAutoComplete, full reset needs to be performed when calling this. Combining avoids confusion and potential bugs later on.
2023-09-17 16:15:42 +02:00
Kawe Mazidjatari
970c04fa56 Improve suggest reset logic
* Fixed redundant call (every frame) to 'ResetAutoComplete()' if the list was empty while having text in the buffer.
* 'ResetAutoComplete()' also resets 'm_bCanAutoComplete' now.
2023-09-17 12:47:36 +02:00
Kawe Mazidjatari
0cc148e65c Improve position reset logic
Force scroll to 0 on xy when it should reset, setting rects to 0 isn't sufficient as it goes into minus. Made the code mode simple as well.
2023-09-17 12:06:38 +02:00
Kawe Mazidjatari
375ff7fb16 Clarify code
Use enums for default positions.
2023-09-17 11:38:00 +02:00
Kawe Mazidjatari
fc845d355f CConsole: Fix reset hack and optimize
Don't update the view once we already found the 'active' object, or if we are at the park position (-1). This fixes the hack of having to have CConsole::m_bSuggestMoved to be true all the time.
2023-09-17 01:37:01 +02:00
Kawe Mazidjatari
9aefd6a046 CConsole: reset the view to the top if the list was updated
If you had a list of suggestions, and had an active element halfway through the list, and then update the suggestion list again by changing what's in the input buffer, the view would remain at the old position (displaying whatever is there). This makes sure the view gets reset all the way to the top if the list was updated.
2023-09-17 01:25:44 +02:00
Kawe Mazidjatari
53d981a06d Fix incorrect address print
Printed the wrong pointer.
2023-09-16 22:34:21 +02:00
Kawe Mazidjatari
1323703251 Move process time rate limit back to caller hook
Move it back to caller hook instead of in the ProcessMessages function as there were crash reports when running the listen server. Moving this back solved the intermittent crash problem entirely while still rate limiting process time.
2023-09-16 22:03:39 +02:00
Kawe Mazidjatari
228b9222b3 Fix compiler error
Define this out for client dll.
2023-09-16 22:02:04 +02:00
Kawe Mazidjatari
57feab706c Add NVIDIA NvAPI legal notice
Should be in the thirdpartylegalnotices.txt we ship with builds.
2023-09-16 17:45:38 +02:00
Kawe Mazidjatari
00e79268d7 Fix infinite memalloc exploit in NET_SetConVar
Reported by Wanderer. Don't allow the creation of new ConVar entries in CClient::m_ConVars after the initial creation.
2023-09-16 16:18:18 +02:00
Kawe Mazidjatari
ee3560e722 Reimplement 'KeyValues::FindKey(...)'
Reimplement.
2023-09-16 16:13:14 +02:00
Kawe Mazidjatari
66daec04db Fix compile errors in non cert builds 2023-09-16 13:10:12 +02:00
Kawe Mazidjatari
c9637196b8 Improve CEngineAPI signatures 2023-09-16 13:09:22 +02:00
Kawe Mazidjatari
140270f426 Fix infinite recursion
Bug introduced in recent commit 1d41b23a.
2023-09-16 13:08:56 +02:00
Kawe Mazidjatari
5bab1bc6af Move CClient pointer adjuster to separate function
All process methods have a shifted CClient pointer, so this will be used more often.
2023-09-16 12:18:32 +02:00
Kawe Mazidjatari
1d41b23abb Make sure language is never NULL
* Initialize CPylon::m_Language to "english".
* Make sure cvar change callback is always setting values instead of returning out early.
2023-09-16 00:45:11 +02:00
Amos
0634261c18 Move global language constants to single file
Deduplicate.
2023-09-15 18:25:31 +02:00
Amos
95cd34eb23 Replace hardcoded sleep threshold constant
Replaced with a cvar.
2023-09-14 09:17:03 +02:00
Kawe Mazidjatari
1874443425 Disable NVIDIA Reflex Boost by default
Default the implementation to On, as per the documentation.
2023-09-14 00:02:37 +02:00
Kawe Mazidjatari
cdf03d8df7 Add UI settings cvar for NVIDIA Reflex
Required for settings scripts to work.
2023-09-14 00:01:33 +02:00
Kawe Mazidjatari
75e585ddeb
Merge pull request #112 from Mauler125/nvidia_reflex_timing
Nvidia reflex timing
2023-09-13 22:41:35 +02:00
Kawe Mazidjatari
eaa5347fa3 Only run NVIDIA Reflex if the display driver vendor is NVIDIA
This is to ensure we don't cause any performance hits when running the game on an AMD or Intel GPU.
2023-09-13 22:24:59 +02:00
Kawe Mazidjatari
a639a4befd Add 'CMaterialDeviceMgr' singleton to SDK
Manager class for display adapters.
2023-09-13 22:22:25 +02:00
Kawe Mazidjatari
d0887da27a Cleanup
No longer used.
2023-09-13 22:20:56 +02:00
Kawe Mazidjatari
688a76c358 Use correct types for frame numbering
Structure contains an NvU64 type for frame ID, use this type instead. Also no need to worry about overflowing it, as it would just 'wrap around'.
2023-09-13 17:42:47 +02:00
Kawe Mazidjatari
907e582f55 Remove latency markers
Some parts of the engine have to be rebuild in order to implement this correctly, therefore, it has been removed for now to avoid potential performance problems.

fps_max_rt and fps_max_gfx have been limited to 295 to avoid a contest with the engine's hard limit causing huge performance hits.
2023-09-13 17:37:09 +02:00
Kawe Mazidjatari
4927654da0 Bugfix: only run NVIDIA Reflex if we ran an actual engine frame
CEngine::Frame() tends to return out early if we are ahead of frame time, and therefore need to sleep. In this particular engine, CEngine::Frame() returns true if it had actually executed an engine frame, else it returns false.

Therefore, we end up calling 'NvAPI_D3D_Sleep()' multiple times a frame, and thus causing a major loss in performance. Now we check if we have actually ran a frame (incrementing reflex frame if so). If the frame was not incremented, but 'GFX_RunLowLatencyFrame()' was called, it will not call 'NvAPI_D3D_Sleep()'.

Code has been tested and appears to work on my system (never called twice or more per frame). Needs more testing on other systems to make sure its good.
2023-09-12 20:50:38 +02:00
Kawe Mazidjatari
c8dea8927c Force rebuild of sigcache
Signatures changed and need to be force rebuild.
2023-09-12 17:45:17 +02:00
Kawe Mazidjatari
384ad649bf Update CEngineAPI::PumpMessages() signature
Function has been modified internally.
2023-09-12 17:44:58 +02:00
Kawe Mazidjatari
51a3f4a1c4 Only call 'NvAPI_D3D_SetSleepMode(...)' on pending changes
No need to keep calling this if there are no pending changes.
2023-09-12 17:44:24 +02:00
Kawe Mazidjatari
b87d7bf1c3 More improvements to the comment
Make a bit more sense.
2023-09-12 17:13:12 +02:00
Kawe Mazidjatari
bf29365e04 Fix typo
Should be tick as its possible to run more frames per simulation tick.
2023-09-12 17:09:19 +02:00
Kawe Mazidjatari
bcf7d03d90 Properly place PC_LATENCY_PING marker
Call once we peeked a message.
2023-09-12 13:20:13 +02:00
Kawe Mazidjatari
ea6c15df4c Initial implementation of NVIDIA Reflex Low Latency timing
Propagated latency markers in an attempt to further reduce input latency. Code is pending rigorous testing on several systems, including systems powered by an AMD GPU to make sure we are not impacting performance on systems that does NOT support NVIDIA Reflex.
2023-09-12 11:06:16 +02:00
Kawe Mazidjatari
9df90d4a25 Add cvar for low latency timing (work in progress)
Work in progress NVIDIA Low Latency timing implementation.
2023-09-12 00:19:47 +02:00
Kawe Mazidjatari
804f96625b Move NVIDIA Reflex implementation to library function
Improve code, there will be more NVIDIA GeForce related stuff soon.
2023-09-12 00:08:46 +02:00
Kawe Mazidjatari
85de096f98 Take into account television refresh rates
TV's tend to output @59.939999 FPS, set out frame limiter's to that if FPS happens to be 59 or 60.
2023-09-11 22:48:28 +02:00
Kawe Mazidjatari
1baaf25929 Fix typo in help strings for newly added cvars
Small typo.
2023-09-11 22:23:07 +02:00
Kawe Mazidjatari
07dade5d5d Implement high precision frame limiter
Limits frames at a much higher level of precision than 'fps_max' and 'fps_max_gfx', probably ideal to reduce input latency even more. Also changed the logic of the NVIDIA Reflex frame limiter, to which it would use the desktop's refresh rate if set to '-1'. The new render thread frame limiter has a similar behavior. Using desktop refresh rates on the render thread or NVIDIA Reflex frame limiter requires 'fps_max' to be set to 0 (unlimited), as it would otherwise result in a major performance drop due to a contest if fps_max_(gfx/rt) is set to a similar number as fps_max.
2023-09-11 22:20:24 +02:00
Kawe Mazidjatari
fdb4a4d429 Reverse CGame class
Class structure reversed.
2023-09-11 20:38:18 +02:00
Kawe Mazidjatari
0306d7788b More reversed TEB64 structure 2023-09-11 01:32:11 +02:00
Kawe Mazidjatari
0fe7b40506 Add inline DX device getters 2023-09-11 01:28:17 +02:00