An animation over a container aims its rows at template ids. Played on
another container, those ids are not there, so every row below the
root was skipped without a word. "Enemy - Hit" built over the Slime
flashed the slime's Sprite but never the skeleton's.
- When the template id is not found below the object, the runtime
takes the names on the way to the row's target in the root and
walks the same names below the object, level by level.
- The id still comes first, so the root's own instances bind as
before.
- A name missing at some level, or taken twice, skips the row, as
a gone target always did.
- The rule is the pure function targetNamePath in animation.ts. The
AnimationSystem only walks the children.
Tests:
- animation.test.ts: 84 tests, all green (+2). One plays over a
second container built alike, renamed and with the name twice.
The other names a row two containers deep.
- Counter-check: with the name fallback off, the new runtime test
fails (1 of 84).
- Project cbbf160bb7e8 (revision 14407), Demo scene: "Enemy - Hit"
and "Enemy - Die" change Flash and scale on the skeleton's Sprite.
Without the fallback the skeleton stays unchanged.
- The gate did not run before this commit. CI covers it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
d6fd000 wrote the behaviors that played an animation on the player
itself. A player is plain data, and those behaviors are entities of
the run with their parents and children. The actor smoke reads the
world as JSON and threw "Converting circular structure to JSON" as
soon as its graph had played a walk animation.
- The starters live in a WeakMap next to the player and are read
with startersOf. The player carries no field for them any more.
- The animation system reads them from there when a pass ends. What
a behavior hears does not change.
- Only the hook the check scripts read the world through was hit.
The editor and a running game never serialise a player.
Tests:
- Gate on melektaus-atx: 219 files, 3400 tests, CHECK EXIT 0. It
ran on the working tree, which also held the fix to e2e 47 and
the kept panel sizes that are not committed yet. Seven of the
tests belong to those.
- One new unit test: a player played by an asker that reaches back
to its holder stays plain data, through JSON and structuredClone,
and names the asker once. Its counter-probe bites.
- Smokes on melektaus-atx: 24, 19 and 21 checks, all pass. Before
the fix the third stopped after 9 checks.
- e2e 6,17-26 on melektaus-atx: 480 checks, all pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A behavior that played an animation on the parent of its owner never
heard it finish. On animation finished listened to the owner and to
what stands below it, and the parent stands above.
- Play animation notes on the player which behavior asked for it.
- On animation finished hears, as before, every animation on the
owner or below it, and now also every animation the behavior
played itself, on whatever object. Its output object names that
object.
- Two behaviors that both played the same animation on the same
object each hear its end once.
- A behavior that is called by Run behavior or heard by an On node
counts as the behavior it sits in.
- The description of the node and the engine prompt say so.
Tests:
- Gate on melektaus-atx: 218 files, 3392 tests, CHECK EXIT 0.
- Two new unit tests: the behavior hears the animation on the parent
of its owner while a bystander does not, and two starters hear it
once each.
- Both counter-probes bite.
- e2e 6,17-26 on melektaus-atx: 480 checks, all pass.
- No new e2e check, and nothing was looked at in the browser. The
rule for called and heard behaviors has no test of its own.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The built-in eases cover the usual shapes, but a game often wants its
own: a coin that bounces twice, a door that overshoots and settles.
A new asset type holds such a curve, and keys and the Lerp node can
pick it instead of a built-in ease.
- New asset type "curve": points like in Vector art, x is t and y is
the value. A new curve is the straight line from (0, 0) to (1, 1).
- One pure evaluation in src/core/model/curve.ts serves the timeline
preview, the running game and the Lerp node.
- The curve always has one value per t. The end points stay at t 0
and 1, points cannot pass each other, and a handle that reaches past
its neighbour is shortened along its direction. Loading a hand-edited
file applies the same rules.
- Curve tab: click on the line to insert a point that keeps the shape,
click on free space to put one there, drag points and handles,
double-click or Delete removes, Alt-click toggles round and sharp.
Every step is one undo step.
- Presets: all 30 built-in eases plus Linear, fitted with adaptive
subdivision. Each stays within 0.4 % of the built-in ease.
- Preview: a dot runs along the curve once a second, a second dot
shows only the value. The Preview button stops it.
- Animation keys get "Curve" under Easing with a curve picker. Lerp
gets "Curve" under Ease, and its result may overshoot b.
- A missing or unpicked curve runs linear. The inspector says so, the
node shows it as a problem, and deleting a used curve warns with the
number of keys and Lerp nodes.
Tests:
- ./check.sh: 180 files, 2612 tests, CHECK EXIT 0
- GM_STEPS=1-6,25,53: ALL PASSED, 309 checks
- New e2e module 53 with 13 checks, all with the real mouse. Expected
values come from its own Bezier evaluation.
- Counter-checks bite: without Bezier evaluation 4 unit tests fail,
without handle clamping 2. In the browser, a key that cannot find its
curve, a click that sets no point and a handle drag that moves the
point all turn checks red.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A key could only ease quadratically, which makes quick moves like a
sword swing feel soft. Animators know the Penner curves from CSS,
GSAP and Unity, so a key now offers all of them.
- Ten curves (Sine, Quad, Cubic, Quart, Quint, Expo, Circ, Back,
Elastic, Bounce), each in, out and in-out, next to Linear and Step.
- The inspector shows two fields instead of one long list: Easing,
and Direction only when a curve is picked. Switching the curve
keeps the direction. Coming from Linear or Step starts at in-out.
- Old projects keep working. ease-in/out/in-out now read as Quad and
are still saved under that name. New curves save as cubic-out,
back-in-out and so on.
- Back and Elastic overshoot on purpose. A number property with min
or max is clamped in play and preview, so a Back in from scale 0
does not flip the sprite. trackWriteAt now takes the property
definition, and animatedKind* is renamed to animatedDef*.
- The timeline marker still shows only the direction.
- In-out is built for every curve from its in-curve and its mirror.
easings.net uses own constants for Back and Elastic in-out, so our
Back in-out winds up about 5 % instead of 10 %.
Tests:
- ./check.sh: 165 files, 2413 tests, CHECK EXIT 0.
- 12 new unit tests in tests/core/easing-curves.test.ts: round trip
of all 30 values, start/end/midpoint of every curve, reference
values, only Back and Elastic leave 0..1, clamping in play and
preview, unknown values are rejected.
- e2e 25: ALL PASSED, 28 checks. New 25b-ii (3 checks) clicks both
fields and undoes the four choices. Check sum 1393 -> 1396.
- Counter-checks, each fails its test: no clamping (2), Quad saved
as quad-* (2), mirrored in-out wrong (2), curve lookup with `in`
instead of Object.hasOwn (1), no Direction field (e2e 25).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stop animation gets a blend (s) port that fades the animation back to what
lies underneath. Play animation gets blend out (s) for Once (reset) and a
restart port that starts a running, paused or fading animation from frame 0.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The Animation tab shows the root asset over the timeline, with every row's value at the
playhead written onto a copy of it – the sprite, text or container placed at the origin as a
scene would place it, a scene as itself. Rows reach the root through that placed object and its
children through the object's instance edits, the route a placed container's content takes,
so the ids match what the runtime gives them. The runtime player and the preview evaluate a row
through one function (trackWriteAt), relative rows included; past the end of a once-reset pass
the preview shows the starting values, as the player would. Play, pause and the ruler drive the
preview through the timeline's playhead; a drag pans, the wheel zooms, Centre frames it. The
document is never touched and undo never hears of scrubbing.
On animation finished no longer describes itself as hearing "a sprite of the owner".
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Part (a) of the animation rework: model, commands, saving, runtime and nodes.
- AnimationAsset holds a root (sprite, text, container or scene) and rows; a row keys one
property of the root or of an object inside it, keys sit on whole frames.
- The last key decides the length (its frame counts as a frame of its own). The playhead runs
between frames, so numbers and colors blend every tick even at 10 fps; everything else holds.
- Playback gains `once-reset`, which puts back what was there before the start. A row can be
relative, adding to where its target stood.
- Play / Pause / Stop animation act on an object; each instance plays on its own, the later
start wins on a shared property, and a behavior writing the same property still writes last.
- A sprite no longer wears an animation through `texture`. "Create animation from texture"
builds a sprite plus a texture row keyed frame by frame instead.
- The Animation tab shows a placeholder until the timeline editor (part b) lands.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
An animation asset is a list of pictures (whole textures or frames) with
frames per second and Loop/Once/Ping-pong playback. A sprite wears it
through its texture property, so the picker, instance overrides and the
Properties node work unchanged; there is no dedicated play node.
A different animation starts from its first frame, the same one set again
runs on, so a graph may choose Run or Idle every frame. The clock lives on
the entity, not in props, which the world writes back as overrides. The
AnimationSystem ticks before behaviors, and On animation finished fires
once when a Once animation reaches its end.
The Animation tab plays a preview above a frame strip: reorder by dragging,
Delete, duplicate, + Frames, pause/resume, and wheel zoom about the pointer
with pan and Fit. Scene and Container tabs show the first frame; edit mode
has no clock. Right-clicking a texture creates an animation from its frames.
Button now measures its label with the bold font it draws in, which cut
the Animation tab and red dialog buttons short.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>