Skip to content

ariadne: world_source and world_physics, the lab's world panels (L1) - #1123

Merged
transfix merged 4 commits into
masterfrom
feat/world-source
Nov 10, 2026
Merged

transfix merged 4 commits into
masterfrom
feat/world-source

Conversation

@transfix

Copy link
Copy Markdown
Owner

L1 in ARIADNE_WORLDS.md (sections 14 and 15): the lab's two world panels, world_source and world_physics, built on the world runtime L0 made. This PR is stacked on #1120 (L0's grid, which world_source publishes) and is based on its branch; it goes to master once #1120 merges.

A scene's worlds. world: <name> on a node makes it part of a world the scene can be: a generated_world node, a data node (a city bundle), a terrain, or a flat ground. The scene's world: block picks the one on at the start, and a cell gives the navigator's grid of it:

scene:
  physics: {}
  world: { source: generated, cell: 4 }
  nodes:
    - { node: land, type: generated_world, world: generated, body: {} }
    - { node: hill, world: terrain, source: { heightfield: ... }, body: static }
    - { node: square, world: flat, source: { box: { size: [200, 200, 1] } }, body: static }
  • One world on at a time. SceneWorld::bind_worlds takes the world nodes from the scene and keeps the other worlds' bodies out of the physics world, headless or drawn. Writing <prefix>.scene.world.source switches at the next sync; set_world(name) does the same from C++. Restart rebuilds only the world on.
  • What it publishes. Under scene.world:
    • sources, node and kind (generated, data, terrain or flat);
    • ready, once the world has its world;
    • rev, which goes up on a switch, a Regenerate or a reload;
    • status;
    • on.<node>;
    • with cell:, grid.{rows, cols, cell, occupied, summary} of the world on.
  • Drawing. SceneWorld::grid now covers a terrain node (from its height field) and a flat ground (an open walled grid over its footprint; cvc::nav::flat_grid over an extent). The loader binds each world node's visible: to scene.world.on.<node> unless the node binds its own, starting as the world on does, so cvcGL draws only the world on.

Physics on and off (Q11 as proposed). physics.enabled, seeded 1, turns the stepping off and on. While it is off, the steps due are dropped: the world holds still and the clock runs on. Turned back on, it carries on from where it stopped without catching up. The telemetry gains physics.stats.step_ms_history (the last 120 step times, for a plot:) and physics.stats.nodes (a line per node: its bodies and the ones awake).

The panels (src/cvc/ariadne/components/, both listed in INDEX.ari):

  • world_source.ari (args keys, data, as):
    • the Source combo, the world's status, revision and grid, and a note while it is not ready;
    • for a generated world, world_controls' widgets (now also the world_settings group) with Regenerate and progress;
    • for a data world, its loading progress, where it came from, and a bundle path with Load (data-load into the same dataset);
    • world_source_controls is the same without the window.
  • world_physics.ari (arg physics):
    • Physics on, Paused, Speed, Step and Restart;
    • tick, time, bodies, awake, contacts, step time and its plot, and the bodies by node;
    • world_physics_controls is the same without the window.
  • Per-vehicle energy and forces wait for L2's archetypes; there are no vehicles in a scene world yet.

A demo. examples/ariadne/documents/world_lab.ari has the three worlds above, with a crate and a ball falling on whichever is on.

arigl world_lab.ari

Docs

  • ARIADNE.md's physics section: telemetry, "Physics on and off", and "Worlds".
  • ARIADNE_WORLDS.md: the L1 row (built), and Q11.

Tests (Windows Release)

  • ariadne_scene_world_test, 3 new tests:
    • the loader's world: parsing and visibility binds;
    • three worlds switched by the key and by set_world, with bodies, keys, revisions, grids, an unknown name warned once, and restart;
    • physics off holds the world still, back on it carries on, and the new stats.
  • cvcgl_ariadne_physics test_worlds_drawn: a drawn scene draws and collides only the world on, and switches both.
  • AriadneComponents.WorldSourceAndPhysicsBindTheWorldsKeys: the panels' binds and args. ShippedComponentsLoadClean covers both files.
  • arigl snapshot of world_lab.ari on each world: checked by eye. The generated world reported ready with its grid; the terrain and the flat square each drew alone, with the crate and the ball resting on them.
  • After a full build, the related ctest suites pass: 1,279 of 1,280 matching [Aa]riadne|[Nn]av|pycvc_world|pycvc_ari|cvcgl_ariadne|SceneWorld|[Pp]hysics|arigl. The one failure was the demo listing gl.scene as optional, which is fixed in the last commit; AriadneComponents.* then pass. A headless run through pycvc AriApp switched worlds and moved the bodies, and AriApp.grid gave the flat square's grid.

Not in this PR: a web gallery card for world_lab (it needs a thumbnail); per-vehicle energy and forces (L2).

cvc::nav::world_grid turns any world (a generated world, a data bundle's
city, a flat square) into the grid sim_world plans on: world_planes'
occupancy walled at the edge, the terrain's height, the signed distance,
free points drawn the same way on every platform (splitmix64), and a
sim_world config. SceneWorld::world_geometry / grid give a generated or
data node's world and its grid, made once per world revision; pycvc's
nav_world_grid and AriApp.grid. L0 is done.
A node's `world: <name>` makes it one of the scene's worlds (a generated
world, a data bundle's city, a terrain, a flat ground), and the scene's
`world: { source, cell, half }` picks the one on. SceneWorld::bind_worlds
keeps the others out of the physics world, drawn or headless, and
publishes <prefix>.scene.world.*: source (write it to switch), sources,
node, kind, ready, rev, status, on.<node> (which the loader binds each
world node's visible: to) and the grid of the world on. physics.enabled
turns the stepping off (the world holds still) and on; physics.stats
gains step_ms_history and nodes. world_source.ari and world_physics.ari
are the panels; world_controls' widgets are world_settings; the
world_lab.ari demo has three worlds.
Base automatically changed from feat/world-grids to master November 10, 2026 07:37
…/world-source

# Conflicts:
#	docs/roadmap/ARIADNE_WORLDS.md
#	inc/cvc/ariadne/scene_world.h
#	inc/cvc/nav/world_grid.h
#	src/cvc/ariadne/scene_world.cpp
#	src/cvc/nav/world_grid.cpp
@transfix
transfix enabled auto-merge (squash) November 10, 2026 07:46
@transfix
transfix merged commit 129c505 into master Nov 10, 2026
13 of 31 checks passed
@transfix
transfix deleted the feat/world-source branch November 10, 2026 10:05
transfix added a commit that referenced this pull request Nov 10, 2026
…ld panels (#1123), ocean shore (#1128)

Also #1124, #1115 and #1120.

Conflicts, both sides kept:
- ariadne.h: post_signal also hands the signal to the event tap, and
  stays a host-thread call outside a pump, as post_input is. The tap is
  set on the drain's thread, which is the host thread.
- ariadne.cpp: deliver_input and post_signal post to the document's
  scheduler (current_sched) when a resident takes the event, and queue it
  for the tap when the tap takes that kind. post_signal keeps its
  assert_outside_pump. The tap's events are handed over in drain_begin,
  after the input residents and before the has? snapshot, so what they
  start runs in the frame's pump.
- ariadne_script_engine_test.cpp: this branch's isolated-document tests
  and master's hook tests, all kept.

A lane's hook residents run on the host thread: a document that uses an
engine stays there (require_host_thread), so the hook queues and the
receiver's start_process need no more.
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