Add watercolour artwork for all campaign discoveries

This commit is contained in:
Hadrian Burkhardt
2026-10-31 18:25:02 +01:00
parent e163cbb832
commit 36fbbce6ef
32 changed files with 348 additions and 25 deletions
+18 -6
View File
@@ -42,7 +42,7 @@ lib/
└── board.dart Board, PencilMark painter, PixelPicture
assets/
├── campaign.json premise + 12 authored levels (chapter/title/object/before/after/picture/clues/areas)
├── campaign.json premise + 12 authored levels (chapter/title/object/before/after/picture/clues/areas; optional illustrationAsset)
├── narration/scripts.json canonical diary text, one record per recorded page
├── narration/manifest.json source masters and checksums for narration
├── audio/narration_manifest.json runtime tracks: file, duration, cue timings
@@ -52,7 +52,7 @@ assets/
└── fonts/DancingScript.ttf bundled as family MaraHand; OFL.txt ships with licences
test/puzzle_test.dart 8 domain tests (Java parity, generation, solver, awards, restore)
test/widget_test.dart 4 widget tests (page gestures, scrolling, landscape layout)
test/widget_test.dart 6 widget tests (page gestures, scrolling, landscape layout)
test/fixtures/java_boards.json 40 reference boards from the Java 1.7 version
integration_test/notebook_test.dart one on-device end-to-end test (QA flavour only)
scripts/ narration verification, install smoke check, narration rendering
@@ -157,7 +157,7 @@ stateDiagram-v2
| `contents` | `contents()` | `contents` | Dedication, opening-leaf links, ribbon bookmark, twelve campaign entries with access state, premise | none |
| `briefing` | `briefing()` | `briefing-<i>` | Chapter, title, `before` passage, "Restore the pattern →" | `turnCampaign()` |
| `game` | `game()` | `game-<key>` | Puzzle heading, area totals, square board, hint/undo, actions | `turnCampaign()` in campaign mode only |
| `reveal` | `reveal()` | `reveal-<i>` | Object name, `PixelPicture`, `after` passage, ending text on level 12 | `turnCampaign()` |
| `reveal` | `reveal()` | `reveal-<i>` | Object name, watercolour (or `PixelPicture` fallback), `after` passage, ending text on level 12 | `turnCampaign()` |
### Navigation methods (`Game`)
@@ -298,13 +298,14 @@ Board key formats (`<key>`):
## Content and assets
- `assets/campaign.json`: `{ premise, levels: [{ chapter, title, object, before, after, picture, clues, areas }] }`. `picture` is 49 characters of `0`/`1` (7×7, row-major). `clues` is a comma-separated list of forced-given indices. `areas` is `top,left,height,width` rectangles separated by `;` (labels A, B, C… in order).
- `assets/campaign.json`: `{ premise, levels: [{ chapter, title, object, before, after, picture, clues, areas, illustrationAsset? }] }`. `picture` is 49 characters of `0`/`1` (7×7, row-major). `clues` is a comma-separated list of forced-given indices. `areas` is `top,left,height,width` rectangles separated by `;` (labels A, B, C… in order).
- `assets/narration/scripts.json`: canonical diary text, one record per recorded page (`pageId`, `text`). `Book.load()` matches the six fixed page ids and titles; a missing script yields empty text.
- `assets/narration/manifest.json`: source masters, text hashes, WAV/FLAC hashes and cues — the provenance record.
- `assets/audio/narration_manifest.json`: runtime `{ tracks: { pageId: { file, durationMs, cues: [{ startMs, endMs, text }] } } }`. `Narrator` plays `assets/audio/<file>`.
- Five recordings exist: `cottage.dedication`, `cottage.window`, `cottage.match.memory`, `cottage.folded.note`, `cottage.lantern.sketch`. The match-puzzle leaf has no recording.
- WAV is the runtime format because FLAC advanced its clock without an audio track on the API 26 Huawei tablet used for testing. FLAC files remain as archives but are not listed in `pubspec.yaml`, so they are not bundled.
- Artwork: `mara-single-page-v2.png` (page), `home-harbour-v2.png`, `home-notebook-cover-v2.png`, `cottage-vignette-v1.png`, `lantern-vignette-v1.png`; prompts and provenance live beside each file.
- Artwork: `mara-single-page-v2.png` (page), `home-harbour-v2.png`, `home-notebook-cover-v2.png`, `cottage-vignette-v1.png`, `lantern-vignette-v1.png`, `harbour-bell-vignette-v1.png`, plus `match`, `brass-key`, `compass`, `little-boat`, `anchor`, `stone-bridge`, `missing-gear`, `beacon-lens`, `lighthouse` and `home` (each `<name>-vignette-v1.png`); prompts and provenance live beside each file.
- Campaign reveals use optional `CampaignLevel.illustrationAsset` paths from campaign JSON. All twelve discoveries have watercolours; absent or unloadable image assets fall back to `PixelPicture`. The opening match memory shares the first campaign illustration through `discoveryArt()`. No puzzle identity or progress keys change.
- Font: `assets/fonts/DancingScript.ttf` registered as `MaraHand`; `assets/fonts/OFL.txt` is registered with `LicenseRegistry` in `main()`.
- `pubspec.yaml` lists every bundled asset explicitly (no directory globs), so new assets must be added there.
@@ -329,8 +330,9 @@ Board key formats (`<key>`):
| File | Covers |
| --- | --- |
| `test/puzzle_test.dart` | 40 Java reference boards (signed 64-bit seeds), 300 graded boards, solver counts vs. exhaustive search, campaign uniqueness/no-guess, streaks, fresh progress, read-ahead, daily awards and practice levels |
| `test/widget_test.dart` | Page swipes vs. grid drags, swipes over text/blank paper, vertical scrolling and cancelled drags, small/landscape/1.5× text, landscape two-column puzzle leaf |
| `test/widget_test.dart` | Page swipes vs. grid drags, swipes over text/blank paper, vertical scrolling and cancelled drags, small/landscape/1.5× text, landscape two-column puzzle leaf, illustrated campaign reveals and pixel fallback at 1.5× text |
| `integration_test/notebook_test.dart` | On-device QA flow: six leaves, real WAV playback and pause/resume, bookmarks/discoveries, match and lantern solves, exactly-once awards, QA disk round-trip, screenshots |
| `integration_test/discovery_art_test.dart` | QA tablet screenshots of all twelve discoveries and the opening match memory, portrait/landscape at 1.5× text; checks reachable controls and unchanged awards |
| `scripts/check_narration_assets.py` | Script text ↔ manifest ↔ WAV masters checksums |
| `scripts/check_flutter_install.py` | Read-only installed-app smoke check and screenshots |
| `scripts/render_narration.py` | Renders the fixed WAV masters and FLAC archives; the app never synthesises speech |
@@ -352,6 +354,16 @@ flutter drive --driver test_driver/integration_test.dart \
--dart-define=QA_TEST=true -d YOUR_ANDROID_DEVICE
```
Artwork QA uses one chapter per run to keep full-resolution screenshot exports within tablet memory limits. Run the following with `ART_CHAPTER=0`, `1` and `2` (zero-based chapters):
```sh
flutter drive --driver test_driver/integration_test.dart \
--target integration_test/discovery_art_test.dart --flavor qa \
--dart-define=QA_TEST=true --dart-define=ART_CHAPTER=0 -d YOUR_ANDROID_DEVICE
```
Each run checks four discoveries in both orientations at 1.5× text, including navigation after scrolling. Chapter 0 also captures the opening match memory. Screenshots go to `artifacts/flutter-check/`.
## Conventions and invariants
1. **One state owner.** Navigation, the active puzzle and awards live in `Game`. Screens are pure builders in `_NotebookState`; UI-only toggles (e.g. folding the note) use `setState` after persisting the preference.