Repository navigation
Ariadne: a boat node you can drive, and boats drawn with their hulls (D5, D6) - #1316
Merged
Merged
Conversation
…O12) cvc::physics::dyn_boat_plant (OCEAN-AND-WEATHER-ROADMAP.md D4) puts a sim_world's agents on boats (world::add_boat) in a borrowed world that floats them, beside dyn_bike_plant and dyn_4w_plant. Each boat goes in over its agent's start at the draft its hull_mesh gives (float_height); a start with no water under it, too shallow, or a hull that cannot float is refused. Every world step a driver turns nav's bicycle angle and acceleration into set_boat_controls. The throttle takes the acceleration as dyn_driver.h does, over the propeller's thrust at the speed through the water, its trim kept across sign changes since the water holds the boat back either way. The rudder holds the bicycle's yaw rate u tan(delta) / L: a feed-forward share of full rudder and a PI term on the yaw rate's error as a curvature. state()'s steer is the angle the driver holds, not the rudder, which fed the driver's corrections into nav's steering-rate limit. The books are the hull's mechanical energy every step: drive and brake (the thrust's T u_a through the water), rudder, damping, water (the field load and the water's own motion on the propeller and rudder), gravity and the integrator's residual. Presets launch (physics_boat_test's boat; 3.19 m/s, 15.4 m) and jonboat (a 350 kg flat box with a steering outboard; 4.0 m/s, 4.1 m), measured. - plant_host: dynamicboat / dynamicboat:<presets> on set_water's field and the geometry; no water is a fallback to the bicycle. - world::water_at; water_sample moves to field.h. - cvc::nav::plant_medium (land, water) and vehicle_plant::medium(), for spawning boats on water later. physics_dyn_boat_plant_test: the presets' envelopes; 2.5 m/s and 0.08 rad/s held exactly on calm water and within 1 % on a 0.3 m swell; the books' residual 6e-8 to 3.5e-5 of the flow; nav drives a launch and a jonboat 120 m to their goals and turns them round to goals behind them; plant_host; a hosted world bit for bit; a pier contact; the refusals; and the pinned hash 96abfc30fcae4fd4 (Windows MSVC; CI to confirm Linux and macOS). No existing hash moved. pycvc does not bind the plant (it binds no boats yet).
…ut of lakes (L3b)
A world document's vehicles: archetypes: can offer a boat, plant: dynamicboat
(or dynamicboat:launch / dynamicboat:jonboat), and every spawn now follows its
archetype's medium: cars never start in water deeper than a ford, boats only in
water deep and open enough for them.
- nav::world_grid gains a water layer: water_depth (the level less the ground at
each sample, set_water) and solid (what blocks a sample other than a water
surface). medium_grid(g, medium, depth) is a car's grid with water deeper than
a ford blocked, or a boat's with only deep enough water free. SceneWorld::grid
sets the water from a water node over the node's ground, or a generated
world's bodies of water.
- world: spawns: takes ford_depth (0.3 m), keel_clearance (0.3 m) and
shore_clearance (0 m). WorldSpawns::set_needs takes each archetype's medium
(from its plant's vehicle_plant::medium()), a boat's draft
(dyn_boat_plant::draft, the deepest boat's) and half its length.
- choose, add, points() (free, medium) and the free-point fallback use each
medium's grid (ground_for). An untagged point serves only the archetypes
whose medium it is on.
- suggest follows the tag's archetype: roads on land, or water_spawn_points
over the water, spread over each body of water with room.
- WorldVehicles: a dynamicboat fleet (dyn_boat_plant, step_world off) whose
navigator plans on the inverse grid. The boats float on the water node's field,
or on still water at the grid's level that the runtime adds when the world has
none. vehicle_desc_of gives a boat a stand-in (its hull's box, envelope, no
wheels), boat_desc_of its boat, and entity_info its goal.
- A placed start off its medium (a car in a lake, a boat ashore) moves to a free
point of its medium, as a blocked start always has.
- dyn_boat_plant::attach also refuses a start where a ray from the hull's top
meets ground above the boat's deepest point: the field's box alone knows
nothing of the terrain in it.
ariadne_scene_world_test, on a lake 107 m across in a 300 m world:
- 48 humvees and 24 launches over all four policies each start on their medium;
- the any-points serve both, the free-point fallback respects medium, starts off
their medium move, and boat suggestions are over the water;
- a launch on nav@1 reaches two goals across the lake with at least 1.6 m of
water under it;
- without a water node, boats get still water.
nav_world_grid_test covers the water layer and the medium grids.
…(D5, D6)
A scene node `type: boat` puts a boat on a water node's sea: a hull, a
propeller and a rudder (preset launch) or a steering outboard (jonboat) in the
scene's physics world, at its draft on the water there. It drives from its
keys or from nav, headless or drawn, and terrain_lab.ari has a launch on the
big lake beside the crates.
- cvc::ariadne::BoatRuntime (scene_boat.h): a dyn_boat_plant with one boat in
the scene's world (step_world off, stepped around each world step) and a
sim_world of its own on the water's grid, land and water too shallow for it
blocked. SceneWorld runs it (bind_boats) from from_scene and from cvcGL's
realize alike; it goes in once the water's grid is ready.
- Its keys, under its id (or its keys: root): drive (keys / nav), throttle
and rudder, goal ("x,y"), and its telemetry x, y, z, heading, speed, thrust, reached,
placed, status. boat_controls.ari is its helm (Settings > Launch in
terrain_lab.ari).
- dyn_boat_plant::hold_controls / release_controls: a helm in place of the
driver's command for one boat, the books going on.
- SceneWorld learns a renderer-run water node's ground and level from the
scene, so a drawn scene's grids carry the water too.
- SceneWorld::restart forgets the old world's node fields; a scene whose water
node has a body: threw "unknown or removed field id" on restart.
Drawn (cvcGL):
- add_hull_node (vehicle_view): the hull_mesh flat-shaded, white topsides, a
blue stripe just over the waterline and a dark red bottom below it (static,
at the resting waterline). A box hull draws open, with a teak sole 0.12 m
over the waterline. The boat node is its hull bound to the hull body; a
dynamicboat world vehicle draws the same hull in place of the box stand-in.
- The water node keeps its water out of the four boats nearest the camera
(boat nodes and boat world vehicles): eight vec3 and four float uniforms on
its near and far grids (pose; half length, half beam, sheer height; bottom
height), not a texture, since the water already binds 11-12 of WebGL2's 16
texture units. A fragment inside a footprint, under its sheer and over its
bottom, is discarded: a trough deeper than the hull still draws.
- The boat nodes' hulls make waves in the water's wake window.
- GeometryNode::shaderUniformf / shaderUniform3f read a uniform back.
ariadne_scene_world_test:
- a launch on a lake floats at its draft (z -0.85 over a -1 m level); on its
helm it reaches 3.14 m/s and turns 0.90 rad in 12 s; on nav it reaches a goal
60 m off in 96.8 s over at least 1.19 m of water; a restart puts it back;
- terrain_lab.ari's launch crosses the lake to its goal on the 9 m/s sea in
17.8 s over at least 12.4 m of water.
cvcgl_ariadne_physics: the node realizes its hull and is shown, bound and drawn
where the boat floats; the helm moves it 11.0 m and turns it 0.42 rad in 5 s;
the far grid's uniforms hold its footprint, bottom to sheer; a boat world
vehicle draws its hull with no wheels, and the water takes its footprint too.
…t-spawns # Conflicts: # docs/PHYSICS_API.md # docs/roadmap/OCEAN-AND-WEATHER-ROADMAP.md # inc/cvc/ariadne/scene_water.h # inc/cvc/physics/dyn_boat_plant.h # src/cvc/ariadne/scene_water.cpp # src/cvc/physics/dyn_boat_plant.cpp
…into feat/boat-node # Conflicts: # src/cvc/CMakeLists.txt
master fails to build arisrvx's python_engine.cpp: #1302 (bridged users) added room(), bridge_presence(), bridge_absent(), bridge_post() and listen_chat() calling server_link() with no argument, written against the process-wide server link that the P0a cleanup replaced with the module's own state, server_link(PyObject *self). Each of the five now names its module argument self and passes it, as the other server ops (lent(), publish(), ...) already do. Found in #1324's pycvc-linux / cp312 job (run 43956686020), which builds the PR merged with master.
The realize suite runs every node type's checks in one process. In a Linux Debug job (Xvfb, llvmpipe) it took 250.6 s, 50 s under the 300 s a test without a TIMEOUT gets; on a slower runner (#1309's Debug job, where PhConvoy and Ewave also ran about 1.3x longer) it timed out on all three attempts. As cvcgl_ewave, cvcgl_wake and cvcgl_volren_node have, it gets a budget of its own with headroom, so only a real hang fails it.
…ster's arisrvx build
…lize's Debug timeout
…t-spawns # Conflicts: # docs/roadmap/ARIADNE_WORLDS.md # inc/cvc/ariadne/world_vehicles.h # src/cvc/ariadne/world_vehicles.cpp # src/cvc/tests/ariadne_scene_world_test.cpp
…into feat/boat-node # Conflicts: # src/cvc/CMakeLists.txt # src/cvc/tests/ariadne_scene_world_test.cpp
Merged on #1309's final head (9e0760b) as the base, so the squash's copy of #1309 meets this branch's. Conflicts kept both sides: the boat node beside the weather node (registration, terrain_lab's node, panel and menu item, ARIADNE.md's sections and rows), the hulls' uniforms after the foam's, the hull discard after the footprint's derivatives (taken before any branch), and tick_hulls beside start_wake and publish_laps.
…nt after the master merge
…s duplicate goes, its shaderUniform3f stays
transfix
enabled auto-merge (squash)
November 17, 2026 15:27
Both sides kept: bind_boats beside bind_wind (scene_world.h, scene_realize.cpp), the Boats and Wind sections in ARIADNE.md, terrain_lab's boat and wind panels. The Launch panel moves under World to [16, 590]: the right column now holds Sky, Water, Weather and Wind. A boat node's hull is a dynamic body, so the wind's flow field drags on it directly (it is not a world vehicle, so the vehicles' wind push does not reach it).
transfix
added a commit
that referenced
this pull request
Nov 18, 2026
…clients, and they draw them (#1335) * Relay 4a: arisrv runs its document's world, and a world starts with its vehicles ServerDocument no longer empties the parsed scene at load: it keeps a copy for the relay to publish (room_world_from_scene) and lets the load build the scene's world headless, as any runtime without a scene adapter does (SceneWorld: the physics world and bodies, the world sources, the vehicles of world: vehicles:), stepped on the app's world clock at each step(). That world is the document's, apart from the holon's; the entities' table stays under the document's prefix until the relay sends it (4b). A document's init: runs before its world is made, and WorldVehicles ignores a spawn request already set when it starts, so a document could not populate its world at load. world: vehicles: start: lists the vehicles a world starts with (archetype, count up to 256, name numbered per entry, team, controller, plant, policy, at and heading), spawned when the world's vehicles are made (WorldVehicles::spawn_starts). And vehicles.spawn.count spawns that many at one request. Tests: ServerDocumentTest.RunsItsScenesWorldAndItsVehicles (five start vehicles drive under nav@1 on the relay's steps; spawn.count adds two), AriadneWorldVehicles.TheWorldStartsWithItsStartVehicles (parse and its errors, and a headless runtime spawning them). The room scene's physics warning now says where the physics runs. * Relay 4b: the room's entities on the wire, and a client's playout of 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). * Relay 4c: clients draw the room's entities 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 4d: a stock server world with vehicles, and a client seeing them end to end - cvc://worlds/traffic.ari: a stock server world (arisrv --doc): a 160 m ground, twelve blocks on a grid of streets, and eighteen vehicles it starts with (world: vehicles: start:) driving under nav@1. The blocks are plain boxes, so the room publishes them and clients draw them. - arisrv --doc takes a cvc:// URI (the file libcvc installs), and says how many vehicles its document's world runs. - RoomRelayLoopbackTest.AClientSeesTheServerWorldsVehiclesMove: the loopback relay runs the pose stream with the room's entities as arisrv does (relay_options::pose_stream), and a client applying its snapshots with an entity_playout sees the server document's six vehicles listed, posed and moving, within 3 m of where the relay has them. - ServerDocumentTest.TheStockTrafficWorldRuns (all eighteen placed, most driving) and the arisrv_doc_vehicles ctest. - ARIADNE_WORLDS.md: WD3 started; §14 "On the relay", the start: list, the corrected "do not steer around each other" note, and the stale "boats drawn as hulls" note replaced (#1316 drew them). * tests: ariadne_scene_world_test gets 900 s on slow Debug runners The boat node's tests (AriadneBoatNode.FloatsSteersFromItsKeysAndNavTakesItToItsGoal and NavTakesTerrainLabsLaunchAcrossTheLake) took 156 and 77 s in master's Debug package job before #1318's inertial fluid, and ran past ctest's 300 s in #1335's, which builds on it; the crate drifting in the scene's wind timed out once there too. The binary's tests get 900 s, as the segmentation action test has. * Clients draw a room entity's model, and the tactical boat's model is its default look Clients watching a server world drew every entity as its box look. Now a room entity's model look (a file's name: Humvee.glb, TacticalBoat.glb) is drawn from the client's own copy, which find_vehicle_model finds in its cvcpkg packages, fitted to the chassis and set on the ground under it; one it has not installed is drawn as its box. - vehicle_view: make_vehicle_model_cache() and attach_vehicle_model(), the fitted-model path vehicle_view already uses, for other views (the lsystem_coast session's boat node adds the same two, byte for byte). - room_entity.base_z: the ground under the chassis's centre, relative to it, where a fitted model's base goes. - room_view: each entity's model look resolved locally, the box when it is not there or does not read; its own model cache. - find_vehicle_model: a name without an extension is its .glb (TacticalBoat: TacticalBoat.glb, as the vehicle-tactical-boat package installs it beside Humvee.glb). - resolve_vehicle_looks: a boat on the "tactical" preset (which the lsystem_coast session's PR adds) defaults to the TacticalBoat model, fitted, as a humvee defaults to Humvee.glb. Tests: LooksAreFoundWhereTheyAre (TacticalBoat by its name and its file's, the tactical preset's default look); cvcgl_room_view (a model look the host has not installed is drawn as its box).
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 #1309 (
feat/boat-spawns, boats as world vehicles), which is stacked on #1306 (feat/boat-plant). Its base isfeat/boat-spawns; it will be rebased onto master once those merge.OCEAN-AND-WEATHER-ROADMAP.md D6 and D5: boats you can see and drive in Ariadne. A scene node
type: boatputs a boat on awaternode's sea. You drive it from its keys or send it to a goal by nav, with or without a renderer. Drawn, it shows its hull, the water stays out of the hull, and its hull makes waves.terrain_lab.arihas a launch on the big lake beside the crates (Settings > Launch).What changed
The node (
inc/cvc/ariadne/scene_boat.h,src/cvc/ariadne/scene_boat.cpp)type: boattakespreset:(launch: a 4 m box hull of 900 kg with a shaft propeller and a rudder;jonboat: a 3.6 m flat box of 350 kg with a steering outboard),mass:andmax_speed:over it, andwater:(the water node it floats on; the scene's first by default). Its transform gives its x, y and heading. It floats at its draft on the water there, and the sea's height is its z.BoatRuntimeruns it:dyn_boat_plantwith one boat in the scene's physics world,step_worldoff, stepped around each world step;sim_worldof its own on the water's grid (medium_grid(water, draft + 0.3): land and water too shallow for it blocked).SceneWorldowns the runtimes (bind_boats), so the headless path (from_scene) and the drawn one (cvcGL'srealize_scene) run the same code. A boat goes in once the water's grid is ready.keys:root):drive:keysornav;throttleandrudder, each −1 to 1 (+ rudder turns left), used underdrive: keys;goal("x,y", world metres, seeded fromgoal: [x, y]), used underdrive: nav;x,y,z,heading(degrees),speed(m/s through the water),thrust(N),reached,placed,status.boat_controls.ari(new component) is its helm: drive, throttle, rudder, goal and the telemetry.dyn_boat_plant::hold_controls/release_controls/held(new): a helm for one boat in place of the driver's command from nav. The books keep running.SceneWorld (
scene_world.h/.cpp)from_scene's own water runtimes give theirs. A drawn scene's grids now carry the water too, which also feeds Ariadne: boats as world vehicles, and spawns by medium so cars stay out of lakes (L3b) #1309's spawns by medium.restart()now forgets the old world's node fields. A scene whose water node has abody:threw "field: unknown or removed field id 0" on restart.Drawing (D5) (
vehicle_view.h/.cpp,boat_node.cpp)add_hull_nodedraws a boat'shull_mesh, flat-shaded:physics_scene_binding) once the boat is in the world, and hidden until then.dynamicboatworld vehicle (from Ariadne: boats as world vehicles, and spawns by medium so cars stay out of lakes (L3b) #1309) draws the same hull in its colours, in place ofvehicle_desc_of's box stand-in.No water inside the hull (D5) (
water_node.cpp)vec3and fourfloatuniforms:uHullP0..3(x, y, heading),uHullE0..3(half length, half beam, sheer height) anduHullB0..3(bottom height). A fragment inside a footprint, under its sheer and over its bottom, is discarded. Green water over the sheer still draws, and so does a trough deeper than the bottom.GeometryNode::shaderUniformf/shaderUniform3fread a uniform back (for the test).Documents
terrain_lab.ari: alaunchboat at (0, 170) on the lake, goal (40, 150), with aboat_controlswindow under Settings > Launch.docs/ARIADNE.md: "Boats", and aboat_controlsrow in the components table.docs/roadmap/OCEAN-AND-WEATHER-ROADMAP.md: "As built (D5, D6: a boat in Ariadne)" under D6. The Status line is untouched.Decisions
BoatRuntimelives incvc::ariadneandSceneWorldruns it, so a headless run and a drawn one move the boat the same way, and the tests drive it without a renderer. The cvcGL node only draws it and binds late to the hull body.How it was checked (Windows 11, MSVC Release, Jolt)
ariadne_scene_world_test, newAriadneBoatNode.*(2):FloatsSteersFromItsKeysAndNavTakesItToItsGoal, headless on a lake 107 m across:NavTakesTerrainLabsLaunchAcrossTheLake:terrain_lab.arirun headless. Its launch floats on the lake beside the crates, on the 9 m/s sea and 0.8 m swell. Nav takes it to its goal 45 m across the lake, clear of the crates, in 17.8 s, never over less than 12.4 m of water.cvcgl_ariadne_physics, newtest_boats_drawn:vehicle_1_hullwith no wheels, and the water takes its footprint too.Looked at (arigl snapshot, offscreen):
terrain_lab.ariat 1280 × 720 after 5 s: the launch among the crates on the lake, with their wake rings.Suites run, all pass, rebuilt after the last change:
ariadne_scene_world_test(44),ariadne_runtime_test(281),ariadne_loader_test(238),world_rules_test(7),cvcgl_ariadne_physics,cvcgl_ariadne_realize,physics_dyn_boat_plant_test(11; its pinned hash unchanged),physics_boat_test(10),physics_plant_host_test(5),nav_world_grid_test(8). Changed lines are formatted with git-clang-format.Not done or not checked