Skip to content

Ariadne worlds L2: vehicle archetypes, WorldVehicles and vehicle_selector - #1144

Merged
transfix merged 2 commits into
masterfrom
feat/vehicle-archetypes
Nov 11, 2026
Merged

transfix merged 2 commits into
masterfrom
feat/vehicle-archetypes

Conversation

@transfix

Copy link
Copy Markdown
Owner

L2 in ARIADNE_WORLDS.md (sections 14 and 15): a world document's vehicles, spawned into the scene's own physics world in C++, and the lab's vehicle_selector panel with its studio preview. There is no new demo: per the owner, demos wait for L3.

Vehicle archetypes. The top-level world: block lists the vehicles a world offers, as a list of their own beside avatars:, so the relay's avatar (the first avatar archetype) is unchanged:

world:
  vehicles:
    archetypes:
      humvee:
        vehicle: humvee                                    # a preset: humvee, roboracer
        ranges: { mass: [2000, 3500], max_speed: [5, 20] } # what a spawn may set
        controllers: [nav@1, none]                         # the first is a spawn's default
      racer:
        vehicle: { preset: roboracer, max_speed: 6 }       # a preset with overrides
        look: { model: humvee }                            # or file:, asset:, fit:, scale:, yaw:, z:
  • world_rules::vehicles, parsed and checked in world_rules.cpp: plant (jolt; kinematic, dynamic and dynamic4w are accepted but refused at spawn), preset and overrides, look, ranges, controllers (nav@1 or none).
  • AppRuntime now keeps a document's world: block on every host and copies its vehicles into Scene::vehicles.

The runtime: WorldVehicles (world_vehicles.h), one per SceneWorld, with nothing process-wide. A host that runs several worlds (a relay's rooms, RM1 and WD3) runs one each.

  • The same physics world. Each spawn is a Jolt vehicle in the scene's own cvc::physics::world: nav_plant with step_world off, so the world steps once, on the clock. Vehicles collide with the scene's bodies and step with them; each chassis is a body.

  • Controllers. nav@1 drives a vehicle from goal to goal across the grid of the world on: one sim_world, the batch kernel over the entities that use it, as Q9 proposed, with a policy per entity through the runtime's own policy_library. none parks it where it starts.

  • Placing. A spawn starts at a given point or at a free point of the grid. A world switch, a Regenerate or a reload places every entity again on the new ground. sim.restart puts each back where it started, at rest.

  • Identity and settings. Each entity has a name, a team, two colours, metadata, mass and top speed, the settings held to the archetype's ranges. nav_plant::add_desc lets each spawn have its own vehicle description.

  • C++ API: spawn(entity_spec), despawn, clear, entities() (pose, speed, power, energy, wheel load, drag, gear), SceneWorld::bind_vehicles and vehicles().

  • Keys. <prefix>.vehicles.*:

    • the catalog (each archetype's size, mass, power, top speed, wheelbase, look and ranges);
    • selected and selection.* (the selected archetype as a spawn would make it now);
    • the spawn.* keys and their spawn.request, remove.* and clear.request.

    Under <prefix>.entities.* the table. physics.stats.vehicles has a line per vehicle, which world_physics now shows.

Drawing (cvcGL) (vehicle_view.h)

  • On the chassis. Each entity is drawn on its chassis body, posed between steps as the other moving bodies are, and drawn again when the vehicles' revision moves.
  • The real Humvee. A humvee with no look: is the vehicle-humvee package's Humvee.glb, with its texture, when it is installed. find_vehicle_model looks beside $CVC_NAV_BUNDLE, then under share/cvc-scenes in $CVC_PREFIX, $CVCPKG_PREFIX, $CONDA_PREFIX and the program's prefix. The model is oriented and scaled to the chassis as the nav demos' load_vehicle_template does it, without mirroring, and stands on the ground. Anything else, or a humvee without the package, is its chassis box in the entity's colours, with a cabin and wheels.
  • The preview. type: vehicle_preview draws the selected archetype in the spawn's colours on a scene of its own, turning.

The panel: vehicle_selector.ari (args vehicles, entities, scene, view, listed in INDEX.ari) has:

  • the vehicle and its stats;
  • a preview viewport onto a scenes: entry holding a vehicle_preview node;
  • settings within the ranges;
  • controller and policy;
  • name, team, colours and metadata;
  • Spawn;
  • the spawned list, with Remove and Clear.

vehicle_selector_controls is the same without the window.

Panels name their runtime. world_source takes a world: arg (default scene.world) instead of hardcoding it, as world_physics already takes physics:. That lets a room's or a mounted document's panels point at its runtime by an absolute root.

Docs

  • ARIADNE.md: "Vehicles", and world_source's world: arg.
  • ARIADNE_WORLDS.md: the L2 row (built), section 14 as built, Q9's local half.

Tests (Windows Release)

  • ariadne_scene_world_test, 7 new tests (AriadneWorldVehicles.*):
    • the world: block's vehicles and their errors;
    • stats and settings;
    • vehicles driving in the scene's physics world (nav@1 drives off, none holds still on the ground, keys and telemetry, removal);
    • spawning and removing from the keys (settings, identity, refusals, remove, clear);
    • restart and a world switch placing them again;
    • a headless AppRuntime taking a document's vehicles;
    • finding and resolving looks.
  • cvcgl_ariadne_physics test_vehicles_drawn: a spawned vehicle drawn on its chassis and gone when removed; the preview rebuilt when the pick changes.
  • AriadneComponents.VehicleSelectorBindsTheVehiclesKeys, and world_source's world: arg in WorldSourceAndPhysicsBindTheWorldsKeys.
  • Checked by eye with arigl snapshot on a scratch document, which is not shipped: the panel, the studio preview with the textured Humvee, and the Humvee in the world on the ground with a crate landed on it.
  • After a full build, 1,294 of 1,295 related ctest passed ([Aa]riadne|[Nn]av|pycvc_world|pycvc_ari|cvcgl_ariadne|SceneWorld|[Pp]hysics|arigl|[Ww]orld[Rr]ules|room_rules|arisrv). The one failure was the new look test, which did not register the world: block when it ran in a process of its own; it is fixed, and the affected suites then passed, 31 of 31.

Not in this PR

  • A demo document (L3).
  • Spawn points and the minimap (L3).
  • The default worlds' built-in vehicles.
  • The model from a document's data package: the Austin package carries a copy, which pycvc_gl.cars reads.
  • pycvc bindings for the new API (the keys drive it from Python).
  • The relay reading the vehicles (WD3, WD4).

A world document's vehicles (world: vehicles: archetypes:) spawn as Jolt
vehicles into the scene's own physics world, driven by nav@1 (a policy
each) or held still, with identity and settings within ranges. The
runtime (WorldVehicles, one per SceneWorld) publishes vehicles.* and
entities.*; cvcGL draws each on its chassis (the vehicle-humvee package's
Humvee.glb, fitted, when installed) and a vehicle_preview node draws the
selected one. vehicle_selector.ari is the panel; world_source takes a
world: arg; world_physics lists the vehicles.
The vehicle presets and override keys are no longer static tables, and the
fitted vehicle models are the realized scene's (RealizedScene::
vehicle_models) instead of a function-local cache. vehicle_view.cpp's VTK
header static goes on the allowlist, as every other cvcGL file's does.
@transfix
transfix merged commit 4b674d4 into master Nov 11, 2026
27 of 33 checks passed
@transfix
transfix deleted the feat/vehicle-archetypes branch November 11, 2026 07:33
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