Repository navigation
Conference: an energy budget for avatar movement, set by the relay, the same for everyone - #956
Merged
Merged
Conversation
… from the relay's catalog
A client used to draw its own avatar gold and everyone else in a hue derived from their pid, so
nobody saw themselves as others saw them. Every avatar is now drawn from the room tree, the
viewer's own included, and the look can be picked.
- room_avatar.h: the relay seeds conf.rooms.<room>.avatars, a catalog of what avatars may look
like:
- colours: Automatic (the pid's hue, the default) and ten named ones;
- accessories: None (the default), Cap, Top hat, Antenna, Crest, Halo, Backpack, each a few box
or sphere parts posed from the feet and tinted like the body, the visor, or a fixed colour.
- A participant writes its pick to its own participant.<pid>.avatar.{color, accessory}. The write
gate already allows that path and nothing else may write it; only the relay writes the catalog.
- resolve_avatar_look turns a pick into what is drawn. A pick the catalog does not offer draws as
the default. Parts reaching outside an envelope (the 0.5 x 0.5 x 1.7 m body grown 0.15 m
sideways and 0.3 m up), and parts past six, are dropped: what an avatar wears is cosmetic, and
the physics body is the same for everyone.
- room_view resolves every pid's look the same way, re-reads choices a few times a second (as it
does names), and rebuilds a marker when its look changes. avatar_look() reports what a marker
was built with.
- New verbs: (room-avatar-options ROOM KIND), (room-avatar HANDLE) and
(room-set-avatar HANDLE COLOR ACCESSORY), the last refusing what the catalog lacks.
- conference_roster.ari: a My Avatar window (Colour and Wear pickers, also on the View menu). Its
on_tick shows the current look once the catalog arrives and writes a changed pick.
- arisrv seeds the catalog beside the scene.
Tests:
- room_avatar_test: the catalog round trip, seeding once, resolution, the envelope, replication
across three nodes, and the write gate.
- cvcgl_room_view: two viewers draw A identically before and after A picks; the hat sits on the
body and goes when taken off.
…he same for everyone Frame for avatars as look, body, controller and energy (ARIADNE_CONFERENCE_ROADMAP.md §5k). The server supplies every part today. Later a participant picks a server controller (a Jolt vehicle among them) or brings their own body or controller, under the same authority and policy. This change makes the walker the first controller and gives it an energy budget. - avatar_world: the walker pushes with at most force_max (840 N) whatever the mass. That equals the old 12 m/s^2 at the default 70 kg, and a 140 kg body now accelerates at 6. - What each drive costs: the positive work it does on the body, plus carrying the body along at 0.2 m g |v|. Slowing down is free. - The reserve: at most 1.2 kW, from a 30 kJ reserve refilled at 300 W. - What that gives: a 70 kg walker holds 4 m/s for about two minutes on its reserve, and sustains about 2.2 m/s on resting power. - The relay sets what an empty reserve means: rest (only resting power) or stop (no speeding up until a quarter has refilled). - Policy: arisrv --avatar-energy on|off and --avatar-empty rest|stop. It is written to conf.rooms.<room>.avatars.policy, and both pumps read it into their holons, so the relay simulates and each client predicts under the same numbers. - Reserve: the relay publishes each avatar's reserve beside its pose (participants.<pid>.energy, relay-owned in the write gate). The owner's client corrects its prediction by how far it was off at that server tick. A reconcile replay restores the reserve it began from, so no step is paid for twice. - (room-avatar HANDLE) also returns stamina, and the My Avatar window shows it. Tests: - holon_test HolonEnergyTest (6): a heavier body accelerates at half the rate; a fast walk drains the reserve (549 W against 300 W) and standing refills it; rest settles at 2.18 m/s; stop holds until a quarter refills; the budget off; prediction matches the server and takes a correction once. - holon_sync_test: the policy reaches both holons and the published reserve tracks the authority. - room_avatar_test: the policy and a reserve round-trip; the gate refuses a client's write to its reserve.
…r and history
demo3-csma's Ledger & stats screen, for an avatar. The My Avatar window becomes Avatar:
- Look: the colour and wear pickers.
- Body and controller.
- Energy budget: the reserve as a bar, the state ("spending: 549 W at 4.00 m/s") and the
relay's policy line by line (push, power, reserve, carrying, the speed resting power sustains,
what an empty reserve means).
- Ledger: where the reserve went since joining (started with, refilled, work, carried, overflow,
unpaid, corrections, now), the residual that shows the lines balance, bars for each spending
line's share, and distance, time, kJ/km, peak power and time exhausted.
- History: graphs of the reserve and the power over the last minute.
How it works:
- avatar_physics books every line (avatar_ledger in avatar_energy). It balances:
reserve = start + refilled - work - carried - overflow + unpaid + corrections. A relay
correction or a policy change is a line of its own.
- avatar_panel (new) is the window's model, with no GL. update() reads the client holon and the
room tree and keeps the history, a sample every 0.25 s for 60 s. publish() writes text and
numbers under <doc>.self.avatar.*. arigl calls both after client_pump, publishing four times a
second, so every host shows the same.
- A plot: widget for Ariadne: a line graph of comma-separated numbers at a state path, its range
given or fitted, with a caption and a height. ImGui draws PlotLines, which reads out the value
under the mouse; other backends get a text sparkline.
Fixes the pickers, too: a widget's expression may only call pure functions, so the combos' options
(room-avatar-options) never evaluated and the lists were empty. on_tick now publishes the
catalog's labels newline-joined, and the combos split them, as the device pickers do.
Tests:
- holon_test: the books balance after walking and resting, and after a correction (which is its
own line).
- room_avatar_test: the panel publishes the look, body, policy, a spending state, balanced books
and a capped history.
- ariadne_loader_test: plot: parses its range, height and caption.
A widget's expression may only call pure functions, so the combos' options (room-avatar-options) never evaluated and the Colour and Wear lists were empty; the earlier test picked through on_tick and did not see it. on_tick now publishes the catalog's labels newline-joined (avatar.colors, avatar.accessories) and the combos split them, as the device pickers do; each picker shows once its list has arrived.
# Conflicts: # examples/ariadne/documents/conference_roster.ari
on_tick rewrote avatar.colors and avatar.accessories every tick. A list rewritten each tick is re-read every frame, and a picker that drops out for a frame closes its open popup: in the browser the Colour and Wear popups did not open, while the device pickers, written once, did. Compare and write on change, which also spares the per-tick write.
# Conflicts: # examples/ariadne/documents/conference_roster.ari
transfix
enabled auto-merge (squash)
November 1, 2026 09:20
transfix
added a commit
that referenced
this pull request
Nov 1, 2026
Both sides kept: arisrv takes the --lane-* and --avatar-* flags, the CMake list gains avatar_panel.cpp beside the pose stream sources, and server_pump keeps #956's policy sync and reserve writes with #951's write_poses switch. The reserve now goes out every step rather than with the tree poses: the relay writes those only once a second when it streams snapshots, and no snapshot carries a reserve. write_reserve already thins it (half a percent of the reserve, or a 5 s heartbeat).
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.
Stacked on #955 (avatar looks); its diff against
feat/conf-avatar-looksis this change only.The frame (ARIADNE_CONFERENCE_ROADMAP.md §5k)
An avatar is four parts: a look, a body, a controller (what turns intent into forces on the body) and energy (what the controller may spend).
What stays fixed throughout:
This PR makes the walker the first controller and gives it the budget.
What changes
Push. The walker pushes with at most
force_max, 840 N, whatever the mass.Cost. Each drive pays for:
Reserve.
Server policy.
arisrv --avatar-energy on|off.--avatar-empty rest|stop: an empty reserve leaves resting power, or holds the avatar until a quarter has refilled.conf.rooms.<room>.avatars.policy. Both pumps read it into their holons, so the relay simulates and each client predicts with identical numbers.Reserve replication. The relay publishes each avatar's reserve beside its pose.
participants.<pid>.energy; the write gate now makesenergyrelay-owned.Stamina.
(room-avatar HANDLE)also returnsstamina, and the My Avatar window shows it.Testing
holon_testHolonEnergyTest(6): a heavier body accelerates at half the rate; a fast walk drains the reserve (549 W against 300 W) and standing refills it;restsettles at 2.18 m/s;stopholds until a quarter refills; the budget off; the prediction matches the server and takes a correction once.holon_test(37) passes, including the earlier push and re-mass tests.holon_sync_test(18): the policy reaches both holons, and the published reserve tracks the authority.room_avatar_test(6): the policy and a reserve round-trip; the gate refuses a client writing its reserve.avatar energy: on, 840 N, 1.2 kW, 30 kJ refilled at 300 W; empty rests. A client walking at 4 m/s read its stamina as 100, then 96, 91 and 86% (about 250 W net).The Avatar window (user: "a window that shows the user's avatar settings and energy budget and ledger", like demo3-csma's)
My Avatar becomes Avatar, modelled on demo3's Ledger & stats screen:
The books.
avatar_ledger(inavatar_energy) records every line as the walker spends.reserve = start + refilled - work - carried - overflow + unpaid + corrections, and a relay correction or a policy change is a line of its own.avatar_panel(new, no GL) is the window's model.update()reads the client holon and the room tree, and keeps 60 s of history.publish()writes text and numbers under<doc>.self.avatar.*.client_pumpand publishes four times a second, so every host shows the same.A
plot:widget for Ariadne: a line graph of comma-separated numbers at a state path, with an optional range, caption and height.PlotLines, which reads out the value under the mouse.docs/ARIADNE.md.Picker fix (also on #955, merged in here).
options: (room-avatar-options ...)never evaluated, and the lists were empty.on_ticknow publishes the labels and the combos split them.str-concatin a widget).Checked:
holon_test37: the books balance after a walk, a rest and a correction.room_avatar_test7: the panel publishes the look, body, policy, state, balanced books and a capped history.ariadne_loader_test210:plot:parses, and the shipped examples still declare what they need.Deploying
This changes how far people can run in the room, so it deploys only on the user's go-ahead, with #955: a new relay and a new page together.