Skip to content

feat(characters): Declare which way frames face, per Character and per frame - #2071

Merged
omesser merged 10 commits into
mainfrom
feat/2069-frame-facing
Nov 1, 2026
Merged

omesser merged 10 commits into
mainfrom
feat/2069-frame-facing

Conversation

@omesser

@omesser omesser commented Nov 1, 2026 •

Copy link
Copy Markdown
Owner

Summary

Closes #2069. Each frame now says which way it faces, and the renderer mirrors it only when that differs from the travel. No PNG changes.

Two layers, resolved at load onto each frame's Art:

facing = "left"                    # Character default, "right" when unset

[frame_facing]                     # per-frame override, keyed by file
"frames/walk-0.png" = "right"

Character::draw picks the left_of strip for leftward travel as before, then sets mirrored = art.facing != travel. The right-facing assumption and the strip's special case are gone.

crates/core/src/character.rs           Facing enum, Art.facing, draw
crates/core/src/character/manifest.rs  parse facing and [frame_facing], author-facing errors
crates/core/src/character/resolve.rs   resolve each Art's facing, reject unplayed [frame_facing] keys
characters/*/character.manifest        declarations below
scripts/import-pet.py                  declare facing instead of mirroring art
docs/DEVELOPMENT.md, GLOSSARY.md       the two layers, the importer, a Facing term

Why a table keyed by file, not { file, facing } inline in frames. A frame belongs to the file, and Animations share files (Rubber Duck's fall reuses jump frames, its react reuses wave's). Inline entries could declare one file left in one Animation and right in another. TOML rejects a duplicate key, so the table cannot contradict itself. frames stays a list of plain strings, so plain-string frames are every test's frames, not a separate case. A [frame_facing] key no Animation plays is rejected, so a typo cannot leave a frame silently at the default.

No front value. A frame facing the viewer inherits the default, and mirroring it changes nothing anyone sees.

Declarations

Each judged at full size (native-size strips, walk next to the frame in question).

Character Declared Why
Jotaro facing = "left", walk 0-7 right Every pose but the walk leans left (cap badge left of center). Fixes the backwards fall on a jump.
BMO fall 0-1 left Side panel shows right of the screen in the fall, left in the walk. Fixes the backwards fall.
Rubber Duck facing = "left", walk 0-7 right Idle, wave, thinking, pondering, talk, jump and doze face left. look-right ends facing right but keeps the default on purpose, so look-left and look-right mirror together and stay two different looks either way. A manifest comment says so.
Timber Wolf sleep 0-1 left Asleep, the cockpit nose points left; walking, right.
Tux, Tuxedo Bean walk-left 0-7 left Their left_of strips, drawn facing left. Without this they would now mirror.

Not declared: Trump sleep-2 (lying, head left, no heading to keep), Black Mage fall and land (prone, face hidden), Tux jump-4 and recover-card-4 (near front-on). Everything else faces right or the viewer.

ADR-0009 still says the worksheet it rejected "offers no flag" for left-facing art. That records the rejected option as it was, so it stays. ### Importer

scripts/import-pet.py no longer flips art. --mirror-walk and both ImageOps.mirror paths are gone, with no replacement flag.

  • Shimeji: frames kept as drawn, manifest declares facing = "left".
  • Petscodex: the walk is declared facing the way its row is drawn (row 2 right, row 1 left, written as [frame_facing] when it differs from the default). Other rows keep the default "right"; no code can see which way they face.
  • It prints declared: facing = "...", [frame_facing] ..., and --frames-only warns that the authored manifest's facing is kept.

A walk-row-1 import validated with character::load (Dot is a valid Character Package).

#2049 (open) touches engine.rs and possession, and #2068 (open) touches character.rs tests. Neither overlaps this logic. Whichever merges second merges main.

Evidence

  • Manifest tests: default and per-frame override (with the draw test in character.rs), bad facing, bad [frame_facing] value, [frame_facing] not a table, and a key no Animation plays.
  • Draw test: every declared x travel combination, plus a left_of strip declared left (not mirrored) and left at the default (mirrored).
  • jotaro_falls_facing_the_way_he_walks and bmo_falls_facing_the_way_it_walks read the real art (cap badge, side panel), apply drawn.mirrored, and assert every walk and fall frame faces the travel both ways. Against main's manifests both fail (fall-0.png drawn for travel 1, offsets -5.8 and -19.2). With this PR's manifests both pass. git diff origin/main --stat -- '*.png' is empty.
  • rubber_duck_faces_the_way_it_travels (beak) and timber_wolf_sleeps_facing_the_way_it_walks (missile racks) do the same for every resting duck frame, the duck's walk and left strip, and the wolf's walk and sleep. Both fail against main's manifests.
  • python scripts/import-pet.py --self-test passes: Shimeji frames stay unflipped and declare facing = "left", and a row-1 walk writes [frame_facing] left for each walk frame.
  • cargo test -p fidget-core, cargo clippy --workspace --all-targets -- -D warnings, node --test tests/*.test.js (898 pass with Python 3.12; the system python3 cannot parse the unchanged page generators, whose f-strings need 3.12), and pre-commit on changed files are green locally.

Merge Danger

Door: two-way. Manifest keys and one comparison in draw.
Blast Radius: which way shipped Characters' frames are drawn.

🤖 Generated with Claude Code

— Claude Code agent, on @omesser's behalf.

omesser and others added 3 commits November 1, 2026 22:40
Art was assumed to face right, so left-facing frames such as Jotaro's
and BMO's fall drew backwards. A Character default plus a per-file
override, and draw mirrors when the frame's facing is not the travel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: draw's f64 is the heading, not a Facing; the frame_facing
check sits with its sibling checks; the glossary gains Facing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omesser

This comment was marked as outdated.

omesser and others added 2 commits November 1, 2026 22:47
The importer flipped Shimeji art and offered --mirror-walk because the
renderer assumed right-facing frames. It now keeps the art as drawn,
declares the facing it can infer, and prints what it declared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Gate non-blocking item: their declarations had no real-art test. Both
fail against main's manifests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omesser

omesser commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Non-blocking item (untested declarations): addressed in 45cb6a9. rubber_duck_faces_the_way_it_travels and timber_wolf_sleeps_facing_the_way_it_walks read the real art (beak, missile racks), cover every resting duck frame plus its walk and left strip, and the wolf's walk and sleep, and both fail against main's manifests.

Also new since e559353, per the coordinator: scripts/import-pet.py declares facing instead of mirroring art (ccbdad8). --mirror-walk is gone; see the Importer section of the description.

— Claude Code agent, on @omesser's behalf.

omesser

This comment was marked as outdated.

Gate non-blocking item: --map walk=1 kept the default right facing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omesser

omesser commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Non-blocking item (mapped walk): addressed in fc99423. A walk mapped onto row 1 or 2 with --map now declares that row's heading; the self-test covers --map walk=1. A walk cut from any other row keeps the default, as before.

— Claude Code agent, on @omesser's behalf.

omesser

This comment was marked as outdated.

Gate non-blocking item: with --map walk=, the notes still named the
--walk-row row and heading. They now come from the same mapping that
cuts the frames and declares facing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omesser

omesser commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Non-blocking item (stale mapping notes): addressed in 6ae99aa. mapping_notes writes the comment from the same mappings that cut the frames, with each animation's row, indices and declared heading, so --map walk= can no longer leave the old row in it. The self-test asserts --map walk=1 names row 1 heading left and no row 2, and --map walk=7 names row 7 with no heading.

— Claude Code agent, on @omesser's behalf.

omesser

This comment was marked as outdated.

Gate non-blocking item: the mapping comment already names every --map
row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omesser

omesser commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Non-blocking item (repeated remap line): addressed in c975994. The "Remapped for this pet's art" sentence is gone; the mapping comment already names every --map row.

— Claude Code agent, on @omesser's behalf.

omesser

This comment was marked as outdated.

Gate non-blocking item: the old comment listed the unused rows, which
helps a hand remap. Derived from the same mapping, so it cannot drift.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omesser

omesser commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Non-blocking item (unused rows): addressed in bcc663f. The mapping comment ends with the sheet rows nothing was cut from, by number and petdex state, worked out from the same mapping (default import: "Unused rows: 1 (running-right), 7 (running)."). The self-test asserts that line.

— Claude Code agent, on @omesser's behalf.

omesser

This comment was marked as outdated.

Gate non-blocking item: only the default walk row's unused rows were
asserted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omesser

omesser commented Nov 1, 2026

Copy link
Copy Markdown
Owner Author

Non-blocking item (remapped case): addressed in 51a75fb. The self-test now asserts that --map walk=1 lists "Unused rows: 2 (running-left), 7 (running)."

— Claude Code agent, on @omesser's behalf.

@omesser omesser left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Soft CLEARED

Tip: 51a75fb1

What changed

  • Self-test: asserts that a --map walk import on row 1 names rows 2 and 7 as unused in the mapping notes.

What is wrong
Nothing blocking.

Soft-FIX
None

Verified: import-pet.py --self-test passes, and marking row 2 as used makes the new assertion fail.

— Cursor agent (Architect), on @omesser's behalf.

@omesser
omesser merged commit a96de15 into main Nov 1, 2026
13 of 14 checks passed
@omesser
omesser deleted the feat/2069-frame-facing branch November 1, 2026 23:56
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.

feat(characters): Declare which way frames face, per Character and per frame

1 participant