Region crossings: tune the handoff (neighbour child agents, border zone, crossing smoothness) #850
Labels
No labels
amd
avatars
bug
builder
cannot-reproduce
crash
epic
feature
from-viewer
gl-removal
known-limitation
monitoring
parity
perf
platform
priority
critical
priority
high
priority
low
priority
medium
provenance
rendering
rt
status
in-progress
status
testing
status
up-next
triage
ui
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sky_line/Slipstream#850
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Make region crossings (walking, flying, vehicles, and teleports to a neighbour) as close to seamless as the protocol allows.
Background
Near a border, neighbouring regions are supposed to already know your avatar as a child agent:
If we aren't establishing or keeping that state the way the simulators expect, crossings pay for setup at the worst moment. Examples: connecting late, our network draw distance pruning a neighbour we're about to enter, a missing or late
AgentUpdateto the neighbour, or a slowCompleteAgentMovementafterCrossedRegion.Investigate
EnableSimulator/EstablishAgentCommunication,CrossedRegion,CompleteAgentMovement, agent updates to neighbours, camera / draw distance rules), and how our viewer behaves today, including the region ring and network draw distance, and the crossing-keep logic.Done when
Handoff investigation (code read, 2026-10-18)
Short answer: mostly yes, the core handoff matches what the simulators expect. There is no "we drop the region we're about to enter" bug in the default setup. Five places weaken or can break it; fixes ranked below. No crossing has been captured in a log yet, so timings are still to be measured.
What we already do right
EnableSimulatorarrives. They skip the ring cap, pacing and draw-distance rules.EnableChildAgents/ChildAgentDataUpdate, and the SL wiki "Adding neighbor region sequence" page, where the viewer keeps sending AgentUpdate to the host.CrossedRegionwe sendCompleteAgentMovementfirst thing. We keep the existing region object, and a duplicate seed cap doesn't reset caps or the event queue.CompleteAgentMovement/AgentMovementComplete. The origin-shift frame is no longer O(N) (#568). Live neighbours are only dropped when they're dead.Where we weaken or can break the handoff
EstablishAgentCommunicationand the seed cap arrive; the SL wiki notesEstablishAgentCommunicationsometimes arrives about a minute late. The asset storage path also suspends all generic asset requests (animations, sounds) while the agent region's caps are pending, even though the previous asset URL still works. The mesh path already falls back to the previous URL.CrossedRegionnever sets up a circuit for the destination. The teleport path sendsUseCircuitCode; the crossing path doesn't. If the destination isn't connected,CompleteAgentMovementis dropped as "unknown circuit" and the crossing hangs; OpenSim waits 30 s for ourUseCircuitCode, then fails the crossing. Moving the anchor also discards the destination's stashed host and seed. It can happen in two ways:SlipstreamMaxRegionRing=0: the ring check runs before the core exemption, so neighbours are never connected. Debug setting only, and its comment ("crossings then connect only at the border") is wrong.CrossingKeepexpired=already counts it.Fixes, ranked by impact and risk
clamp(speed × ~8 s + 64, 256, SLNetDrawDistanceMax)and ramp it down instead of snapping. High impact for vehicles and fast flight, low–medium risk; the 25-region cap still bounds the connected set.CrossedRegion. If it doesn't, callconnectSimulatorbeforeCompleteAgentMovement. Keep the stashed seed instead of discarding it, and log each case as "destination not pre-connected". Low effort, low risk.Measurement plan
Extend
Crossing568rather than adding a new tag. AtCrossedRegion, add:dest_pre=: how long the destination has been connected, whether the handshake reply was sent, whether caps and the event queue are up, orNOT_CONNECTED;far_sent=,speed=and the fast-mode flag;first_full_frame=afterAgentMovementComplete.These existing logs already help:
control_restored, attachment arrival times, frame timings, thekeep(#607)line, theCrossingKeepcounters,#RegionRingconnect/drop lines and#NetDrawDistanceFar changes.Test runs: the same border, at least 5 crossings per case, before and after each fix. Cases are walking, normal flight, boosted flight, a land vehicle at about 20–30 m/s, and a boat or aircraft at about 40–60 m/s including a corner crossing. A/B
SLNetDrawDistanceFlightMinat 192, at 0 and with the lead-time rule.Done when:
dest_preis always connected with caps;re-created avatars=0in steady crossings.Shipped in 1.4.0 Beta 1. Closing; reopen if it misbehaves.