Repository navigation
Relay 4b: the room's entities on the wire, and a client's playout of them - #1336
Merged
Merged
Conversation
…them
The relay now sends the vehicles its document runs to every client:
- Who they are: conference::room_entities writes each one's identity
(name, archetype, plant, controller, team, colours, chassis size, the
archetype's look with a file's name alone) as the room tree's entities
section, conf.rooms.<room>.entities, a revisioned section rewritten
when the vehicles change (WorldVehicles::revision); one that went stays
with present 0, as the room's objects do.
- Where they are: their poses ride the pose stream beside the
participants', under entity pids ("~e<id>": no participant's pid, a
state name, starts with '~'). room_pose_relay::step takes them as extra
subjects, each due at most every entity_interval_ticks (30 Hz), all in
a keyframe; one no longer given is in the next snapshot's gone.
- arisrv: a room_entity_relay per room, stepped before the room's drain
from the server document's SceneWorld vehicles.
- A client: entity_playout, a client holon without physics, so each
entity is played out as a peer avatar is (the holon's peer playout,
no body anywhere). apply_pose_snapshot and apply_pose_samples give it
the entity pids' samples; its pump reads the section when its revision
moves and drops the entities it no longer lists. arigl feeds and pumps
one; drawing them is the next step.
Tests: RoomEntities.TheirPidsAreNoParticipants,
TheSectionCarriesThemAndMarksTheOnesThatWent and
TheRelaySendsThemAndAClientPlaysThemOut (relay to decoder to playout, the
30 Hz rate, an entity that goes); ServerDocumentTest's world test now
runs a room_entity_relay over its live vehicles (seven listed and posed,
rewritten only on a change, six after a removal).
room_view::update_entities draws each entity a client's playout shows (entity_playout, 4b) as a vehicle: vehicle_view's box look (chassis, cabin, four wheels), sized from its identity, in its two colours, posed at its chassis's centre and heading, and named among the labels. Its node is built again when its identity changes and removed when the room drops it; the view's teardown removes them too. A model look is drawn as its box for now: the relay's model files are its own, and the client does not look for the model itself yet. room_entity carries its wheels (wheelbase, track, a wheel's radius) from its vehicle, so the box look's wheels sit where the plant's do. arigl (and ariglx and the web client, which are arigl) calls it each frame after the room view's update. Test: cvcgl_room_view's entities section (no node before a first sample, posed at its centre, a box look with wheels, rebuilt on a new colour, removed when dropped, drawn again on return, torn down with the view).
This was referenced Nov 17, 2026
Relay 4c: clients draw the room's entities
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second step of the relay hand-off, stacked on #1335: the relay sends the vehicles its document runs to every client, and a client plays them out. Drawing them is the next PR.
Change
conference::room_entitieswrites each entity's identity as the room tree's entities section,conf.rooms.<room>.entities. The identity is name, archetype, plant, controller, team, colours, chassis size, and the archetype's look (a file's name alone; the relay's own path means nothing to a client). It's a revisioned section (section.h), rewritten only when the vehicles change (WorldVehicles::revision). An entity that leaves stays withpresent 0, as the room's objects do.~e<id>: a participant's pid is a state name, which can't start with~.room_pose_relay::steptakes them as extra subjects. Each is due at most everyentity_interval_ticks(4 ticks, 30 Hz), and all of them are in a keyframe. One that's no longer given goes in the next snapshot'sgone.room_entity_relayper room, stepped before the room's drain, from the server document'sSceneWorldvehicles.entity_playoutis a client holon without physics, so each entity is played out the way a peer avatar is (the holon's peer playout: delay, easing, extrapolation), with no body in any world.apply_pose_snapshotandapply_pose_samplestake an optionalentity_playout*and give it the entity pids' samples. Itspumpre-reads the section when its revision moves and drops entities the section no longer lists. arigl feeds and pumps one.Tests
RoomEntities.TheirPidsAreNoParticipants,TheSectionCarriesThemAndMarksTheOnesThatWent, andTheRelaySendsThemAndAClientPlaysThemOut. The last covers relay to decoder to playout, the 30 Hz rate, and an entity that leaves.ServerDocumentTest.RunsItsScenesWorldAndItsVehiclesnow runs aroom_entity_relayover its live vehicles: seven listed and posed, rewritten only on a change, six after a removal.Not yet