1,688 Commits over 427 Days - 0.16cph!
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
Update: ran Generate Code
Tests: none, trivial change
Update: Network++
UsePlayerUpdateJobs 2 can send packets out of order, which needs client-side change (see CL 128169)
Tests: none, trivial change
Update: amending a comment for SendDemoTransientEntity
Finished investigating, server-demos shouldn't be a problem for multithreaded networking
Tests: none, trivial change
Bugfix: players go back to sleep on disconnect on a server with UsePlayerUpdateJobs 2
This looked scarrier than it ended up being. One concern left to investigate - looks like I'llbe able to merge it in tomorrow
Tests: 2p session on craggy with UsePlayerUpdateJobs 2
Optim: NetworkPositionTick - skip transform access
Tests: none, trivial change
Optim: inline virtual calls in SendNetworkPositions and skip transform access
Tests: 2p seesion on Craggy with UsePlayerUpdateJobs 2
Update: simplify SendNetworkPositions
Decided against parallelizing with tasks as it looks to be taking only ~0.3ms on a 350pop server
Tests: 2p session on Craggy with UsePlayerUpdateJobs 2
Clean: fix formatting
Tests: none, trivial change
Bugfix: fix failing WaterLevel tests
My ReadOnlySpan caused it, as we had hardcoded access to the global PlayerCache (which we don't use in tests).
Tests: unit tests pass
Update: rename BasePlayer.playerCache member var -> BasePlayer.PlayerCache
It was hiding the source of a bug, as func params have lower case name
Tests: compiles in editor
Clean: prefer ReadOnlySpan<BasePlayer> instead of playerCache where possible
Makes it easier to guess things at a glance.
Tests: ran all relevant unit tests(discovered WaterLevelTests are failing, will investigate next) + 2p session on craggy with UsePlayerUpdateJobs 2
Update: demote PlayersToFinalize, PlayersToValidate, PlayersToRecache from being global caches
Tests: 2p session on Craggy with UsePlayerUpdateJobs 2
Update: demote PositionChanges from being a global cache
Tests: 2p session on Craggy with UsePlayerUpdateJobs 2
Merge: from occlusion_rework
- Fix for occlusion queries not being commutative
- Reenable occlusion frame cache and expand it's use to full frame
- Server occlusion deduplicates queries
- minor API restructure (might affect mods)
Optim: ServerUpdateParallel - update player subscription groups just before we run sever occlusion update
This ensures that server occlusion frame cache is built from up-to-date occluders, and allows to save on more occlusion checks downstream in ConnectedPlayersUpdate
Tests: 2p session on Craggy with UsePlayerUpdateJobs 2
Clean: split up FinalizeTickParallel monstrosity
This is end of prep to rearrange systems for better occlusion cache reuse
Tests: 2p session on craggy with UsePlayerUpdateJobs 1 and 2
Update: add native list expand to GatherPlayersToUpdate
No effect in current case, but can prevent surprise exceptions in the future if reused
Tests: none, trivial change
Clean: minor refactor of ServerUpdatePlayerTick
Getting ready to shuffle system steps around, to re-expand occlusion cache and potentially reduce network traffic
Tests: none, trivial changes
Bugfix: avoid stale occlusion results for new occludeeds
Didn't realize UpdateSubscriptions modifies occludees - this returns a bunch of overhead. Will try to fix next.
Tests: none, trivial change
Optim: deduplicate occlusion queries
Saves 15-50% in 1k baseplayer pairs parallel occlusion perf tests.
Tests: occlusion unit tests
Clean: ServerOcclusionJobs.Algorithm uses int3 instead of SubGrid
Simplifies the code a bit
Tests: ran unit tests
Clean: get rid of non-burst CalculatePathBetweenGrids
- Also removed obsolete tests
We've been using burst version for a bit, and with current fixes it balooned to too many lines of code
Tests: ran unit tests
Bugfix: apply same neighbour occlusion fix to jobs
Perf tests of 100k paths show degradation (serial +25%, parallel +52%), but perf tests for 10k baseplayer occlusion show negligeble impact (serial -9%, parallel +1%).
Tests: occlusion unit tests pass
Bugfix: reimplement occlusion neighbour logic in non-burst flow
- Added anothed optim todo now that we have axis-count-specific neighbour checks
This partially fixes the failing test (it still fails since now it trips up in burst version)
Tests: ran unit tests
Update: Re-enable sorted pair occlusiuon visibility caching
Tests: none, I know it's borked
Merge: from baseplayer_serverupdateparallel
Update: disable bidirectional occlusion caching for now
- Left a couple optim/safety todos
This fixes the batch vs serial baseplayer occlusion consistency test, but one CantSee fails as expected. Going to fix it in a child branch, as that currently blocks more optims.
Tests: ran relevant unit tests
Tests: TestLineOfSight - properly enforce non-job mode in relevant cases
Tests: ran test sets
Tests: TestLineOfSight - validate reverse paths
Looks like some occlusion checks might fail reverse paths. That's an uh-oh.
Tests: ran above set, got a failure
Tests: ServerOcclusionTests - generated data set now contains similar pairs
Interestingly, this trips up consistency test - will investigate
Tests: ran TestOcclusionLineOfSight_Consistency
Tests: PerfOcclusionLineOfSight - reset internal recent visibility cache between runs
Tests: ran the set
Tests: ServerOcclusionTests - standardize test naming
Tests: ran test set