Skip to content

OW6c: avatars that are vehicles (picked beside the look); first-person mouse look - #1420

Merged
transfix merged 34 commits into
masterfrom
feat/one-world-avatar-vehicle
Nov 22, 2026
Merged

transfix merged 34 commits into
masterfrom
feat/one-world-avatar-vehicle

Conversation

@transfix

Copy link
Copy Markdown
Owner

OW6c of ARIADNE_WORLDS.md §18.6: an avatar can be a vehicle, and mouse look is first person. Stacked on #1417 (OW6b).

This is ARIADNE_CONFERENCE_ROADMAP.md §5k phase 3 for vehicles. It builds on the avatar choice that already exists: a participant's look (participants.<pid>.avatar.{color, accessory}, the Avatar window's Colour and Wear) now has a body choice beside it.

Avatars that are vehicles

  • World rules: a world: avatars: archetypes: entry may name one of the world's vehicle archetypes:
    avatars:
      archetypes:
        person: { controllers: [walker@1] }
        rover: { vehicle: rover }
    • The vehicle must be defined under vehicles: archetypes:.
    • world_rules::avatar() (the body every person has) is now the first archetype that is not a vehicle.
    • find_avatar is new.
    • The room's archetypes section carries vehicle.
  • Choosing: a participant writes participants.<pid>.avatar.archetype. Until it does, it has the first archetype.
    • Verbs: room-archetypes, room-set-archetype and room-archetype.
    • The baseline conference document (conference_roster.ari) gains a Body combo beside Colour and Wear. It shows only when the world offers more than one archetype, with a note when the relay refuses a pick.
  • Server: server_pump calls serve_archetype → holon::set_archetype for each participant, and answers in the relay-owned archetype_status. For a vehicle archetype it:
    • spawns the vehicle where the person stands, facing the person's way;
    • seats the participant in it for good. The participant can't get out or into another vehicle (get_in refuses with a reason).
    • The vehicle goes when the participant leaves the room or picks a person again; the person then stands beside where it was.
    • A world whose first archetype is a vehicle makes every newcomer one without asking.
  • Room entities carry avatar, the participant whose body the vehicle is. drive_target doesn't offer anyone that vehicle, and arigl shows its owner no get-out prompt.
  • Demo: traffic.ari offers a rover body.
  • Not yet: person bodies that differ by archetype. Everyone who walks still has the first person archetype's body.

Mouse look is first person

  • Walking under mouse look, arigl puts the camera at the walker's eyes (0.92 of the body's height) and hides its own avatar, so W walks where you look.
  • The Controls window gains "Mouse look in first person" (MouseControls::first_person; arigl seeds it on). Turning it off gives back the over-the-shoulder view.
  • Driving keeps the chase camera.

Tests

  • AriadneOneWorld.AnAvatarCanBeAVehicle:
    • a person until it asks;
    • asking spawns the vehicle where the person stood and seats the participant;
    • it drives;
    • getting out, and getting into another vehicle, are refused;
    • an unknown archetype is refused and nothing changes;
    • back to a person: on its feet beside the vehicle, and the vehicle goes;
    • a first-archetype vehicle makes a newcomer one without asking;
    • no one else gets into it, and it goes with its owner.
  • WorldRulesTest.AnAvatarArchetypeMayBeAVehicle: parsing, avatar() and the errors; the section round trip also carries vehicle.
  • RoomAvatar.TheBodyVerbsPickAnArchetype: the three verbs, under the caller's own choice, with the relay's answer and a refusal.
  • ControlsWindowShowsTheHostsMouseSettings covers the new checkbox.
  • The related suites pass locally: 345 tests (Ariadne runtime, app runtime and FTXUI, room avatar, world and room rules, one world, holon, room intrinsics, control schemes, server document, room entities, cvcgl_room_view, cvcgl_camera).

Not verified

  • Live session: not run with arisrv plus arigl. That leaves unchecked the Body combo in a real Avatar window, a rover spawned under a real relay, and the first-person camera.
  • Document check: this local build has no conference transport, so arigl check can't load the conference document. Its DSL was checked against the stdlib names (string.contains, str-concat), and the verbs it calls are tested.

…7 quanta

ARIADNE_WORLDS.md section 18.1 (owner, 2026-11-19: "7 quanta"). Every host
runs the holon's 1/120 s quantum, physics a step a quantum, and the
navigator's tick is 7 quanta (0.0583 s), the nearest whole tick to the
0.06 s the shipped policies were trained at.

- sim_tick.h: kSimQuantum 1/120 s, kSimTickQuanta 7, kSimTick from them;
  adopt_sim_clock puts a fresh clock on the catch-up even at the quantum.
- pycvc: SIM_TICK_QUANTA; cars.py's fallbacks; the gym, swarm and
  sim_thread defaults follow kSimTick.
