Skip to content

Relay 4b: the room's entities on the wire, and a client's playout of them - #1336

Merged
transfix merged 3 commits into
feat/relay-worldfrom
feat/relay-entities
Nov 18, 2026
Merged

transfix merged 3 commits into
feat/relay-worldfrom
feat/relay-entities

Conversation

@transfix

Copy link
Copy Markdown
Owner

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

  • Who they are. conference::room_entities writes 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 with present 0, as the room's objects do.
  • Where they are. Entity poses ride the pose stream beside the participants', under entity pids. These are ~e<id>: a participant's pid is a state name, which can't start with ~. room_pose_relay::step takes them as extra subjects. Each is due at most every entity_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's gone.
  • arisrv. A room_entity_relay per room, stepped before the room's drain, from the server document's SceneWorld vehicles.
  • Client. entity_playout is 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_snapshot and apply_pose_samples take an optional entity_playout* and give it the entity pids' samples. Its pump re-reads the section when its revision moves and drops entities the section no longer lists. arigl feeds and pumps one.

Tests

  • RoomEntities.TheirPidsAreNoParticipants, TheSectionCarriesThemAndMarksTheOnesThatWent, and TheRelaySendsThemAndAClientPlaysThemOut. The last covers relay to decoder to playout, the 30 Hz rate, and an entity that leaves.
  • ServerDocumentTest.RunsItsScenesWorldAndItsVehicles now runs a room_entity_relay over its live vehicles: seven listed and posed, rewritten only on a change, six after a removal.
  • Windows Release: 1,615/1,615 of the pose stream, holon, fast lane, room relay, arisrv, Ariadne and world ctest set pass. Changed lines are clang-format clean.

Not yet

  • Drawing the entities in arigl, ariglx and the web client (4c).
  • An area of interest for entities: every viewer gets every entity.
  • One physics world for avatars and vehicles: the document's world is still separate from the holon's.

…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).
Relay 4c: clients draw the room's entities
@transfix
transfix merged commit 1f5fd39 into feat/relay-world Nov 18, 2026
1 of 6 checks passed
@transfix
transfix deleted the feat/relay-entities branch November 18, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant