userDaniel Pcancel

2,251 Commits over 549 Days - 0.17cph!

18 Days Ago
Merge: from main
19 Days Ago
Merge: from useplayertasks_removegroupocludee_nre - Bugfix: a series of bugfixes and extra error logs to ensure occlusion groups are valid and consistent Tests: 2p on Craggy - ran around host, flew away and back, teleported away and back, tested sleepers, disconnects, and general occlusion
19 Days Ago
Merge: from main
19 Days Ago
Clean: move OcclusionValidateGroups servervar to ServerOcclusion - codegen Tests: server compiles
19 Days Ago
Clean: GetOccludees => OcclusionGroup getter Tests: server compiles
19 Days Ago
Clean: OcclusionGroups - define bespoke ServerOcclusion.Group - updated code references Tests: all modes compile in editor
19 Days Ago
Clean: OcclusionGroup - lower core of logic from BasePlayer to BaseNetworkable - also move cached subscribers cleanup to BasePlayer.OnServerDestroy - split off server occlusion logic into it's own BaseNetworkable potion Tests: all platforms compile in editor
19 Days Ago
Bugfix: ServerOcclusion - clean up external references when BaseNetworkable is destoyed Dobbie's free, this is the last bug I could theorycraft. There's a small window before occlusion would update and unsubscribe where a teleport then destroy could leave a dangling set of references, but this doesn't happen because of unnecessary SetParent being called when BaseEntity is destroyed on the server(but this should be fixed separately) Tests: not testable
19 Days Ago
Update: OcclusionGroup - tracked down another false-positive error - left a comment explaining why check was removed Whena player reconnects and reclaims a sleeper with a player in proximity, the eventual network group subscription will try to append to the occlusion group that already contains the reconnected player. Tests: reconnected with a player in vicinity
19 Days Ago
Bugfix: ServerOcclusion - clean up occlusion group refs when retiring groups Fixes false-positive error logs Tests: 2p, 2nd player disconnects while 1st player is in vicinity - afterwards first player walks out then back into to original network cell
19 Days Ago
Update: Update: OcclusionGroups - each members tracks which group refers to it Needed for an upcomign bugfix in OnDestroy and helps detect issues Tests: 2p on Craggy - tested players close, flying far away, teleporting, disconnect-reconnect - logged an extra problem to address
19 Days Ago
Clean: refactored out OcclusionOnDestroy, as it was getitng messy - also added a null check to avoid pooling issues Tests: none, trivial changes
19 Days Ago
Bugfix: OcclusionGroups - ensure sleepers are tracked when player transitions to a different occlusiongroup This is an edge case when being in subscription range of a sleeper - sleeper's group would contain it and player, but player's group would have sleeper missing Tests: moved around in the vicinity of sleeper, checked internal state
19 Days Ago
Bugfix: OcclusionGroups - fix NRE when moving out of group with a sleeper - replaced with a IsVisibleFromFar check - also reworked teleportation logic via IsVisibleFromFar, as that's more correct - also IsVisibleFrom range check was wrong, so fixed that Previous code relied on subscriber to check if move-out-of-bounds occurred, but sleepers don't have a subscriber, so it NREed Tests: moved away from a cell with a sleeper, checked internal state
19 Days Ago
Update: NetworkVisibilityGrid gains IsVisibleFromNear/Far(Group from, Group to) - expose via provider interface Needed for occlusion groups case of moving sleepers (as I can't rely on subscriber check) Tests: testted as part of followup bugfix
19 Days Ago
Merge: from main
19 Days Ago
Bugfix: OcclusionGroups - eagerly clean up occlusion group when teleporting - consolidated occlusion-group leaving logic Caught the bastard - due to over-time nature of subscription updating, there was a window in which the player could teleport and disconnect, leading to a leak of occlusion group and a null participant. Tests: on client, teleport2marker;kill, then separatelly disconnect; then on server run OcclusionValidateGroupson - all's gud
19 Days Ago
Update: minor changes - comment explaining why occlusion group isn't retired - error log for cases where we're unsubscribing from network group but we're not in it's occlusion group - TODO comment outlining a desync between group transitions on the border of subscription range and networkable destruction Tests: none, trivial changes
19 Days Ago
Bugfix: check if occlusion group participant is null when cleaning up occlusion groups Should not be needed, but until I track down where nulls are happening this can prevent other issues Tests: none, trivial change
20 Days Ago
Update: PersistentObjectWorkQueue now gathers a bit more telemetry - also fixes a potential bug with stale data uploading to our backend (another case in ObjectQueue) There's a bug with it being desynced with the rest of the data (it's called last, but in reality is current), will fix later Tests: none, not done yet
20 Days Ago
Update: runtime_profiler - track pre_lateupdate times It's a category with a bunch of unity internal work that can take a non-trivial amount of time. Should make it easier to identify source of degradation. Tests: dryrun of analytics in editor with runtime_profiling 1
20 Days Ago
Merge: from useplayertasks_removegroupoccludee_nre - Bugfix: patch exception from double add of occlusion group member. OcclusionValidateGroups to validate if groups are correct Tests: various 2p scenarios - being close, far, outside of range, teleports
20 Days Ago
Update: add OcclusionValidateGroups servervar - also replaced the conditional log with a logerror, to make sure we spot it - codegen Couldn't reproduce the issue locally, so I'm missing something, including whether it was a false-positive or not. This should help check every bad case and confirm whether the issue is legit or not Tests: used the command in a couple scenarios - players close, players far, players outside of network range, with invis on/off
20 Days Ago
Update: replace throw with a devbuild-conditional error log This is a cirtical code path, so we can't interrupt it or we'll corrupt global state. Think I see where the problem is coming from, will attempt to fix next Tests: none, trivial change
20 Days Ago
Merge: from main
23 Days Ago
Merge: from playerinventory_oncycle_optim - Optim: iterate over cached items with OnCycle callback (instead of searching for them every time). Tests: ran unit tests
23 Days Ago
Optim: ItemContainer.OnCycle now uses cached list of items with a callback - added a perf test of 300 containers with ~10% items with OnCycle callback Goes from 0.179 ms down to 0.074ms(-58%) for 300 player inventories. Real world server's invoke times are 0.97ms for 171 inventories, so might need to move it out of invokes later. Tests: ran unit test
23 Days Ago
Tests: add ItemContainer.TestOnCycle test Tests: ran unit tests
23 Days Ago
Merge: from useplayertasks_removegroupoccludee_nre - Optim: rewrote how we manage occlusion groups to reduce their overall number and added pooling - Bugfix: UsePlayerUpdateJobs 2 - no longer send extra snapshots when players move across network grid Tests: 2p on Craggy - tested all occlusion interactions(fly away-back, hide behind terrain, use helicopter). Tested moving across grid with disconnecting 2nd player and killing them, validated occlusion groups. Monitored pooling via print_memory ListHashSet
23 Days Ago
Bugfix: when player disconnects, ensure we destroy relevant occlusion groups - destroy local group if no local participants present - remove destroyed participant from other occlusion group member's groups Tests: 2p on Craggy in different cells - get 2nd player to disconnect, then kill sleepers. 1st player walks into the cell - no more NREs. Ran usual occlusion checks (fly away and back, hide behind terrain)
24 Days Ago
Optim: use pooling for occlusion groups - prealloc 2k groups in the pool (1 per player and sleeper) Tests: 2p on Craggy - nocliping across various grid cells and checking print_memory stats
24 Days Ago
Optim: ServerOcclsuion - rewrite how we track occlusion groups - also fixes server occlusion bug which sends out more snapshots than necessary Previously every network group in subscription range of player would create an occlusion group. Now, only occlusion-enabled entities populate their local cells (and their subscriber's local cells) - se get activeplayer+sleepers count max of occlusion groups. Tests: both in UsePlayerUpdateJobs 0 and 2, 2 players on Craggy - ran around across network cells, flew outside of network range, used minicopter to fly into network range, checked sleeper is visible, checked kills clean up internal state. Player got occluded over terrain.
24 Days Ago
Merge: from triggerparentdelayedexit_optim - Nothing, this just fixes merge history to avoid showing it as a non-merged branch Tests: none, no files changed
24 Days Ago
Merge: from main
25 Days Ago
Merge: from useplayertasks_invisplayers - Bugfix for invisible player in helis/other vehicles with UsePlayerUpdateJobs 2 Tests: 2p on Craggy, flew heli to player outside of network range 5 times - player was visible
25 Days Ago
Bugfix: UsePlayerUpdateJobs 2 - when player leaves occlusion group, clean up last visibility timestamps - fixed whitespacing after merging messing it up in one of the files This caused negative feedback loop. If EntityQueue doesn't send snapshot during network subscription change (because of OcclusionFrameCache), the ServerOcclusion should send it, but having an expired visibility timestamp meant it didn't send the snapshot (expired == previously visible, so snapshot already sent). Tests: on Craggy with UsePlayerUpdateJobs 2 flew 2 players outside of network range, then made 2nd player fly in a minicopter to the 1st - was visible. Repeated this flight test 5 times - all passed.
26 Days Ago
▅ ▉▆▍█▄▄▊▇▇ ▋▊▉▉▄▊▍ ▉▅▌ ▍▇▋ ▊▍█▉▆▅▊█ ▍▉▍▅ ▅█▌▊ ▆█▇▅▋▉▋▄ █▄▆ ▅▉█▍█▌▋▊▄▄█▌█▊▌▌▄▉█▌ ▅▅▌▍█▊▅▄▄ ▆█▅ ▆▍█▍█▊▉ ▆▇ ▌▋▊▌▊ ▌▉▍ ▋▊█▄▅ ▅▍▋▉ ▉▋ ▋ ▋▉ ▋▊▆▊▉ ▅▍██▍▅█▇▇▅▄▌▋▉ ▅▇ ▉▍ ▄▄▋█ ▆▌ ▄▋▉▊▆▄▄ ▉▄▆▇▍▆▆▉▌▋▌▊▉█ ▊▍▅▊▆ ▆▊▅▉▋▊▋ ▉▇▅▊▌▄ ▇▅▉▌▉▅▅
26 Days Ago
Merge: from triggerparentdelayedexit_optim - Optim: new TriggerParent volume processing mode, controlled by TriggerParent.TickMode (default to 1, old mode is 0). TickMode 1-specific optims controlled by UsePlayerV2Shortcuts and AllowTriggerSleeping switches (both enabled by default) Tests: built boats, sank them while on them, spawned 100 boats with sleepers both with TickMode 0 and 1
26 Days Ago
Update: set TriggerParent.TickMode to 1 by default - codegen Tests: booted up craggy in editor, checked that it's set to 1 and called at boot
26 Days Ago
Merge: from main Tests: compiles
26 Days Ago
Merge: from main Tests: compiles
26 Days Ago
Clean: remove TriggerParentDelayedExit.allow_tick_skipping support - codegen Originally was an optim, but discovered that I had a bug that always stayed disabled. If we need it, I'll reimplement it for TickMode 1 Tests: compiles
26 Days Ago
Update: Tickmode 1 - add allowtriggersleeping optim killswitch - codegen Tests: built a boat, set tickmode 1, checked in profiler what runs. set AllowTriggerSleeping 0, checked profiler - it started running queries
26 Days Ago
Optim: TickMode 1 - allow triggers to sleep if they don't move on specific axis and internal entities also don't move on specific axis - took out internals of BaseEntity.HasMovedInLS to BaseEntity.ComparePos(Vec3 from, to) - Player Boats now set interest in XZ when alive, XYZ when sinking - Buildfix for SERVER only code (whoops) This brings 100 boat test to 0.25ms (down from 1.6ms, -85%), or down from 3.1ms, -92% from TickMode 0 Tests: built a boat, set tickmode 1, jumped on and off - got unparented. turned on the engine, jumped off - got unparented once in the water. noclipped above with engine on - got unparented after a delay. Spawned 100 boats.
26 Days Ago
Update: BaseEntity now remember it's last LS position and can report on which axis it has moved - added unit test for it Needed for upcoming parent trigger optim Tests: ran unit test
27 Days Ago
Optim: reduce branching in BaseEntity.HasEntityInParents Saves a tiny amount (60micros for 600 checks), but the change is relatively trivial and is used in a bunch of places Tests: spawned 100 boats with 3 sleepers
27 Days Ago
▇ ▍▇▋▆▇▉ ▌█▅▉▍▌▅▍▅▌ ▌ ▍▅▆▍ ▅▆▄▆▊▊ ▌▆▆▄▍▅▋▋ ▉▆▊▊▆▊ ▋▍▌▋ ▇█▅ ▋▋▉▆ ▊▋ ▇▋▅▋▄▊▍▍▆▍▉▍▊ █▅▉▉▆▆ ▌▊▅▆▇▆▍▆█ ▅█▊▌▇▇▇▄█ ▉▊▍▇▋▉▍▆ ▋▊▄▄▆▅▇▍▋▅▅█ ▋█▄██▌▋▆ ▊▊ ▆▄ ▄▄▄▊▆▉▌▊▆▄█▆▅█▌▇▇▍ ▉▆▅▉▋ ▄ ▉▉▌▌ ▌▊▊ ▅▇▍▍ ▆▅ ▊▊▆▆ ▉ ▆▊▍ ▌▆ ▄▄█▍▋▄▄ ▍▉▇▍▅▋▊▍▌▉
27 Days Ago
Optim: TriggreParent.TickMode 1 - batch swimming checks 100 boats now take 1.6ms max (down from previous 2.1ms, -24%) vs 3.1ms (-49%) of TickMode 0. Tests: built a boat, sank it by shooting, got unparented
27 Days Ago
Update: expose StableObjectCache internal T[] - had to introduce approx equals to WaterInfo as unit tests were failing (why now?) - consolidated common logic to fix missing shoreline check in batched version (we need unit tests as part of builds) Need it to simplify code around water factor batching Tests: unit tests
44 Days Ago
Update: adding a TODO to enable minor logic caching Tests: none, trivial change