branchrust_reboot/main/servercacheplayerinfo_optimcancel
23 Commits over 0 Days - Infinitycph!
Update(tests): amend BatchWaterLevels and SerialWaterLevels to support variety of query counts
Existing 10k test is a bit unrealistic (even if shows nice improvement)
Tests: ran perf tests
Update: GetWaterFactors - fetch parent entity only once
- updated perf test to have 5% to spawn parented player
Tests: ran unit tests
Optim: GetWaterFactors - add overload that can use cached mountables states for active players
- amended perf tests to spawn players with 5% chance to be mounted
400 batched queries: 0.6ms -> 0.55ms (serial are 2.32ms)
Tests: ran unit tests
Optim: ServerCachePlayerInfo - move isMounted and mountables caching to point of modification instead of every frame
Tests: built a boat on craggy and steered the wheel
Update: ServerCachePlayerInfo - cache isMounted, mountable for player
Tests: built a bouat on Craggy and used the steering wheel
Update: use dirty indices for copy
Test: none, trivial change
Update: propagate PlayerServerStates down to Antihack methods
- updates unit tests for changed API
Tests: unit & perf tests, ran around craggy
Bugfix(tests): don't try to manage unit test specific PlayerStates, rely on internal static one (sadface)
- also fix ServerOcclusionGroup tests not fully cleaning up players
There's an architecture barrier that's hard to push through to support multiple PlayerStates, so keep it simple for now
Tests: ran a bunch of unit tests, no longer sporadically failing
Clean: refactor various player server states into one big struct
Allows us to shrink func signatures and automate state propagation when we add new arrays. Only cleaned up bare minimum of funcs to get things working, need to do more
Tests: ran all relevant-ish unit tests (discovered TestOverlapOBBsConsistency is failing, will fix separately), played on craggy
Optim: ServerCachePlayerInfo - don't cache isRunning
Time to clean up all the extra args everywhere, having 10 param funcs is no bueno
Tests: consistency tests
Optim: ServerCachePlayerInfo - don't cache onground and isflying
Tests: ran unit consistency tests
Bugfix: accidentally used ducked instead of ducking modelstate, whoops
Tests: ran consisntecy unit tests
Optim: ServerCachePlayerInfo - stop caching isDucking
Tests: AH consistency unit tests
Optim: ServerCachePlayerInfo - don't cache isOnLadder
Tests: ran AH consistency unit tests
Bugfix: missed a couple places where ModelState.Blocking is updated
Tests: none, trivial change
Clean: fix up formatting crimes in BasePlayer-SaveLoad.cs
Tests: none, trivial change
Update: duplicate ModelState.flags and ducking properties into their own arrays, keep them in sync with incoming model states
Will allow me to removed caching of 5 properties in ServerCachePlayerInfo
Tests: booted craggy
Optim: ServerCachePlayerInfo - don't cache IsCrawling, it can be deduced from PlayerFlags
Tests: ran speed consistency unit test, ran around craggy, crawled while wounded - all's gud
Clean: remove JobHandle IsValid extension
This was a workaround for a Unity issue that was fixed in 6.3.14f1
Tests: none, trivial change
Optim: ServerCachePlayerInfo - only recache positional state if position changed from last call
Tests: ran around on craggy, sawm, crouched. retried connecting couple times
Optim: ServerCachePlayerInfo - avoid transform access when recaching player center
Tests: none, trivial change
Bugfix: separate position-dependent and other player state caching
It was possible that for a couple frames cached player state would be incorrect
Tests: none