- NavPlantConvergence.PoliciesHoldTheirReachAtTheSimulationTick
  (CVC_NAV_TICK_AB=1): the shipped and default policies on Jolt
  RoboRacers at 0.06 s, the simulation tick and 0.05 s over 24 s.
The plant host's own default stays 0.01 s, where navigators at the
trainers' 0.06 s run; the cars template and the scene swarm, which tick
cvc::kSimTick, give their plant_host a 1/120 s world. The nav lab's
retarget lands on the first tick at or past 3 s.
0.01 s for a tick of whole 0.01 s steps (every score so far), the
simulation quantum for one of whole quanta (cvc::kSimTick), else the step
nearest 0.01 s that divides it.
ARIADNE_WORLDS.md section 18.2. holon::attach_world(SceneWorld *) moves
the avatars into a server document's physics world, beside its bodies and
vehicles, and steps that world on the holon's clock: SceneWorld::follow
gains per-step hooks, the avatars driven just before each step and read
after it. A car shoves an avatar; the avatar takes some of its momentum.

- avatar_world over a shared world it does not own: its owner steps it
  and owns its gravity, air and statics; release() and move_to() (a
  world its owner replaced).
- AppRuntime::set_world_external: the runtime stops stepping a world a
  holon runs.
- arisrv attaches the server document's world to the room's holon.
- AriadneOneWorld tests: a Humvee driven into a standing avatar carries
  it down the road and ends behind the same run without it; attach
  refuses a client, a holon without physics and a world on another step;
  avatars stand on the scene's own bodies; detach puts them back.
ARIADNE_WORLDS.md section 18.4. WorldVehicles::set_movers: other things
in the world the navigators steer around while avoid is on, as foreign
agents to each fleet's separation. A holon running the world sets them to
its avatars before each step, and clears them when it leaves. A car on
nav@1 swings 3.1 m past a person standing in its lane and drives on;
without avoiding it carries them 34 m (AriadneOneWorld).
ARIADNE_WORLDS.md section 18.4. holon::entities() lists every mover in the
holon's world: each participant's person and the attached world's
entities, with kind, controller, driver, owner and policy.
holon::set_driver(pid, entity) puts a participant in a world vehicle: its
person leaves the world (feet and reserve kept), its intent's new drive
axes (avatar_intent::steer, accel; intent.steer/accel on the wire)
replace the vehicle's command each frame, and its state and display pose
are the vehicle's. Getting out puts the person at a clear point beside
the vehicle and gives the vehicle back to its controller.
WorldVehicles::set_driver / driver; the room's entities carry driver.
# Conflicts:
#	docs/roadmap/ARIADNE_WORLDS.md
#	src/cvc/tests/ariadne_scene_world_test.cpp
…40 steps

master's #1384 (fleets) wrote it at the 0.01 s step; with #1378's 1/120 s quanta 240 steps are
2.0 s, and the fleet, from rest at about 1.75 m/s^2, makes 4.35 m of the 5 m it asks for. 2.4 s
(288 steps) makes 6.1 m.
…bcvc into feat/one-world-avoid

# Conflicts:
#	src/cvc/ariadne/world_vehicles.cpp
#	src/cvc/tests/ariadne_scene_world_test.cpp
…bcvc into feat/one-world-entities

# Conflicts:
#	src/cvc/ariadne/world_vehicles.cpp
#	src/cvc/tests/ariadne_scene_world_test.cpp
…g in by asking

avatar_intent's drive axes are now shares of the vehicle's envelope: steer of its lock,
throttle [-1, 1] (negative is reverse), brake [0, 1]; the server scales them by the
driven vehicle's max_steer/max_accel/max_decel (holon::drive_command). The brake stops
the vehicle and never backs it up; reverse brakes a car still rolling forward, then
backs it up; a boat has no brake and reverses on its propeller astern. On the wire:
intent.throttle, intent.brake, intent.jump (intent.accel is gone).

The walker jumps (avatar_intent::jump) at its controller's jump_speed (4 m/s by
default) when something is under its feet, paying the jump from its reserve.

Getting in is asked for in the room: participants.<pid>.drive = "<seq>:<entity>",
answered by server_pump in drive_status and driving (relay-owned). holon::get_in holds
it to the world's rules: the archetype's drivable: and reach: (3 m from its chassis
box). room-drive / room-driving verbs; room entities carry drivable, reach, controls.

controls.h: control schemes walk, car and boat with their own bindings (Space jumps a
walker, brakes a car; E held 0.4 s gets in and out), and a resolver with steering
ramps and hold-to-fire.
… camera; docs

arigl's room controls come from the scheme of what we control: walking (avatar.keys, plus
Space to jump, V for mouse look, E held to get in), or the car's or boat's scheme while
the relay says we drive (controls.<scheme>.<action>; all of them in the Controls window).
The nearest drivable vehicle in reach (drive_target, the one ahead first) gets a prompt
over it, "E  Drive <name>", whose ring fills as E is held; a refusal is shown for a
moment. Driving, client_pump plays our own pose out from the relay's samples instead of
predicting it, room_view hides every driver's marker (set_riders), and the camera swings
behind the moving vehicle.

