2962 Commits

Author SHA1 Message Date
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
Kawe Mazidjatari
ee1a2c5207 Add time globals 2023-09-10 11:41:50 +02:00
Kawe Mazidjatari
bf01287129 Add cvar for NVAPI frame limiter
Might be useful for someone.
2023-09-10 01:44:04 +02:00
Kawe Mazidjatari
fce3b1f46a CCrashHandler: small code cleanup 2023-09-09 20:57:23 +02:00
Kawe Mazidjatari
3fd898bf30 Fix crash during RPak load
* Added missing parameter to 'PakLoadFuncs_s::WaitAsync'.
* Fix offset to 'g_pakLoadApi'.
2023-09-09 20:57:00 +02:00
Kawe Mazidjatari
21093ca1a1 Implement NVIDIA Reflex Low Latency technology 2023-09-09 15:12:58 +02:00
Kawe Mazidjatari
00aee57e7c Add NVIDIA SDK 2023-09-09 14:50:11 +02:00
Kawe Mazidjatari
9cfc2b4b6a Use actual pakLoadApi pointer
Actual pakLoadApi pointer used internally.
2023-09-08 23:52:00 +02:00
Kawe Mazidjatari
f0bbc7dbf0 Change logging context
Should be engine.
2023-09-07 22:46:12 +02:00
O-Robotic
51dd17ad2a Validate json root is an object before trying to retrieve members from it. 2023-09-07 20:32:09 +01:00
Kawe Mazidjatari
5c3b7d1b56 Enable SIMD optimizations for RapidJSON 2023-09-07 11:18:00 +02:00
Kawe Mazidjatari
b85003a9ac Replace JSON library with RapidJSON
Less copies and overall CPU time parsing/constructing JSON's as we are mostly still using string pointers rather than STL string container.
2023-09-07 11:17:05 +02:00
Kawe Mazidjatari
bc59f1349d Use CUtlVector for map list 2023-09-05 17:34:22 +02:00
Kawe Mazidjatari
a994da728d Fix compile error
GetDouble has been removed.
2023-09-04 09:49:15 +02:00
Kawe Mazidjatari
7e247d9943 Create separate cvar to enable Base_CmdKeyValues netmsg's
The server can exploit the client with these netmessages, therefore, sv_cheats shouldn't be used to toggle it. Create a cvar that the server and client have to enable individually to enable the system.
2023-09-04 09:48:47 +02:00
Kawe Mazidjatari
45bbf1f14b Remove extraneous getter
Not used.
2023-08-31 00:19:11 +02:00
Kawe Mazidjatari
cb1a69e82a Ban system refactor
Use CUtlVector, and remove every copy caused by passing vectors by value. CUtlVector does not support copying. Also removed all extraneous std::string copies caused by calling itoa instead of std::to_string, or std::stoll, etc. All features have been tested and work as designed.
2023-08-31 00:16:25 +02:00
Kawe Mazidjatari
2e03139c39 Recover AIN runtime checksum validation
The runtime checksum is now also written to the file, as any changes to the info node entities will cause this checksum to change, and therefore we should warn the user that the file needs to be rebuilt. The NavMesh CRC is now written at the END of the AIN file, and only checked if a NavMesh is present for that particular level. The same warning gets printed if this checksum mismatches as the user should rebuilt it.

