A2: Player figure and animation

The islander is built in headless Blender (tools/models/figure.py,
`make figure`, `make art`) as twelve rigid parts with their origins at
their joints: an oilskin coat, a sou'wester, sea boots, a bedding roll
and the canvas wing-sail. Debian's Blender can't write glTF, so the
figure is jointed rather than skinned.

FigureRig hangs the parts on pivots, paints them from Palette with the
coat in the player's own oilskin, and plays FigurePoses' hand-written
key poses through one AnimationTree: idle, walk and run by speed,
crouch and creep, air, skydive, glide, swim and aboard; long, short and
carried holds; reload and use layers; fire, boathook swing, keg throw
and building as one-shots; and a flinch when health drops. The chest
takes a third of the pitch and the held item all of it.

Figures animate from replicated state only: positions, look, health,
the held item and the FLAG_ bits (reloading and using now reach
mirrored players), with actions from FX. Every boathook swing is now a
sim "swing" event, sent as a SHOT with no item, so misses are seen and
heard; the new FX kind PLACE shows pieces placed. Protocol version 4.

Tests: test_figure_rig (15), plus swing and PLACE cases in test_harvest
and test_net_fx. make check passes (604 tests); make client-check
passes. Captures: figure_states, figure_actions, figure_close
(make figure-captures), client_glide and client_landed.

Closes #42

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 17:35:53 -05:00
co-authored by Claude Opus 5.5
parent da0c65f3ce
commit 07738330b5
66 changed files with 6230 additions and 88 deletions
+7 -5
View File
@@ -91,20 +91,22 @@ func test_figures_hold_their_players_item_in_the_right_hand() -> void:
var player: SimEntity = made[1]
var view: EntityView = EntityView.new()
view.setup(sim)
var figure: Node3D = view.figure_of(player.id)
var held: MeshInstance3D = figure.get_node("Hand/Held")
var figure: FigureRig = view.figure_of(player.id)
var held: MeshInstance3D = figure.held()
assert_eq(held.mesh, ItemModels.model("whalers_longgun", 3))
assert_true((figure.get_node("Hand") as Node3D).position.x < 0.0, "the right hand, on the figure's -X side")
assert_true(figure.relative(figure.hand()).origin.x < 0.0, "the right hand, on the figure's -X side")
player.selected = 0
view.sync()
assert_eq(held.mesh, ItemModels.model("boathook", 1), "the boathook when nothing else is held")
player.pitch = PlayerCommand.PITCH_MAX / 2
view.sync()
var muzzle: Vector3 = (figure.get_node("Hand") as Node3D).transform.basis * Vector3(0.0, 0.0, 1.0)
figure.drive(player, 0.1)
figure.advance(0.1)
var muzzle: Vector3 = figure.hand_basis() * Vector3(0.0, 0.0, 1.0)
assert_true(muzzle.y > 0.5, "looking up points the item up")
player.drop_state = Drop.GLIDING
view.sync()
assert_false((figure.get_node("Hand") as Node3D).visible, "both hands on the wing-sail")
assert_false(figure.hand().visible, "both hands on the wing-sail")
view.free()