1,623 Commits over 396 Days - 0.17cph!
Merge from baseplayer_serverupdateparallel
- Optim: reduce GC allocs by 60% when creating tasks for UsePlayerUpdateJobs 2
- Optim: skip occlusion queries for pairs of same players (affects all modes)
Tests: 2p tests on Craggy + 2k procgen with UsePlayerUpdateJobs 0/1/2 (covered spawning, sleeping, killing and occlusion kicking in)
Optim: skip running server occlusion between a pair of same players
Saves us a bunch of extra dictionary entries, running extra occlusion jobs
Tests: 2p sessions with UsePlayerUpdateJobs 0/1/2 on Craggy (with reconnects, kills, occlusion culling)
Bugfix: UsePlayerUpdateJobs 2 - skip trying to run occlusion checks between 2 same players
A little slapdash, but it fixes editor-only CLIENT+SERVER bug of sometimes failing to notify player that they're awake. I'll exclude it from all modes next CL.
Tests: loaded into 2k procgen world with UsePlayerUpdateJobs 2 set from the start 3 tmes - all times no weird zombie state
Optim: UsePlayerUpdateJobs 2 - reduce GC allocations around creating tasks
Surprisingly, this was a struggle to test. Suspicious about a potential bug in unrelated part of UsePlayerUpdateJobs 1/2.
Tests: 2p on Craggy and 2k Procgen map with UsePlayerUpdateJobs 2
Update: Unit tests that experiment with reducing allocation overhead of tasks
Got the following reductions in the unit test:
Garbage size: 1.1KB -> 0.3KB
Alloc Calls: 11 -> 5
The remaining ones seem impossible to remove while still using System.Threading.Task.
Tests: ran the new unit tests
Merge: from benchmark_demo_clean
- Clean: removal of dead functionality for demo benchmarks (not supporting it)
Tests: compiled in editor
Clean: remove expired editor-only upload endpoint
Tests: none, trivial change
Clean: remove full-server-demo benchmark demo uploading
FullServerDemos are not used for benchmarking(since they're not net protocol stable), so there's no point in this code.
Tests: compiles in editor
Merge: from baseplayer_serverupdateparallel
- Bugfix for UsePlayerUpdateJobs 1/2 - fix another reason why player could be swimming when parented
Tests: loaded up the map, went to the excavator - no more swimming with UsePlayerUpdateJobs 2
Bugfix: UsePlayerUpdateJobs 1/2 - extend the previous bugfix to the after-validate-recache logic
- Also fixed resetting a bunch of per-player state during the recache step
Tests: loaded map, hover-swim doesn't reproduce anymore (this time no exceptions)
Merge: from baseplayer_serverupdateparallel
- Bugfix: UsePlayerUpdateJobs 1/2 - players no longer randomly start swimming when parented to entities
Tests: loaded map from AU Prem 1 and went on to excavator - no longer swimming
Clean: Replace persistent native WaterFactorCache with transient native allocs
This is slower, but it's not the hot path and it simplifies code and avoids polluting intellisense.
Tests: ran unit tests
Bugfix: UsePlayerUpdateJobs 1/2 - use world pos/rots when running water queries
Previously it used local pos/transf, which was incorrect when parenting happened (excavator as example).
Tests: jumped on excavator, validated that the water queries are running in the right location with UsePlayerUpdateJobs 2
Update: UsePlayerUpdateJobs 1/2 - for blocking-water parented players, store empty WaterInfo instead of garbage
- Expanded TestWaterFactorsConsistency unit test to detect this case
Not marking as bugfix as I couldn't cause any bugs by hacking code. Makes BasePlayer.GetWaterFactors consistent with BasePlayer.WaterFactor
Tests: ran unit tests
Merge: from baseplayer_serverupdateparallel
- Fixes NRE when UsePlayerUpdateJobs 1/2 is enabled
Tests: unit tests
Merge: from main
Tests: compiles in editor, player cache unit tests
Bugfix: UsePlayerUpdateJobs 1/2 - use correct indices when filtering out disconnected players
- Added a unit test to validate BasePlayer.FilterInvalidPlayers works correctly
Tests: ran new unit test
Merge: from steamfriends_pooling_leak
- Bugfix for a pool leak of SteamFriends with open friend list or party management
Tests: observed steam friends list in game + created a party of me, SteamFriends pool stayed constant.
Bugfix: return SteamFriends to pool
- separate out party processing to partyChanged from friendChanged loop to prevent use-after-free bugs
Tests: observed steam friends list in game + created a party of me, SteamFriends pool stayed constant.
Merge: from texttable_allocs
- Update: TextTable now can be directly pooled and supports using-dispose pattern
- Bugfix: no more NRE on inspecting text table in debugger/evaluating twice
Tests: unit tests + executed a bunch of console commands multiple times
Clean: fix formatting of debug.cs again
Tests: none, trivial change
Merge: from main
Gotta fix debug.cs formatting again
Tests: compiles in editor
Update: converting the rest of TextTable uses to explicit pooling form
That's final ones
Tests: ran a bunch of commands couple times
Clean: fix borked formatting in debug.cs
Tests: none, trivial change
Update: convert to explicit pooling all of ConsoleCommands
Accounts for about 50% of text table usage
Tests: ran a bunch of commands a couple times
Update: modify one test to validate ShouldPadColumns resetting
Tests: ran the updated test
Update: rewrite TextTable to use pooling explicitly and support using pattern
- updated unit tests
I'll need to modify all 102 places we have in code to use pooling explicitly
Tests: ran unit tests
Merge: from shoretexture_editor_cache
- editor-optim: generates a cache for shore texture buffers
Tests: ran craggy twice
Update: cache shore dist textures in editor
Tests: booted up craggy, checked files were written, booted up again - was able to load
▉▍▅█▇▍▆▌: ▋▆▉█▇ ▋▊▌▌▄▉ ▍▋▄▋▍
- ▍▇▆▌█▇ █▊▋▌▊.▍▉ ▋▌▍▆ ▄▅▋▆▆.▄▇
- ▅▅▉▊▌█▌▉▆ ▆█▍▋▇.█▇ ▌▌▋█ ▅▋▆▄▆▉▊▋▍▄▊
▋▆▍▋▆: ▌▋▌▆▍ ▅▋▆▇▌ ▆▍▊▋▌▇ █▊▆▇▌ ██▆▌▅▊
Merge: from baseplayer_serverupdateparallel
- Bugfix for not replicating npcs when UsePlayerUpdateJobs 2 is set
- Bugfix for potential NRE for rare kick reasons when UsePlayerUpdateJobs 1 or 2 is set
Tests: 2p session on Craggy with NPCs and bots and UsePlayerUpdateJobs 2
Bugfix: avoid potential NRE after player kick for terrain violations
- Rewrote logic to avoid extra IsRealNull checks - we now filter indices instead
Tests: clipped in geometry with noclip
Bugfix: player-like entities that don't support occlusion replicate correctly with UsePlayerUpdateJobs 2
Old way of filtering them allowed them to use cache, which never contained them, so they were culled.
Tests: 2p session on Craggy with UsePlayerrUpdateJobs 2 - spawned NPC and a bot, it didn't despawn
Merge: from baseplayer_serverupdateparallel
- Bugfix for IndexOutOfRange when updating player state cache
Tests: none
Merge: from main
Tests: none
Bugfix: IndexOutOfRange exception when updating player state cache
Affected both UsePlayerUpdateJobs 1 and 2
Tests: none, simple change
Merge: from baseplayer_serverupdateparallel
- Next phase of parallel workflow, can be activated with UsePlayerUpdateJobs 2
- Optim: above mode now uses tasks to send entity snapshots/destroy messages where possible
- Optim: above mode uses parallel Burst jobs for server occlusion
- Optim: above mode reduced number of occlusion checks we run, more aggressive caching of results
- Contains Network++
Tests: build tests of all modes in editor + standalone server build + unit tests + 2p session on Craggy
Buildfix: unused variable warning-as-error
Weird it didn't get detected outisde of my branch, but ah well
Tests: built all modes in editor
Bugfix: reset OcclusionCanUseFrameCache on emergency disable of UsePlayerUpdateJobs
Tests: none, trivial change
Clean: extract WaitForTasks
Tests: editor compiles
Update: review fixes #1
- fix formatting in BasePlayer-Mission
- Apply same mission fix from vanilla server flow
- Comments around EventRecord.New and AzureAnalytics.OnPlayerTick warning to avoid scripting API to keep it thread save
Got 2 more changes to make, then think it's ready
Tests: compiles in editor
Update: make batching constants servervars
- New vars are Server.SnapshotTaskBatchCount and Server.DestroyTaskBatchCount
- factored out SendEntityDestroyMessages
Tests: none, trivial changes
Bugfix: recycle filter buffers when there's no results
UsePlayerUpdateJobs 2 only issue
Tests: none, trivial change