PixelDoll runs the canonical JavaScript paper-doll modules shipped in its Phaser export. The canonical source is
app/src/lib/runtime/: paperdoll.js handles equipment, hiding, layer order, live masks, cell lookup,
mirroring, pivots and straight-alpha composition; colors.js handles linked palette selection, exact
RGB swaps and owner-local recolored project views; timeline.js handles timeline duration and sampling.
These are plain JavaScript ES modules with checked JSDoc, not TypeScript that consumers must compile.
The Phaser export's phaser/PaperdollContainer.js includes these source files verbatim, followed by the
Phaser adapter. All their public exports are available from that single standalone ES module. There
are no application imports, runtime dependencies, code evaluation or Phaser dependency in the core.
The adapter still uses the host game's Phaser instance and native animation events.
The JavaScript export ships the same modules in javascript/paperdoll.mjs. Its adapter takes
an exported manifest and exposes back-to-front sheet draws with source rectangles, pivot-relative
offsets and exact palette maps. The host can load its own textures, or use loadPaperdoll to decode
the exported grids once and share them across dolls. frame() uses the canonical straight-alpha
compositor on the selected sheet cells and returns straight RGBA. The adapter takes elapsed
milliseconds from the host and retains only the last composed frame per doll. The module needs
no DOM or renderer. The included Canvas example runs from a static HTTP server.
The JavaScript loader accepts pixeldoll-sheets/4 and reads the grid paths stored in the manifest, so large layers and mirrors have the
same representation across targets. layers() reports flipX for a mirrored direction drawn from
its source's row, and frame() applies it. It fills the last position in Engines and frameworks
without changing the keyboard order of the established engine cards. One ES module suffices
for a <script type="module">, workers and bundled games.
Browser Canvas stores premultiplied alpha. Keep palette replacement and exact composition on decoded straight RGBA, and use Canvas for presentation. The browser test compares the exported module's RGBA against the baked outfit sheet and the Canvas, WebGL, SVG, DOM, CSS atlas and worker-produced bitmap pixels at native resolution. HTML Canvas pixel manipulation
The WebGPU check uploads palette-adjusted straight RGBA sheets, draws the ordered source rectangles with premultiplied source-over blending, and compares texture readback with the baked outfit. It reports when the browser provides no adapter. A host can select another renderer while keeping the same animation and equipment model. WebGPU texture copies
The adjacent phaser/types.d.ts is generated from the application's existing manifest, rig and image
type declarations. Canonical JavaScript JSDoc references that portable schema, with module-specific
aliases so concatenation cannot introduce duplicate names. No second handwritten schema is maintained.
The delivered JavaScript and schema are type-checked together in an isolated consumer directory.
The generated schema describes project data, including authoring metadata, rather than additional
runtime services. Schema changes intentionally require regeneration and consumer checking.
The requested Sol medium and OpenCode deepseek/deepseek-flash low audits independently identified that
embedding the existing Phaser class would require export atlases, eager mask baking and a Phaser game
lifecycle inside the editor. That is not dogfooding the useful boundary. The implementation instead
extracts the shared behavior and makes both the editor and the Phaser adapter consume it.
Flash preferred conformance tests without making the exported implementation authoritative. That restriction was not adopted: keeping independent equipment, color and geometry rules would preserve the drift this task addresses. Sol's shared-core proposal avoids the renderer lifecycle mismatch, while independent golden tests and real-engine negative controls challenge the common implementation.
The application imports these JavaScript modules normally. compose.ts, mirror.ts and palette.ts
re-export the canonical functions instead of maintaining alternatives. dress.ts only supplies the
authoring ramp resolver to the shared recolor implementation. Live presentation uses shared timeline
sampling while retaining phase-preserving direction changes and velocity scaling as UI policy.
Deliberate boundaries:
- Generation, skeleton authoring, quality review, storage and UI state are not game runtime behavior.
- Source-ramp generation and procedural color choices remain authoring operations. Export materializes those choices into stored ramps; both consumers share selection and exact pixel application.
- Editing uses live masks and decoded hash-addressed cells. Export preparation bakes mask combinations and sheets once. Exported manifests retain cover metadata, so both paths use the same variant selection rule. Editing never eagerly bakes every combination.
- Preview playback intentionally loops, including authored once-only clips. Native Phaser playback honors the exported loop flag. Timeline policy is explicit, not silently changed by this refactor. For generated moves with a saved Loop choice, export uses that choice; other moves use the global Export preferences. Idle, Walk and Run start with Loop on in Add a move. The inspector's timer advances playlist entries for pause/step controls; it does not implement a second pixel compositor or equipment resolver.
- Phaser texture loading, sprite placement and native frame events remain adapter responsibilities.
sync()consumes the samedrawList()used by internal composition, not a second visibility or z rule. The loader decodes recolorable sheet PNGs with the canonicalpng.jsso exact palette lookups see straight RGBA, including translucent pixels. Phaser uploads the resulting palette textures normally. - The Phaser AE export (
phaser-ae/paperdoll.js) appends its adapter to the same canonical modules. AE has no animation manager with per-frame durations, so the adapter keeps one clock per doll in a scene step and samples it withsampleTimeline. A doll is one roster object (doll.actor) made an aggregate: the actor owns the transform, and once a frame it emits eachdrawList(orexportedActionDraws) layer as an instance around its interpolated transform, so the layers sort as one object and cannot drift between fixed steps. Palette lookups read sheets decoded exactly by the canonicalpng.js, never a canvas. Grid registration, palette grids and instance placement stay adapter responsibilities. - GDevelop's native JavaScript event embeds the canonical modules inside its controller factory, removing
only ES module
exportkeywords. Its adapter usessampleTimeline,drawList,paletteMapandapplyPalette; Sprite resources, origins and renderer textures remain GDevelop-specific. Module-local caches are therefore per-controller in GDevelop. Shared behavior must not depend on cross-controller mutable state; recolor caches are performance-only. - Aseprite resolves and applies first-outfit palettes through the canonical color API. Generic and RPG Maker baked frames use the canonical compositor. Godot and Unity retain native-language controllers, so their independent implementations still require native conformance checks rather than source identity.
- A mount and its rider have independent facings and clocks. The mount follows travel, and the rider can face an attack while its hip contact stays on the mount's seat. The editor's test mount is an editor feature. A game can compose the same behavior by playing two exported dolls independently and placing the rider's contact on the mount's seat. Studio reads the effective layers from the same draw resolver that composes a character frame. The mount seating and occlusion guide describes how Studio uses their alpha and slot profiles to preserve visible equipment.
Add runtime behavior to the canonical JavaScript modules, not the TypeScript facades. Existing
application entry points preserve caller interfaces; direct canonical imports are appropriate for
other engine-neutral modules. Phaser's public z() and layerOf() convenience methods remain available.
Item-only thumbnails and inspector frames call composeCell with a project view containing just
that item and its layer-union frame. Other equipment is intentionally excluded, but depth overrides,
mirroring, owner-local images and pixel composition are not reimplemented. compareDraws(manifest)
owns the total layer ordering, including equal-depth ties; drawList and Aseprite's editable
all-layer stack both use it. Aseprite gets first-outfit visibility from drawList. Phaser and
GDevelop assign renderer ranks from the returned draw-list order instead of creation-order ties
or a second depth sort. Change ordering in the canonical comparator, not in these adapters.
Primary API references reviewed: Phaser animations and TypeScript JavaScript checking. Native engine tests, not documentation alone, verify nonuniform Phaser frame durations and synchronization.
import {
composeCell,
bakedFrame,
recolor,
sampleTimeline,
drawList,
loadPaperdoll,
Paperdoll,
} from "./phaser/PaperdollContainer.js";
const frame = bakedFrame(project.manifest);
const colored = recolor(project, { hair: "azure" });
const cell = sampleTimeline(move.frames, elapsedMs, move.loop);
const image = composeCell(
colored,
outfit.items,
move.id,
direction,
cell,
frame,
);project is { manifest, images }, with decoded RGBA images { w, h, data: Uint8ClampedArray } in a
Map keyed by the full cell hash. To reconstruct it from an export, read the manifest inside
project.json and decode each referenced adjacent cells/<hash without sha256:>.png into that map.
The main Export dialog includes these files under .pixeldoll/ when requested.
The separate manifest.json describes atlas/sheet assets and omits layer cell references; it is not
a decoded compositor project and cannot be passed directly to composeCell.
Optional layerImages preserves owner-local recoloring when layers share a
hash. composeCell returns a new image, aligns all layers by stored pivot and defaults to the rig's
frame, which intentionally clips oversized layers. Pass bakedFrame to retain the full layer union.
The compositor does not recolor implicitly: use the returned recolor view as the application does.
For exported sheets and native Phaser sprites, use the existing loadPaperdoll / Paperdoll API.
The public paletteMap returns active RGB swaps only; colors without a selected ramp are omitted.
Use playbackClips(manifest.rig.animations) to enumerate States and Moves. A State has one
playback cell and uses the same sampler and renderer as a Move. Runtime manifests and sheet paths
use the public standing ID. An editable project.json retains its stored keys: use each entry's
key to compose that editable project or its id to identify the corresponding runtime clip.
sampleTimeline clamps negative/nonfinite elapsed input to the start, loops by default and holds the
last authored cell when looping is false. Empty, nonfinite or nonpositive-duration timelines throw.
The core assumes a validated manifest, just as the existing compositor did. Application-specific
draft coverage filtering and recovery happen before rendering; the core does not schedule generation.
Consistency means matching paper-doll results and operation semantics, not imposing JavaScript names, renderers or loading on other engines. The engine-neutral JavaScript is authoritative for equipment, visibility, cover selection, depth, geometry, pixels, palettes and timeline sampling. Native ports implement those same decisions in their host language; changing JavaScript does not update them automatically.
| Operation | JavaScript / Phaser / Phaser AE / GDevelop | Godot | Unity |
|---|---|---|---|
| Select animation | play(move, direction, restart = false) |
play_anim(move, direction, restart = false) |
Play(move, direction, restart = false) |
| Turn the active move | setDirection(direction) |
set_direction(direction) |
SetDirection(direction) |
| Play a Play mode action | playRole(role, direction, restart = false) returns { clip, direction, intended }, throws when none |
play_role(role, direction, restart = false), {} when none |
PlayRole(role, direction, restart = false), false when none |
| Read a Play mode action's clip and facing | resolveRole(role, direction), null when none |
resolve_role(role, direction), {} when none |
ResolveRole(role, direction, out clip, out facing) |
| Read the facing shown | direction (JavaScript), dir (Phaser, Phaser AE, GDevelop) |
dir |
Direction |
| Change one slot | equip(slot, item) |
equip(slot, item) |
Equip(slot, item) |
| Apply complete outfit | applyPreset(idOrObject) |
set_preset(id) |
ApplyPreset(id) |
| Change color selections | setVariants(map) replaces all explicit selections |
set_variant(material, name) changes one |
SetVariant(material, name) changes one |
| Remove explicit color | Omit the key or use null in the replacement map |
set_variant(material, null) |
SetVariant(material, null) |
| Unequip a non-base slot | null |
"" |
null or "" |
| Invalid move, direction, equipment or outfit | Throws before mutation | Warning and false, before mutation |
Warning and false, before mutation |
| Turn with no active move | Throws before mutation | Warning and false, before mutation |
Warning and false, before mutation |
| Play mode action with no clip in a facing | Throws before mutation | Warning and {}, before mutation |
Warning and false, before mutation |
| Disposal | Release references in JavaScript, destroy() in engine adapters |
Native queue_free() |
Native Destroy(gameObject) |
All six live controllers (JavaScript, Phaser 3/4, Phaser AE, GDevelop, Godot and Unity) must preserve these behaviors:
- Selecting the active move/direction preserves its progress. Selecting a different move/direction
starts at the beginning. Selecting a completed once-only clip replays it. Explicit
restart = truestarts the requested clip from its first playlist entry, even if it is already active. - Turning changes only the active move's facing, for example an aimed attack that rotates while it plays.
It keeps the playlist entry, time within it, loop position and once-only completion. It redraws every layer
immediately and replays no lifecycle events (no start, repeat or complete). A completed once-only clip stays
completed, so a later
playof it still replays. Turning to the current direction is a successful no-op.playkeeps its restart semantics; directions of one move share their timeline, so no resampling is needed. - Frame lists retain authored order, repeated cells and individual durations. Loops repeat; once-only clips hold their final cell. Equipment, outfit and palette changes do not restart animation.
- The body cannot be unequipped. Equipment must belong to the requested slot and cannot directly select a baked variant. Equipped hidden items still contribute the documented hides/cuts rules. Hand-conflict removal in the Studio is interaction policy; exported controllers resolve visibility without silently removing the other equipped item.
- Applying an outfit replaces equipment and explicit colors, with the frozen body restored. Removing an explicit color restores its material default, not necessarily the original source colors. An empty-string color selection uses source colors. Linked materials follow their target selection. JavaScript color maps replace the selection set; native setters deliberately change one key.
- Invalid operations leave equipment, colors and playback unchanged. JavaScript exceptions and native warning/boolean results are intentional host-language differences, not permission to fail silently.
- Unknown material keys in JavaScript replacement maps are retained but have no visual effect; native
one-material setters reject unknown material IDs. Unknown variant names, like empty strings, use
source colors in all six controllers. JavaScript and Phaser mutators return
undefined; GDevelop returns the doll for chaining. These return conventions do not change rendered results. - Stored layer pivots and cell sizes, most-specific depth overrides, slot/role tie order, exact RGB swaps, alpha and source-image immutability retain the same meaning in every renderer.
- A mirrored direction draws exactly as Studio's Play mode draws it. Compact exports store
only
export.rows; every controller resolves a direction through the canonicalsheetFacingrule (its own row, or itsmirrorOfsource's row flipped about the centered layer pivot) and keeps every other decision keyed by the requested direction. Exports written with Include mirrored frames keep every row. - Instances keep independent equipment, colors and clocks. Disposal releases owned nodes/resources; Phaser's documented game-wide palette texture cache lasts until game teardown.
Generic PNG/JSON is an integration format, not a live API. Aseprite records editable layers and the first outfit. RPG Maker resamples to its fixed sheet format. These targets must use shared decisions where applicable, but cannot expose live operations the destination format does not support.
| Operation | JavaScript / Phaser / Phaser AE / GDevelop | Godot | Unity |
|---|---|---|---|
| Enable precut action layers | setActionLayering(enabled) |
set_action_layering(enabled) |
SetActionLayering(enabled) |
| Start a one-shot action | playAction(move, direction) |
play_action(move, direction) |
PlayAction(move, direction) |
| Check the entire action set | canLayerAction(move, direction) |
can_layer_action(move, direction) |
CanLayerAction(move, direction) |
| Query the action clock | actionPlaying |
is_action_playing() |
IsActionPlaying |
Layering starts off. canLayerAction checks all reachable cells of the current walk and action in their shared direction and checks the visible outfit, independently of the switch. playAction starts at time zero and returns layered when enabled and eligible, or full for a whole-body action. That choice is latched. A layered action starts with the current gait cell and updates the lower body while the gait faces the action direction. Turning the gait away holds the last matching cell. Turning back resumes drawing the current gait cell. Both clocks keep advancing. Palette changes and the layering toggle leave the current action mode in place. An unsupported outfit downgrades a layered action to full for the rest of that action while both clocks retain their progress. A valid play cancels the action in every export. Live also holds the lower body when the user stops walking. Invalid playAction calls throw in Phaser and GDevelop and warn and return "" in Godot and Unity. All leave the visible state and both clocks intact.
canLayerAction checks only the art: a precut pair for the walk playing now, the facing and the action, and no worn gear blocking it. It does not read the game's state. Decide the rest before calling playAction; Play mode layers only while the character is on the ground, not mounted, moving with its Walk clip, and facing its attack. Otherwise play the action in full.
Calling playRole('attack', aim) again carries on a swing that picks the same clip and facing, and starts it over when the facing or clip changes. To steer one that is already playing while keeping its progress, resolve the role and, when its clip is the one playing, call setDirection(pick.direction). A different clip starts over. An attack started with playAction keeps its starting facing until it ends or cancelAction() runs. Whether an attack can turn mid-swing is the game's choice; most action games lock the direction for the whole swing.
The Studio uses the canonical fragment splitter, seam measurement and compositor. It pads the whole cached set around the same pivot without changing Live's world scale. Engine sprites are independently translated and have no shared clipping frame. Export preparation writes source-color body fragments with the original grids and pivots and points whole equipment layers at their existing source sheets. Both parts share normal layer ordering. The upper translation is lower hip minus upper hip plus the baked correction. Native controllers consume only prepared assets and metadata. The host game owns travel speed, action input and hit timing.
For configured attacks, gear without complete attack art is hidden for the whole clip in that facing, in either action mode, and its gap is listed in export.omissions; the body item is never listed. It does not block layering; Live retains the hidden-gear or loading notice. A hidden item stays equipped, shows again in clips and facings where it is complete, and stops hiding other slots for those frames. Visible lower-slot gear with complete attack art and incomplete walk art forces a full-body action. Exports record the blockers by walk/attack/facing, which the controllers consume directly. Seam limits are scaled by unpadded rig width, and off-silhouette hips prefer valid measured or requested coordinates before clamping to the occupied silhouette.
Before changing a paper-doll behavior or public controller operation:
- Reproduce the problem with a failing golden or exported-runtime test. Identify affected consumers from the operation table, including native controllers and asset-only exports where applicable.
- Put engine-neutral behavior in the canonical modules. Keep rendering, loading, native naming and lifecycle in adapters. Update native ports in the same change, or document and justify why a port is unaffected. Do not treat matching JavaScript source as evidence of native behavior.
- Keep this contract, the export-format specification and generated engine READMEs aligned. Record deliberate differences here instead of adding compatibility aliases or a universal renderer framework.
- Run the source synchronization workflow below when canonical code or its data types change. Run
npm run check, the unit suite, and affected application export/selftest E2E specs.AGENTS.md"Testing" maps areas to specs and lists the cross-cutting changes that need the full suite. - Run the affected native checks:
GODOT_BINenablesgodot-export.test.ts; the Phaser, Phaser AE, GDevelop and Unity verifiers live inapp/scripts/verify-*-export.mjsandverify-gdevelop-engine.mjs. The Phaser AE verifier needs a game folder fromnpx -y @phaser-ae/cli blank(a free phaser.io account), since the engine is not on npm. Playback checks include repeated selection, explicit restart, completion replay and turning mid-entry on a repeated cell with unequal durations (the GDevelop native fixture has one view per move, so its verifier covers only the no-op and rejection; unit tests execute the turn itself); palette checks include restoration and owner isolation; rejected calls must preserve state and report failure. Preserve negative controls and test a freshly generated export, not a previously downloaded runtime. - Have an independent reviewer challenge the behavior, tests and intentional differences. Report exact engine versions and what actually ran. An unavailable native engine or skipped opt-in test is a verification limitation, never a native conformance pass.
Native tests are opt-in because their engines are not installed by the ordinary unit/CI workflow. Default unit tests guard export construction and JavaScript execution; they do not replace native GDScript/C# execution. Do not claim that every native port automatically inherits future JavaScript fixes.
Required scenario coverage lives in these existing harnesses rather than a second test framework:
| Scenario | Executable checks |
|---|---|
| Shared rendering, ordering and palettes | runtime.test.ts, runtime-preset.test.ts, export-phaser.test.ts, export-phaser-ae.test.ts, gdevelop-export.test.ts |
| Repeat selection, restart, completion replay | verify-phaser-export.mjs, verify-phaser-ae-export.mjs, verify-gdevelop-engine.mjs, native godot-export.test.ts, unity-review/NativePlayback.cs |
| Turning mid-move, including completed clips | export-phaser.test.ts, export-phaser-ae.test.ts, gdevelop-export.test.ts, verify-phaser-export.mjs, verify-phaser-ae-export.mjs, native godot-export.test.ts, unity-review/NativePlayback.cs |
| Play mode roles match Play mode | play-role-parity.test.ts, export-javascript.test.ts, export-phaser.test.ts, export-phaser-ae.test.ts, gdevelop-export.test.ts, unity-export.test.ts, verify-phaser-export.mjs, verify-phaser-ae-export.mjs, verify-gdevelop-engine.mjs, native godot-export.test.ts |
| Rejection atomicity and palette restoration | Controller unit tests, native godot-export.test.ts, unity-review/NativePlayback.cs |
| Portable resources and export boundary | export-portability.test.ts, export-validation.test.ts |
| Plain JavaScript, typed module and playback | export-javascript.test.ts, export-folder.test.ts, live-layering.test.ts, export-picker.spec.ts |
Paths in this table are under app/test/unit/ or app/scripts/. Test exported runtime bytes and
native controller output; matching source text alone is not evidence of matching engine behavior.
Folder publishing places one runtime per engine in pixeldoll-<engine>/, alongside the character
folders that use it. JavaScript, Godot, Phaser, Phaser AE and Unity publish a shared bundle. Each character keeps
its own data, sheets and integration guides. ZIP exports still embed their runtime in the archive.
Within a supported data layout, every new bundle revision must load and play character data written
by earlier revisions of that engine's folder export. The move to pixeldoll-sheets/4 is a breaking
preview change for the JavaScript loader. Characters can remain on disk and can use the same shared runtime
as newly published characters. A behavior that needs newer data, such as hiding incomplete gear from
export.omissions, starts when the character is exported again; runtimes don't read older fields in its place. Keep existing entry paths and integration APIs usable. Unity's integer
runtimeFormat is the character data contract. The shared importer accepts positive formats up to its
supported version, with no exportId. ZIP manifests keep their assembly-specific exportId.
Keep runtime changes additive: PixelDoll never deletes a file from a user's folder, so a file a
revision no longer needs stays there and must stay harmless to the engine (Unity compiles every .cs under Assets).
Bump the engine's runtime revision whenever its bundle changes, including file names, declarations and
assembly definitions. Add the new revision's digest in export-folder.test.ts and keep the earlier pins of every revision that
shipped (a revision that never left this branch may be re-pinned).
The digest is SHA-256 over the JSON array of sorted path and file SHA-256 pairs. Bundle bytes are independent
of characters and export timestamps. When updating a bundle, verify that it still runs a character exported
before the update in the native engine without republishing that character.
app/scripts/sync-runtime.mjs generates runtime/sources.ts, a transport-only copy of the exact JS
source bytes. It contains no separately authored implementation. This makes exports synchronous in
the browser and keeps direct Node export scripts usable without Vite ?raw hooks or browser fs.
After changing a runtime module, format that module and run npm run runtime:sync from app/.
The production prebuild refuses a stale generated transport file. Unit tests compare every canonical
module byte-for-byte, verify that the shipped module contains those bytes, import the delivered module
without Phaser or DOM initialization, and assert internal composition exports are the same functions.
Do not edit sources.ts by hand. Do not add independent paper-doll rules to the Phaser adapter.
The GDevelop adapter follows the same rule. A regression test edits a copied canonical timeline module,
proves the stale guard rejects it, runs the real generator, then executes the internal and delivered
modules and a GDevelop controller to verify all changed together. Separate GDevelop mutation controls
verify it executes canonical timeline, draw-list and palette decisions, rather than carrying unused text.
The generator rejects imports, export lists and default exports in canonical modules (the checks live in
app/scripts/runtime-modules.mjs, which unit tests call directly). Keep public
exports on named declarations so the embedded native-event form remains safe to generate.
It also checks that every line beginning with export is an actual top-level export modifier,
and every such modifier uses that prefix. Misleading prefixes inside multiline strings/comments
or indented export declarations fail synchronization instead of being silently changed by embedding.
It also rejects cross-module top-level binding collisions before writing transport files, since
the delivered modules share one scope. runtime-sync.test.ts exercises that failure and recovery.
The same command regenerates types.d.ts from the existing TypeScript data contracts. Changes to those
contracts require resynchronizing the export transport as well. The prebuild checks both generated files.
This remains an explicit synchronization workflow, not a development-server watcher: after editing a
canonical module, run the synchronization command before testing an export from an already-running dev server.
Phaser and GDevelop accept either an outfit object or its exported ID in applyPreset. Unknown IDs
throw without changing equipment or colors. Constructors resolve the same IDs/objects. Canonical
validEquipment supplies the slot/item rule to setters and resolvePreset; malformed custom outfits
are rejected atomically. Stored presets with missing, wrong-slot or baked-variant references fail
export validation. Known stale items remain warnings and are removed from the exported outfit.
Godot's set_preset and Unity's ApplyPreset use IDs.
Native controllers can change equipment and exact stored palettes at runtime. Generic exports are
PNG/JSON integration assets, Aseprite records the first outfit's visible layers and per-frame timing,
and RPG Maker deliberately resamples a walk into its fixed step-sheet layout. Those formats do not
provide a live controller API equivalent to Phaser, Godot, Unity or GDevelop.
Exported path segments escape Unity special folder names and Windows device IDs with a leading underscore (con becomes _con)
without changing the manifest's immutable IDs. Valid IDs cannot start with an underscore, so this
cannot collide with an unescaped valid ID. Layer sheets/sourceSheets contain the resulting paths;
baked paths use the same escaping for outfit and move IDs. Display-derived Unity/Aseprite/RPG Maker
names use the shared portable-name helper. The final archive path check remains a safety backstop.
See app/test/unit/runtime.test.ts for source identity and independent pixel/timeline golden values;
existing mask, equipment, palette, presentation and export suites cover their established behavior.
app/scripts/verify-phaser-export.mjs runs pinned real Phaser engines with negative controls for broken
duration, looping, layer synchronization, pivots, masks, visibility, palettes, translucent palette
lookup through Canvas readback and direction rows. It
compares every playlist frame against combined outfit sheets when those sheets are included. A ZIP
without them still receives clock checks and explicitly reports that its pixel oracle did not run.
Phaser Canvas expands each sprite by half a pixel when the camera's roundPixels flag is enabled.
For exact pixel comparison at integer character positions, disable that flag with
scene.cameras.main.setRoundPixels(false). The native verifier does this only for Canvas pixel checks;
it does not change the application's compositor or silently modify a game's camera in the adapter.
Full application E2E is required for shared-runtime changes. See the implementation verification for the exercised workflows, real-engine results, review fixes and remaining evidence limitations.