1,837 Commits over 457 Days - 0.17cph!
Buildfix: add missing CLIENT guards
Tests: build all configs locally
Merge: from analytics_queue_rewrite
- New analytics uploading backend, disabled by default (analytics.usev2)
- New debug vars - analytics.log and analytics.dryrun
Tests: unit tests, used both old and new analytics backends and monitored logs
Merge: from baseplayer_vis_nre
- Simplified how debug.invis works
- Reimplemented how global.spectate and spectateid work - spectator no longer parents to the spectated player
- Tightened existing debug logs around mystery baseplayer NRE.
This eliminates a source of potential NREs related to players spectating others, but doesn't outright forbid them
Tests: 2p sesions on Craggy, one player spectates other - killed scientist with AK(hs audio replicated), helicopter fly around, motorbike ride around, noclipped outside of usual network range and back, cycled invis, left the server and returned - no issues. Tried debug camera.
▉▋▆▅▆▇: ▊▊▇▌▄▍▋ ▊▇▄▍▋▇▄▄▆▇ ▍▊▍ ▍▅▄▍ ▍▄▇▌▇▌▇▋█▄▉ ▍▇▆▋ ▍▋▅█▋▋▋▇▊▊▆ █▇ █▇▇▉▊ ▇▍▄-▉▌▇█▊ ▅▆▆█▅▌▄
▅▋▅▋▊: ▆▅▆▊▊▆▅▇▄ ▇▅▋▍▇▍ ▇▊▇▍▌ ▍▅▊█ ▅▅▉▇ █▆▋▅▉▍▇▆, ▋▇▍▉▆ ▅▊▌▄, ▉▉▋▍▋██, ▆▍▊▅█▋▉▉▊▋, ▍▌▉▄▅▄▍▋ - ▊▇ ▇▇▊▌█ ▌█▉▊▌█▊▋ ▆▌ ▊▆▆ ▋▍▌█▍█▅▌▆'▍ ██▋, ▅▅ ▅▄▌▆ ▋▊ ▊▆▍▌
Update: Add a safety guard to DestroyOnClient to avoid destroying client's local player
Tests: 2p session on craggy (though there's no case in vanilla where this can happen)
Optim: pool SpectatorSubStrategy and SpectatedSubStrategy
Tests: 2p session on craggy with disconnects - checked pool.print_memory afterwards
Update: convert IsBeingSpectated utility
- Updated dependent code to use new GetSpectators instead of old nested children approach
Tests: spectated player on craggy that shot scientists - headshot sounds replicated correctly to the spectator
Clean: remove BaseEntity spectating support and fix up types/names of relevant code
This code was broken for multiple years, and couldn't think of a reason it could be useful, so simplifying.
Tests: spectated on craggy, cycled view modes
Update: when spectated player disconnects, switch spectators to a new target
- this also fixes a leak of spectated players list, since it gets cleared by above action
Tests: flew out, disconnected - spectator returned to self. Reconnected, started spectating joined player - all replicated.
Update: reimplement spectating to use ISubscriptionStrategy instead of secondary groups
- Done via SpectatorSubStrategy (takes subscriptions of target) and SpectatedSubStrategy (notifies when group changes)
- Removed old secondary group code and reverted relevant Network API changes
- Made Networkable.OnSubscriptionChange public
This also fixes the bug with previous version that it only saw "near" distance entities
Tests: Spectated player on craggy, flew around until island disappeared from rendering - no NREs. Got 2 things to improve, and I think it's done
Update: extract how we gather network group subscribers into a ISubscriberStrategy
- implemented a DefaultSubscriberStrategy
This CL doesn't have any logic change, it just reorganizes code so that we can start overwriting this(need it for spectating now and parallel processing in the future).
Tests: 2p on craggy - saw the island entities spawn in as well as the players replicate
Bugfix: spectators now subscribe to spectatees via secondary group
This prevents spectatee from being culled out by network grid onthe spectators end, leading to NREs. This is temporary solution, as it doesn't have the same network range as the primary group.
Tests: spectating a palyer on craggy, then flew around till the island was no longer visible
▋▇▅▋▍: ▅▍▌'▍ ▅▌▇ ▋▇ ▄▄█▉▅ ▌▍▌▇▌▅██▄▌▋▅▆▇▅▇▊▌▍▅▋█ █▆ ▌▄██▆▄▌▌▉▍
▅▌ ▌▍▆▊▉▊▍▍▆▍ ▊▄▊ ▍▇ ▆████▉ ▊▉▋▊▍▆▄▄ ▌▊ ▆▅▇█▋▉▇▉▄█, █▄ ▌██▌▆'▊ ▊▇▅▉ ▋▇▆█▉▍▉ █▍▍ ▇▇▇▌▇ ▉▊▊ ▅▌▇▍▄'▊ ▊▆▆▄▄▇▇ ▉▉▋█▄▆▆ ▄▇▍▊█ █▊█▅▉▉▋, ▍▍▆▆▅▋ ▆▊▋ ▆▋▉█▊ ▉▌▌▊
█▆▆█▊: ▌▌▋▉ ▉▍▆▅▊ ▉▆██▇▆▉ ▊▋ ▊ █▌ ▊█▅▌▌▌▊ █▅▆█ ▉▇▇██▆▋▊▉▄ - ▄▍▅▅'▅ █▊▅ ▌▉▊ ▍▋▅▇▉▊▊.
▋▋▋▇▄: █▄▌'▊ █▇▌ █▇ ▊▋▊▇ ▅▄▋▇▄▅▍▅▋▋▆▅█▊▉▅▊▉▅▊▋▊▌▍▄ ▊▄▋ ▋▆▌▉▊▊▉▋█▇ ▋▉█▍▊▇▉
▉ ▍▊▆▆▊ ▄▊▄▉ ▉▅▌ ▇█ ▅▆ ▇▉▍▋ ▉▋▅▋▊▇▌▉▅▌ ▍▉▇▉▊▇██▉▋ ▍▊▅▄▉▊▄ ▇█▅▉▅ ▇▌ ▄▆█▉▊▇▆▄▌▊ (▉▊ █▋▋ ▋▌ ▌▄▆▋▍ ▊▅▅▄ ▆▉ ▅▄▆▌▆▉██▍). ▍▌▆ ▉▍ ▋█ █▍▅▆▉▊ ▇▋▄▅▄▅ ▉▇▇▉▄▊▌▋▇▋ █▍ ▇▇▌▌▍▋▊▌▅▆, ▋▆ ▌▄▄ █▊▉▋▄ █▆▌▉▊▆ ▆▌▄▍.
▄▋▉▆▌: ▅▌█▋ ▇█▅▄▇ ▊▄▋▍▊█▅ ▌▍ ▇█▅▉▆▆▊ ▉▋▌▅ ▅▍▊▉ ▅▍▉▅ ▋█▉▇▅ - ▉▍ ▉▉▆▆▉▌▆▋▆▌ ▋▊▊▅▄. ▌▋▆ ▍▅▊█▅▋▊▌ ▄▄▉▋ ▅▍▍▆▋▅▆█▇ ▆▍▅█ ▋█▇▍▍▊▉▌▄ ▆█ ▇▄▇▉▉▋▌▅▆█ ▋▌▊ ▇█▍ ▊▆ ▍▊▆█▍█▇ ▇▌▄█▍ ▍▄▋▉▍▊ - ▋▋▌▊ █▌▍ ▄▍▊▊ ▊▉ ▋ ▍▉▄
Optim: cache spectated target
Turns out it's quieried very frequenly
Tests: 2p session on craggy with disconnects
Update: first version of spectate that doesn't require parenting to target player
Doing this to avoid weird bugs with nested players in other systems.
Tests: 2p session on craggy with spectating. Toggled camera modes and toggled invis. tried spectating after server occlusion culled other player. Noticed that nutrition, comfort info didn't replicate, map compas reacted to spectator's input - will fix those next
Bugfix: fix invis players not replicating positions & rotations
Tests: spectated invis player, didn't observe and animation glitches as the comment warned (tried rock, torch, ak)
Bugfix: don't destroy local player when spectating player going invisible
Fallout from the recent rewrite.
Tests: while being spectated, toggled invis a bunch of times - no NREs on the client. invis player doesn't replicate, though, will fix next.
▉█▊▋▊▋: █▍▌▇▇▊▋▉▇▆▋ ▋█▅▍▅.▋▅█▊▄ ▆▉▋▆▊█▌
- ▊▉▄▅▍▍█ ▌▉▍▌▊▊▍▇▍▇.█▊▅▉█▋▉▆▍▋▅█▄▄▋ ▅▌▌▌▆ ▉▋ ▉▊▅▊▋▇▌▄▅ - ▌▊█▌ ▄▇▆▆▌▉▌▄ ▆ ▆██▌ ▅█▌▄▉ ▋▋▋▅██▌▍▅█ ▍▉▆▌▉▆▋▌▉ ▊▄ ▊▊▋▆█ ▊▅▌▅▇▅▅▇▍▋
▅▍ ▌▋█▌▇█ ▄▊▍▊▌▊█ ▊▆ █▉▄▄▍▌▄▌▊▅▍▅▋█▍, ▍▌ ▅▌ ▄▋▅ ▅▇▆▊▊█▄ ▆▆ ▋▊▍▊▋▌▊▅▄▋ ▍▋▋▇▆▆▆▍ ▊▄█▊▊ █▆▇▊▋ <-> ▆▆▉▋█▌▆ ▉▌▋▆ ▄▅▍▋ ▆▋██▍. ▄███▇▆▋, ▅▄█ ██▅▍▌▌ ▆▆ ▇▌▅▋██▋▊▌█▌
█▊▌▌▋: ▊▌▋▄▇ ▅▄ ▄█▇▇▌▌▆ ▅▌ ▄▉▄▊▌▇▄▍▋▋, ▇▆▆▊▌▊▉█▆ ▄▄▅▌▅, ▋▅▆▄▄ ▍▋▉▇▄▇, ▅▋▆▌▇▌▌▇ ▊▋▋▋▌, ▉▋▆▇▄▅▋▍ ▊▍▌▋▅ - ▍▌▋▍▌▍▆▆▋▌ ▆▊▌▅ ▆▋▆ ▇▍█▇▉ ▇▊ █▉▆ ▇██▌█ ▅▅▌▍. ▉▋▍▌█▊▋▌▄▋ ▅▍ █▅█▉▌▇, ▌█▉ ▅▉ ▆ ▊▍▋▇ ▍▌█ - ▋▆▇▅█▇▅▍ ▊▋█▊▊█▇ ▌▇▍▆ ▉▌ ▇█ ██▆▋/▅▉▌█▌▅▆, █▊ ▅▍▍ ▆ ▋█▅ ▊▄▉▌▌▇▄█▇▋▇.
Bugfix: remove false-positive log for deferred player destroy
- remove unnecessary override
Discovered when spactating a player that constantly toggles invis. Doesn't fix the NRE itself, but further reduces false-positives. Still looking for the root cause
Tests: spectated a player constantly toggling invis
Bugfix: reduce error false-positives by ensuring bot IDs never overlap
- Permit random overlap once we exhaust MaxBotIdRange ids (which is old behavior) but emit an error
Because we always picked a random bot ID, it was possible that there'd be an overlap and it could confuse dependent systems (like my logging for the NRE). Hoping this reduces false-positive error logging.
Tests: in editor spawned a couple players and killed them, then monitored the ID queue with debugger
Merge: from main
Didn't refresh and missed the desired fixes
Update: skip server occlusion culling for players in the deep sea
It'll still have some overhead for the server occlusion processing, but that'll be improved separately
Tests: 2p session on craggy - tested occlusion with both on Craggy, one on Craggy and one in deep sea, and both in deep sea
Bugfix(editor): StoreBundleTool - handle invalid paths
This can happen if the serialized path now points to renamed or deleted resource.
Tests: none, don't have a case like that right now.
Update(editor): StoreBundleTool - stage timings emit volume of work
Makes it easier to confirm if it's doing anything when there are no dirty changes
Tests: ran the tool
Clean(editor): remove Tools/Menu2
Checked both the editor pref by variable and by value, they're not used anywhere
Tests: none, trivial change
Update(editor): StoreBundleTool - scan scriptable objects
- fix assembly scanner skipping public fields if it's type is nested
Tests: created a dummy scriptable object, ran a scan - it got picked up
Updateeditor): StoreBundleTool - activate bundle assignment code
- removed extra logging
Tests: editor compiles
Update(editor): StoreBundleTool - scan for already-assigned-to-bundles resources
- fixed timer reporting invalid times for sections of code
Tests: ran it, doesn't find any diffs with my manual assignments from last month
Update(editor): StoreBundleTool - add proxy path scanning from existing prefabs
Tests: ran the code, checked some of the paths. gotta implement comparison to fully validate
Update(editor): StoreBundleTool - add support for array traversal
Tests: ran the tool, it found all annotated fields
Update(editor): StoreBundleTool - properly implement reflection shortcutting
Tests: stepped through how it's accumulated. will test more later
Update(editor): start of StoreBundleTool - automates bundle assignment for properties with ProxyPathFor attrib
- starting with assembly scanning
Idea is to scan the assembly, detect all the relevant fields, resolve them and assign referenced assets to the bundle
Tests: ran it, doesn't find all fields yet
Merge: from baseplayer_vis_nre
- fixed false positive logging, better logs
Tests: built standalone and connected to staging server - no extra errors on connect
Update: move breadcrumbs a bit to get better callstack
- eliminated a false-positive
Tests: built standalone and connected to staging - no more error logs on connect to server
Buildfix: add missing namespace using
Tests: none, trivial change
Merge: from analytics_track_menu_times
- Client analytics now aggregates frametimes, lag spikes and gc events into InGame, MainMenu, Inventory, Crafting, Contacts and Map groups
- Skip sending lag spikes and gc counts if there were none during performance logging tick
Tests: observerd client_perf analytics ticks in editor with debug code
Clean: remove unused namespace using
Tests: none, trivial change
Clean: remove debug logging
Tests: compiles in editor
Optim: don't emmit lag spikes and gc counts if there weren't any during analytics ticks
Tests: observed couple client_perf ticks in editor
Bugfix: no more use-after-free for Frametimes
- also reimplemented the fix from previous CL, as it was part of the problem
Tests: in editor spawned on craggy and opened main menu for multiple client analytics ticks - no more exceptions
Update: Client Analytics - categorize client frametimes, gc_count and lagspikes
- Bugfixing leaking a couple List<TimeSpan> containers
We now filter those out to InGame, MainMenu, Inventory, Crafting, Contacts and Map frame types and aggregate per type. Everything apart from InGame aggregates slightly reduced info set. New analytics is backwards compatible.
Tests: left it running with debug logging. relevant info seems to come through. There's a bug with use-after-free of List<TimeSpan> - will fix next
Update: convert error logs to error-once logs
The current changes mitigate the problem, which will allow peeps to play longer while we chase up what's going wrong.
Tests: none, trivial change
Update: adding more logging in an attempt to catch baseplayer NREs
Tests: 2p local session with spectating, disconnects
Clean: leaving a TODO note for one I return to this