traffic.ari's trucks are drivable. ARIADNE_WORLDS 18.6 describes the schemes, the shares,
the jump and the ask; OW6 is started.
A control binding's pad inputs are read now: buttons by position (A, B, X,
Y, LB, RB, ...), the triggers LT and RT, and stick halves (LeftY-, LeftX+).
Each has a deadzone; an action is its keys' value or its gamepad's, the
larger, and only a key's steering ramps.

Defaults: walk on the left stick (as fast as pushed), look around on the
right, jump A, get in and out on X held; driving, the left stick steers,
RT is the throttle and LT the brake, LB a car's reverse (a boat's is LT).

cvcGL's SdlGamepad reads the first gamepad SDL finds. arigl feeds it to
the resolver, faces where the camera looks while the gamepad is in use,
turns the camera with the right stick, and names the pad's button in the
get-in prompt. room_view gains intent_from_axes for the analog walk.
A KeyBinding can name its gamepad inputs and where they live (pad,
pad_path). The Controls window shows them in a column of their own with
a Change button: the next gamepad input pressed becomes the new binding.
Keys are ignored while it waits, and Escape keeps the old one.

Runtime::post_pad_press takes the newly pressed gamepad inputs.
SdlGamepad::pressed() lists them each frame (a button gone down, a
trigger or stick half past half way).

arigl's input pump now owns the gamepad: it posts the presses to the
runtime and hands the gamepad to the room's controls, except while the
window waits for a button. Each avatar and vehicle action lists its
gamepad default, seeded at <viewer>.pad.<scheme>.<action>.
world: avatars: archetypes: entries may name one of the world's vehicle
archetypes (vehicle: rover). This is §5k phase 3 for vehicles.

- Choice: a participant picks an archetype under the existing avatar
  choice subtree (participants.<pid>.avatar.archetype, beside color and
  accessory); until it picks, it has the first.
- Server: server_pump rules on the choice (holon::set_archetype) and
  answers in the relay-owned archetype_status. For a vehicle it spawns
  it where the person stands and seats the participant for good: no
  getting out or into another, and the vehicle goes when the participant
  leaves or picks a person again.
- Rules: world_rules::avatar() is now the first person archetype;
  find_avatar is new.
- Room: the archetypes section carries vehicle, and room entities carry
  avatar (whose body it is). drive_target skips such vehicles, and arigl
  shows its owner no get-out prompt.
- Verbs: room-archetypes, room-set-archetype, room-archetype. The
  baseline conference document gains a Body combo beside Colour and
  Wear.
- traffic.ari offers a rover body.
Walking under mouse look, arigl puts the camera at the walker's eyes
(0.92 of its body's height, 5 cm behind them) and hides its own avatar,
so W walks where you look. The orbit distance comes back when mouse look
ends.

The Controls window gains "Mouse look in first person"
(MouseControls::first_person, arigl's camera settings.first_person,
seeded on). Turning it off gives back the over-the-shoulder view.
Driving keeps the chase camera.
…/one-world-drive

# Conflicts:
#	docs/roadmap/ARIADNE_WORLDS.md
#	inc/cvc/ariadne/avatar_sim.h
#	inc/cvc/ariadne/holon.h
#	src/cvc/ariadne/holon.cpp
#	src/cvc/ariadne/holon_sync.cpp
#	src/cvc/tests/ariadne_scene_world_test.cpp
…/one-world-gamepad

# Conflicts:
#	docs/roadmap/ARIADNE_WORLDS.md
#	inc/cvc/ariadne/controls.h
#	src/arigl/main.cpp
#	src/cvc/ariadne/controls.cpp
#	src/cvc/tests/holon_sync_test.cpp
Base automatically changed from feat/one-world-gamepad to master November 21, 2026 22:26
cy-pca/cvcpkg#633 published numpy-cp312 2.4.6+cvc.7, its wasm and wasm-mt extensions rebuilt with
-fwasm-exceptions. libcvc still links with Emscripten's JS exceptions until JX2 (#1409), so
ariglx-web's link failed on "undefined symbol: __cpp_exception" in _multiarray_umath. The
pre-JX1 pin puts back cvc.6, as it does for boost, libpng and the rest; JX2 deletes it.
@transfix
transfix merged commit 7d4d07d into master Nov 22, 2026
31 checks passed
@transfix
transfix deleted the feat/one-world-avatar-vehicle branch November 22, 2026 09:32
transfix added a commit that referenced this pull request Nov 22, 2026
Brings in master through 08a7386 (#1413, #1430, #1446, #1420, #1447, #1435). No conflicts; nothing in it touches state_exec.
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