Two sprites with videos back to back left a blank frame at the cut.
The video player only came into being once the item began, and a
sprite is not drawn until its video has a first frame. So the second
item was missing until its video had loaded.
- compositionAhead lists the items that begin within the next second.
Near the end of a looping composition it also lists the items at
its start.
- An item that is alive already is not loaded ahead. Two times would
otherwise pull at the same player.
- The frame carries these videos hidden and paused on their first
picture at the item's offset. Their players get the id the item
will have, so the cut reuses them instead of opening a second one.
- This works the same in the tab's preview and in the game.
- One second of lead (AHEAD_SECONDS) is an assumption. It can go up
if large videos still flash.
Tests:
- Unit composition: 27 green, 2 new. Unit composition-play: 14
green, 1 new for the path in the game.
- e2e 69: ALL PASSED, 12 checks. The new 69h puts two video items
back to back and checks the second player is open and paused at
its offset before the cut, and drawn in the same redraw as the
cut.
- Without loading ahead in the preview 69h fails with cut: null.
Bending two spots in the model turned their unit tests red.
- Gate on melektaus-atx: CHECK EXIT 0, 302 files, 4665 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A composition can now sit in a scene like a container and play there.
Its items become real objects while they run, so behaviors, colliders
and events work on them as on any other object.
- A composition is placeable with its own symbol, transform and render
layer. The scene view shows its picture at frame 0. A click on that
picture selects the placement, not a single item.
- CompositionSystem spawns each item as an object under the placement
when it begins, with the id <placement>~<item>. On start and the
other events run. The object is destroyed when the item ends.
- The top track lies in front no matter which item started first.
World.arrange() orders the entity list and the scene objects.
- Clips and driven videos follow the same rules as compositionAt().
Loop, restart, stop and the game pause work.
- New nodes: Play composition (with restart), Stop composition and the
event On composition finished. They were planned for step 4 but come
now, because without autoplay nothing could play otherwise.
- The editor run ignores Play composition and says so in the log. It
writes into the saved project, and the items would stay behind.
- contentId() moved to instance.ts. The animation system uses it for
nested ids too.
- Compositions get no "Sort with parent" for now.
Tests: the gate passed with 301 files and 4643 tests, 18 more than
step 1. 13 of them are in tests/core/composition-play.test.ts. The
first gate run failed in event-order.test.ts, which counts the event
nodes and now finds 19. Five counter-checks each turned exactly their
test red. Two order tests stayed green without the fix at first and
were rebuilt. e2e 68 is new and passed with 5 own checks. Its
counter-check without arrange() failed as expected.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>