NOTE: the NavMesh checks are custom and are not part of the official AIN file structure of this game. This is added as the NavMeshes are frequently rebuilt.
2023-08-29 23:48:41 +02:00
Kawe Mazidjatari
4b7ca6b439 Use size types
Make code more portable and modern.
2023-08-29 22:05:20 +02:00
Kawe Mazidjatari
abaab38d9d Rename dtOffMeshConnection field
CAI_Navigator::m_traverseRefYaw gets set to this field.
2023-08-29 00:33:48 +02:00
Kawe Mazidjatari
a9b1d950e5 Read data from memory buffer instead of loading it from disk
Safe resources and potential failures.
2023-08-29 00:33:12 +02:00
Kawe Mazidjatari
f081fe6f67 Dump hull data blocks as well
The AIN dumper is now finished. Giving it a valid r1 AIN will make it spit out an identical AIN (minus the CRC header, but this is intended).
2023-08-28 23:17:03 +02:00
Kawe Mazidjatari
25e5ea0c83 CAI_NetworkBuilder::SaveNetworkGraph() rewrite
- Use CUtlBuffer instead to construct the data.
- Dump traverse ex nodes as well (CAI_TraverseNode).
2023-08-28 20:01:45 +02:00
Kawe Mazidjatari
db6ccff8c2 Calculate processing time for each message 2023-08-28 02:45:37 +02:00
Kawe Mazidjatari
51ac0bf353 Cleanup 2023-08-28 02:44:39 +02:00
Kawe Mazidjatari
9049e61d34 Move pointers to 'dtQueryData' struct
In the engine, m_query gets memset to size '0x58', and it passes this field as reference to other functions which then access the 3 pointers. Moving the 3 pointers there made the struct size 0x58, and showed a much better disassembly. Moved these type here to reflect the changes made in the engine.
2023-08-27 23:56:11 +02:00
Kawe Mazidjatari
5397ba4481 Fix return types
They are voids.
2023-08-27 12:13:07 +02:00
Kawe Mazidjatari
909a08a80b Remove testing code
No longer of use.
2023-08-27 11:38:44 +02:00
Kawe Mazidjatari
f22e7890b0 CAI_NetworkBuilder::SaveNetworkGraph: Fix bug
Iterated over the wrong vector, dumped AIN's from r2 are now 100% identical, the function has been debugged and is complete.
2023-08-27 11:38:02 +02:00
Kawe Mazidjatari
9d2801929a Map out 'CAI_NetworkManager' 2023-08-27 11:36:58 +02:00
Kawe Mazidjatari
3d0d8c7081 Get rid of disk structures
Less maintenance work; write the fields out directly from memory structures.
2023-08-27 00:56:38 +02:00
Kawe Mazidjatari
7e3f812a97 Rename fields
These are vtable pointers.
2023-08-27 00:29:31 +02:00
Kawe Mazidjatari
d7448be952 Improve CClientState fields 2023-08-27 00:20:35 +02:00
Kawe Mazidjatari
ea2c71242e Map out entity structures more
More types and improvements for base entity classes.
2023-08-27 00:20:23 +02:00
Kawe Mazidjatari
8b45e1a4e5 Also throw asserts 2023-08-26 01:28:30 +02:00
Kawe Mazidjatari
4e1d99bf9d CClientState adjustments
Mapped out and aligned slightly more.
2023-08-26 01:25:07 +02:00
Amos
5ddc9d1884 Write each field individually
Cluster links were written with an additional padding as the struct is 11 in size, so it gets padded to 12. Cluster links now get correctly written to the disk.
2023-08-25 08:47:12 +02:00
Kawe Mazidjatari
52bc73abb0 Fix AIN building bugs
Fixed writing of:
- Path nodes
- Node links
- Path clusters
- Cluster links

The previous globals 'g_pppAiNodeClusters' and 'g_pppAiNodeClusterLinks' were of type CUtlVector. These have been retyped and renamed accordingly.

Also mapped the CAI_Cluster class out slightly more.
Rebuild of path clusters and cluster links are still not correct; parsing a file in from r2, results in a different file on the disk, at the very offset the clusters are being written in (one field is off, this will be investigated soon).
2023-08-24 23:44:57 +02:00
Kawe Mazidjatari
c21747c4c6 CAI_NetworkBuilder::SaveNetworkGraph() improvements
Always create safe path, cache index pointer and make heavy prints non-cert only.
2023-08-24 10:35:54 +02:00
Kawe Mazidjatari
03ee817ca1 More of CNetChan mapped out 2023-08-23 00:15:26 +02:00
Amos
ee3e2b8f2a Use CUtlString 2023-08-22 19:32:21 +02:00
Kawe Mazidjatari
e8bffae822 Fix compiler error
Small rename.
2023-08-22 01:12:22 +02:00