Skip to content

One World OW9b: people float like people (avatar density, body displacement) - #1578

Merged
transfix merged 1 commit into
masterfrom
feat/one-world-ow9b
Nov 27, 2026
Merged

transfix merged 1 commit into
masterfrom
feat/one-world-ow9b

Conversation

@transfix

Copy link
Copy Markdown
Owner

OW9b of the swimming design (docs/roadmap/ARIADNE_WORLDS.md §18.10): people float like people, head-out, instead of like a cork.

The problem

An avatar is a 70 kg box of 0.425 m³, about 165 kg/m³. In water it displaced the whole box and floated with only 0.28 m of its 1.7 m under.

The change

  • avatar_body::density (kg/m³, default 985, a person's). In the rules it is body: { density: }; it is checked to be positive and published with the archetypes. The stock worlds and the docs state it.
  • avatar_displacement(body, mass): mass ÷ density ÷ the box's volume, which is 0.167 for the default person. Each dynamic avatar's box gets it when the box is made, and again when set_mass changes the mass. Contact and prediction still use the box.
  • The physics share is a body setting, not an avatar mark.
    • The design named a field_set::mark_avatar. It is physics::body_desc::displacement and world::set_displacement instead, so any dynamic body without a hull can use it.
    • set_displacement validates the share and wakes the body.
    • A vehicle's chassis is refused, because its wading sets its own share.
  • The share scales the water's damping on the cells as well as their buoyancy, since the water a body moves aside is what damps it.
    • With the whole box's damping, a person took over 10 s to settle, and a body heavier than water sank at 1.5 cm/s.
    • A flooded vehicle chassis keeps the whole damping, so no vehicle's behaviour changes.
    • Every body defaults to a share of 1, so nothing else changes.

Tests

holon_test HolonPhysicsTest.APersonFloatsHeadOut, 30 s in a still lake:

body its top above the surface
a person, 985 kg/m³ +0.026 m (98.5% under)
the same person at 140 kg (set_mass) +0.026 m: the depth depends on density, not mass
1100 kg/m³ −1.300 m: resting on the bed 3 m down
the box's own density, 165 kg/m³ (how it was before) +1.420 m: a cork, 0.28 m in
  • physics_field_test ADisplacementShareFloatsABodyDeeper: a slab displacing half its volume floats twice as deep. It floats at its own draft again after set_displacement(1), which wakes it. Bad shares and unknown bodies are refused.
  • world_rules_test: density: is parsed, defaults to 985, a zero is refused, and the room's archetype section round-trips it.
  • OW9a's lake test now has client and server both floating at −1.67 m, still with no correction.
    • When the water rises 0.5 m over a floating person, only 1.5% of its weight is left to lift it, so it takes about 35 s to come back up.
    • That case now runs for 60 s.
    • Surfacing faster is for walker@2's stroke up (OW9c).

All of these pass locally on Windows (Release, Jolt, gRPC, WS):

suite tests
ariadne_scene_world_test 149
holon_test 60
holon_sync_test 40
ariadne_server_document_test 25
ariadne_world_dataset_test 10
pose_stream_test 14
room_aoi_relay_test 10
room_avatar_test 12
room_scene_test 21
world_rules_test 10
fast_lane_test 9
physics_field_test 53
physics_boat_test 10
physics_vehicle_test 37
physics_world_test 47
physics_hull_test 19
physics_dyn_boat_plant_test 16
physics_parity_test 3
physics_energy_test 11
cvcgl_ariadne_physics passed

Not yet

  • A relay from before this change publishes no density, so a newer client predicts a person where that relay floats a cork.
  • The Avatar window doesn't show the density yet (OW9d).
  • Not run live.

avatar_body::density (985 kg/m^3, the rules' body: { density: }, published
with the archetypes) sets the share of an avatar's box that displaces water:
mass over density over the box's volume, 0.167 for the default person, so a
person floats head-out (98.5% under) instead of like a cork.

The share is physics::body_desc::displacement and world::set_displacement,
for any dynamic body without a hull; it scales the cells' buoyancy and the
water's damping on them. A vehicle's chassis keeps its wading's share and the
whole damping. Every body defaults to 1, so nothing else changes.

Tests: holon_test APersonFloatsHeadOut, physics_field_test
ADisplacementShareFloatsABodyDeeper, world_rules_test's density key; OW9a's
lake test floats at -1.67 m with no correction.
@transfix
transfix merged commit 08d9f77 into master Nov 27, 2026
30 checks passed
@transfix
transfix deleted the feat/one-world-ow9b branch November 27, 2026 08:08
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