Complete cottage notebook with narration and discovery-only artwork

This commit is contained in:
Hadrian Burkhardt
2026-11-01 00:18:34 +01:00
parent 36fbbce6ef
commit 6bd14a9e20
90 changed files with 2394 additions and 221 deletions
+16 -5
View File
@@ -6,11 +6,11 @@ Android is the tested target. iOS project scaffolding and test AdMob configurati
## Play ## Play
- Six opening notebook leaves: a dedication, illustrated cottage entry, match puzzle, memory, folded note and inspectable lantern. - Sixteen cottage notebook leaves: the original dedication, cottage entry, folded note and repair note, plus separate entries, puzzles and illustrated memories for the match, lantern, key and compass, and a closing leaf toward the harbour.
- Horizontal swipes across the writing or blank paper, plus corner arrows, turn leaves. Grid and control gestures never turn pages; vertical drags still scroll. Navigation stays fixed; overflow scrolling supports smaller screens and larger text. - Horizontal swipes across the writing or blank paper, plus corner arrows, turn leaves. Grid and control gestures never turn pages; vertical drags still scroll. Navigation stays fixed; overflow scrolling supports smaller screens and larger text.
- Landscape pages rearrange themselves: a puzzle keeps its whole grid in one column, with the heading, area totals, hint and undo beside it, and the leaf navigation folds into a single row. The board stays fully visible without scrolling, even with larger text. - Landscape pages rearrange themselves: a puzzle keeps its whole grid in one column, with the heading, area totals, hint and undo beside it, and the leaf navigation folds into a single row. The board stays fully visible without scrolling, even with larger text.
- A saved ribbon bookmark, opened note, inspected repair, viewed pages and current reading place. - A saved ribbon bookmark, opened note, inspected repair, viewed pages and current reading place.
- Twelve 7×7 picture puzzles across three chapters, with overlapping-area deductions on entries 3–12. Later chapters retain their briefing/puzzle/reveal structure, now with swipes between those pages too. Reading ahead keeps unfinished boards and completion awards separate. - Twelve 7×7 picture puzzles across three chapters, with overlapping-area deductions on entries 3–12. Chapters II and III retain their briefing/puzzle/reveal structure, with swipes between those pages too. Chapter contents shows four entries at a time. Reading ahead keeps unfinished boards and completion awards separate.
- Deterministic daily grids and generated Easy, Medium and Hard 5×5 practice. The grades measure deduction-chain depth, not expert-level difficulty. Every board has a unique solution and needs no guessing. - Deterministic daily grids and generated Easy, Medium and Hard 5×5 practice. The grades measure deduction-chain depth, not expert-level difficulty. Every board has a unique solution and needs no guessing.
- Undo, one free explained hint per puzzle, then optional rewarded hints. Later hints require the AdMob reward callback. An unavailable ad never blocks the board. - Undo, one free explained hint per puzzle, then optional rewarded hints. Later hints require the AdMob reward callback. An unavailable ad never blocks the board.
- Local daily streaks, independent difficulty levels and exactly-once puzzle completion awards. - Local daily streaks, independent difficulty levels and exactly-once puzzle completion awards.
@@ -22,9 +22,9 @@ Progress starts fresh in Flutter, as requested. Old Java `lumen.xml` saves are *
All app-created text uses the bundled Dancing Script handwriting font, including grid clues and menus. Lit cells are shaded with pencil strokes, and dark cells use a drawn cross; neither depends on a symbol-font fallback. Original watercolour harbour, cloth cover, cottage, lantern and single-page art remain bundled for offline use. Native text sits directly on the page’s blank writing area. Art prompts and provenance are in [assets/artwork](assets/artwork/README.md); the font’s OFL license ships in the app’s open-source licenses. All app-created text uses the bundled Dancing Script handwriting font, including grid clues and menus. Lit cells are shaded with pencil strokes, and dark cells use a drawn cross; neither depends on a symbol-font fallback. Original watercolour harbour, cloth cover, cottage, lantern and single-page art remain bundled for offline use. Native text sits directly on the page’s blank writing area. Art prompts and provenance are in [assets/artwork](assets/artwork/README.md); the font’s OFL license ships in the app’s open-source licenses.
Campaign discoveries now support optional watercolour keepsakes declared in the campaign data. All twelve discoveries have illustrations, and the opening match memory uses the same match watercolour. Pixel pictures remain the fallback for entries without usable artwork. Campaign discoveries now support optional watercolour keepsakes declared in the campaign data. All twelve discoveries have illustrations, and the opening match memory uses the same match watercolour. Each object’s artwork appears only on its discovery leaf after its own pattern is solved. Entry pages, the earlier repair note and the closing leaf never display discovery art, even with completed progress. Pixel pictures are also hidden until solved and remain the fallback for missing artwork.
Five fixed, pre-rendered synthetic British-English readings play from bundled PCM16 WAV files, identical to the reviewed masters. Lossless FLAC exports are retained in the source project but excluded from the APK. WAV avoids a Huawei API 26 failure where FLAC playback advances its clock without creating an audio track. `just_audio` plays bundled files; there is no Android reader, runtime synthesis or audio download. Controls support play, pause, resume at the same position, stop, replay, speed and passage highlighting. Leaving a page or backgrounding the app stops playback. See [narration provenance](assets/narration/README.md). Twenty-eight fixed, pre-rendered synthetic recordings play from bundled PCM16 WAV files. Mara’s five original British-English diary readings are preserved; twenty-three guiding passages use a distinct narrator voice, covering the cottage entries/memories/closing leaf and the later campaign introductions and discoveries. All recordings are opt-in, labelled by speaker and support pause/resume, stop, replay, speed and passage highlighting. Page turns and backgrounding stop playback. WAV avoids the Huawei API 26 FLAC playback issue; archival FLACs stay out of the APK. There is no Android reader, runtime synthesis or audio download. See [narration provenance](assets/narration/README.md).
## Build and run ## Build and run
@@ -43,6 +43,10 @@ Use `JAVA_HOME=/path/to/jdk-21` if your default JDK is incompatible with Gradle.
# Separate QA package: com.lumen.daily.qa # Separate QA package: com.lumen.daily.qa
flutter build apk --debug --flavor qa flutter build apk --debug --flavor qa
# QA permits SD-card installation on devices that support external apps.
# Install explicitly with: adb install -r -s PATH_TO_QA_APK
# The review Huawei rejects SD app installs; use adb install -r -f there.
# Optimized development APK for the connected arm64 tablet # Optimized development APK for the connected arm64 tablet
flutter build apk --release --flavor prod --target-platform android-arm64 flutter build apk --release --flavor prod --target-platform android-arm64
``` ```
@@ -67,7 +71,7 @@ flutter drive --driver test_driver/integration_test.dart \
--dart-define=QA_TEST=true -d YOUR_ANDROID_DEVICE --dart-define=QA_TEST=true -d YOUR_ANDROID_DEVICE
``` ```
The fourteen unit/widget tests cover 40 Java reference boards (including signed 64-bit seeds), 300 graded generated boards, solver counts against 300 exhaustive small systems, all twelve campaign solutions, streaks, fresh progress, read-ahead, completion awards, campaign read-ahead restoration, gesture isolation, swipes over text and blank paper, cancelled drags, vertical scrolling, landscape and larger text; it also checks the landscape two-column puzzle leaf. Reference parity protects the port’s rules; it is not used to migrate saves. The twenty unit/widget tests cover 40 Java reference boards (including signed 64-bit seeds), 300 graded generated boards, solver counts against 300 exhaustive small systems, all twelve campaign solutions, streaks, fresh progress, read-ahead, completion awards, campaign read-ahead restoration, gesture isolation, swipes over text and blank paper, cancelled drags, vertical scrolling, landscape and larger text; it also checks every cottage leaf with the real font at 1.5× text, all four hint controls, legacy route migration and exactly-once completion after restart. Reference parity protects the port’s rules; it is not used to migrate saves.
The physical-device integration test uses a disposable in-memory game plus an isolated QA disk round-trip. It plays all five real WAV files, checks pause/resume, explores the six leaves, verifies bookmarks/discoveries, solves match and lantern puzzles and checks exactly-once awards. Screenshots are saved in `artifacts/flutter-check/`. The release smoke script requires an active, unmuted 24 kHz media track in the tablet’s audio mixer as well as exercising the actual play/pause/resume UI and restores the last page after process restart, without injecting puzzle fixtures. The release build includes a targeted R8 keep rule for the database constructor used reflectively by AdMob’s WorkManager dependency. Advertising is disabled for the automated story tests; real UMP startup is checked separately in the normal build. Reward delivery, cancellation and ad no-fill still need manual release testing with your final AdMob configuration. The physical-device integration test uses a disposable in-memory game plus an isolated QA disk round-trip. It plays all five real WAV files, checks pause/resume, explores the six leaves, verifies bookmarks/discoveries, solves match and lantern puzzles and checks exactly-once awards. Screenshots are saved in `artifacts/flutter-check/`. The release smoke script requires an active, unmuted 24 kHz media track in the tablet’s audio mixer as well as exercising the actual play/pause/resume UI and restores the last page after process restart, without injecting puzzle fixtures. The release build includes a targeted R8 keep rule for the database constructor used reflectively by AdMob’s WorkManager dependency. Advertising is disabled for the automated story tests; real UMP startup is checked separately in the normal build. Reward delivery, cancellation and ad no-fill still need manual release testing with your final AdMob configuration.
@@ -95,3 +99,10 @@ Create your production Android AdMob app and ad units, configure Privacy & messa
For Android, supply the app ID using Gradle property `ADMOB_APP_ID`. Rewarded/interstitial unit IDs use Dart compile-time defines `ADMOB_REWARDED_ID` and `ADMOB_INTERSTITIAL_ID`. iOS needs its own app ID in `ios/Runner/Info.plist` and iOS-specific ad unit IDs. Verify consent refusal/revocation, reward completion/cancellation, offline/no-fill behavior, lifecycle interruptions, accessibility and release signing on physical devices before submitting an AAB. For Android, supply the app ID using Gradle property `ADMOB_APP_ID`. Rewarded/interstitial unit IDs use Dart compile-time defines `ADMOB_REWARDED_ID` and `ADMOB_INTERSTITIAL_ID`. iOS needs its own app ID in `ios/Runner/Info.plist` and iOS-specific ad unit IDs. Verify consent refusal/revocation, reward completion/cancellation, offline/no-fill behavior, lifecycle interruptions, accessibility and release signing on physical devices before submitting an AAB.
See [ROADMAP.md](ROADMAP.md) for the proposed 30–40-leaf campaign, page variety and further exploration ideas. Smaller follow-ups and asset tasks are tracked in [TODO.md](TODO.md). See [ROADMAP.md](ROADMAP.md) for the proposed 30–40-leaf campaign, page variety and further exploration ideas. Smaller follow-ups and asset tasks are tracked in [TODO.md](TODO.md).
Chapter I page records live in `assets/notebook.json`. The original six IDs and `story_v1_0`–`story_v1_3` puzzle keys are preserved. Existing cottage briefing, puzzle and reveal saves reopen on their corresponding leaves. Reading ahead never awards a puzzle completion; leaving the cottage opens Chapter II even when patterns remain unfinished. All seven added prose leaves have narrator recordings; the original five diary recordings remain unchanged.
To review the complete chapter on an isolated QA install, run `flutter drive --driver test_driver/integration_test.dart --target integration_test/cottage_test.dart --flavor qa --dart-define=QA_TEST=true -d YOUR_ANDROID_DEVICE`. This traverses all sixteen leaves, checks bookmarks/restart, rotates the compass puzzle at larger text, solves all four patterns and checks QA disk persistence. It saves eight screenshots in `artifacts/flutter-check/`.
Device automation can use the `check` flavor (`com.lumen.daily.check`) to preserve the installed QA app and its progress. It has its own preferences and test data. Use `--flavor check` with the integration commands above for an isolated run alongside QA.
+3 -3
View File
@@ -1,6 +1,6 @@
# Lumen — a notebook worth exploring # Lumen — a notebook worth exploring
Status: opening slice ported to Dart and Flutter in version 2.0. The six-leaf opening slice below is implemented and ready for review: reading-area swipes, arrows, five bundled recorded readings, two on-page illustrations and refreshed home art, a saved ribbon bookmark, a folded note, a lantern inspection, and the existing match puzzle/reveal. Full chapter pagination, the larger 30–40-leaf story and later exploration features remain proposed. The Flutter port retains these features and starts fresh progress, as requested. Android is the tested target; iOS scaffolding is present but not yet validated. There are no delivery dates yet; review the opening slice before expanding it. Status: Chapter I is implemented as sixteen notebook leaves, with separate entries, puzzles and illustrated memories for all four cottage discoveries, chapter contents, stable page IDs, read-ahead and saved bookmarks. The original six leaves and five Mara readings are preserved; twenty-three additional guiding passages now have a distinct bundled narrator voice. All twelve campaign discoveries have watercolour artwork, shown only on the discovery leaf after the corresponding puzzle is solved; introductory and repair-note leaves stay free of object artwork even on revisits. Chapters II and III retain their earlier briefing/puzzle/reveal screens; their full pagination, the larger 30–40-leaf notebook and later exploration remain proposed. Android is the tested target; iOS scaffolding is not yet validated. Review the complete cottage chapter before expanding the remaining chapters. No delivery dates are set.
## The experience we are building ## The experience we are building
@@ -17,8 +17,8 @@ Success is the player wanting to turn another page, remember a detail, or return
- Three chapters with twelve authored picture puzzles and short passages before and after them. - Three chapters with twelve authored picture puzzles and short passages before and after them.
- A single-page diary background, handwriting, recovered pixel pictures, and saved local progress. - A single-page diary background, handwriting, recovered pixel pictures, and saved local progress.
- Explained puzzle hints, generated classic practice, and a daily challenge. - Explained puzzle hints, generated classic practice, and a daily challenge.
- Six opening leaves with reading-area swipes and corner arrows, optional bundled recordings, cottage and lantern illustrations, a folded note, inspection, and independent reading bookmarks. - Sixteen cottage leaves with reading-area swipes, corner arrows, chapter contents, illustrated discoveries, a folded note, inspection and independent reading bookmarks. The five original diary readings and twenty-three guiding narrator recordings are available.
- Existing campaign pages beyond this prototype now support swipes between briefing, puzzle and memory screens, with optional read-ahead that preserves puzzle progress. Their full illustrated pagination remains proposed. Overflow scrolling remains for large text and shorter viewports. - Campaign pages in Chapters II and III now support swipes between briefing, puzzle and memory screens, with optional read-ahead that preserves puzzle progress. Their full illustrated pagination remains proposed. Overflow scrolling remains for large text and shorter viewports.
## Phase 1 — make it a book ## Phase 1 — make it a book
+1
View File
@@ -34,6 +34,7 @@ android {
productFlavors { productFlavors {
create("prod") { dimension = "edition" } create("prod") { dimension = "edition" }
create("qa") { dimension = "edition"; applicationIdSuffix = ".qa"; versionNameSuffix = "-qa" } create("qa") { dimension = "edition"; applicationIdSuffix = ".qa"; versionNameSuffix = "-qa" }
create("check") { dimension = "edition"; applicationIdSuffix = ".check"; versionNameSuffix = "-check" }
} }
buildTypes { buildTypes {
release { release {
+2
View File
@@ -0,0 +1,2 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="preferExternal" />
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+562
View File
@@ -149,6 +149,568 @@
], ],
"flacFile": "narration_cottage_lantern_sketch.flac", "flacFile": "narration_cottage_lantern_sketch.flac",
"wavSha256": "53dd694b9933f94bcda72582d0c6b1bb5b656898a73c87d66ecfa0874ba3a29d" "wavSha256": "53dd694b9933f94bcda72582d0c6b1bb5b656898a73c87d66ecfa0874ba3a29d"
},
"cottage.lantern.entry": {
"pageId": "cottage.lantern.entry",
"resource": "narration_cottage_lantern_entry",
"text": "A small flame will not survive the wind. Mara’s next page shows what she carried on her evening rounds.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_lantern_entry.wav",
"flacFile": "narration_cottage_lantern_entry.flac",
"wavSha256": "9ad019bd823e3d31dbfde3f1a29c6d643e11640cafd009ca77d3b3ff5096995a",
"sampleRate": 24000,
"channels": 1,
"frames": 201504,
"durationMs": 8396,
"textSha256": "ca19c2ac4a7aa40f3d4c9c5c85957618972432a71a3e12dce1ccdd59ada65b0c",
"flacSha256": "0b76706fbb868ddcb26a36e6a90f4badc2fd4c7e751ca6639c75a46c4fcb1323",
"cues": [
{
"startMs": 180,
"endMs": 7796,
"text": "A small flame will not survive the wind. Mara’s next page shows what she carried on her evening rounds."
}
]
},
"cottage.lantern.memory": {
"pageId": "cottage.lantern.memory",
"resource": "narration_cottage_lantern_memory",
"text": "The lantern is soot-black but sound. Its warm circle of light reaches the cottage door. Beneath the handle, Mara has scratched your initials.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_lantern_memory.wav",
"flacFile": "narration_cottage_lantern_memory.flac",
"wavSha256": "80485840ab6d00a1c6883ec2eaab36a19cffe2fbb69d026b3a417613787b4aa0",
"sampleRate": 24000,
"channels": 1,
"frames": 254752,
"durationMs": 10615,
"textSha256": "3c6af7f276cb7f24b9d20d0c120c85d1fad02a62328a2fd230826b9f6b2f3ba5",
"flacSha256": "ad285b1ac2717f93b284e727748fa8bbe0a72dd1cea4607eca5d723330e5b305",
"cues": [
{
"startMs": 180,
"endMs": 10015,
"text": "The lantern is soot-black but sound. Its warm circle of light reaches the cottage door. Beneath the handle, Mara has scratched your initials."
}
]
},
"cottage.key.entry": {
"pageId": "cottage.key.entry",
"resource": "narration_cottage_key_entry",
"text": "‘Some clues belong to more than one place,’ Mara wrote. Compare the overlapping areas on this page; a shared cell counts in both. A loose floorboard waits by the door.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_key_entry.wav",
"flacFile": "narration_cottage_key_entry.flac",
"wavSha256": "8124e1c156b41b69b52305c4c1e2fcae5005f6d2829eddbbecc952eebb73cfdb",
"sampleRate": 24000,
"channels": 1,
"frames": 299808,
"durationMs": 12492,
"textSha256": "e9659d973e1c29a9b21479959a3859978ffb1feace593d6f15fd0536a9810269",
"flacSha256": "c54b40e8cdc5cd229a2ed3590a5ca59b103458082dae5a431a46a51c4bce2d94",
"cues": [
{
"startMs": 180,
"endMs": 11892,
"text": "‘Some clues belong to more than one place,’ Mara wrote. Compare the overlapping areas on this page; a shared cell counts in both. A loose floorboard waits by the door."
}
]
},
"cottage.key.memory": {
"pageId": "cottage.key.memory",
"resource": "narration_cottage_key_memory",
"text": "A brass key turns up beneath the board. The tag reads ‘harbour store’. Someone prepared for a journey and never quite made it out of the cottage.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_key_memory.wav",
"flacFile": "narration_cottage_key_memory.flac",
"wavSha256": "1f65e40bffcd282c2a87e087c952fa62f66e6207885e11eef3ca1fb0810c2991",
"sampleRate": 24000,
"channels": 1,
"frames": 249632,
"durationMs": 10401,
"textSha256": "f1587b172b4801b53b45f45d26e761e77dda0c7417308000307efed88b20e576",
"flacSha256": "53449485cb0f384ecfa5c88c427bec74a2fbbb8d71a9e92ad93bddc41a8b6844",
"cues": [
{
"startMs": 180,
"endMs": 9801,
"text": "A brass key turns up beneath the board. The tag reads ‘harbour store’. Someone prepared for a journey and never quite made it out of the cottage."
}
]
},
"cottage.compass.entry": {
"pageId": "cottage.compass.entry",
"resource": "narration_cottage_compass_entry",
"text": "The lane has vanished beneath fallen branches. One last page in the cottage points you towards the harbour. Use what the areas share to work out what lies outside them.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_compass_entry.wav",
"flacFile": "narration_cottage_compass_entry.flac",
"wavSha256": "2671c9657c54803c9b5e571cf5bea42cd5a2bffb0ca848444e99bdbaf5effa55",
"sampleRate": 24000,
"channels": 1,
"frames": 306976,
"durationMs": 12791,
"textSha256": "2fef65403ef1a1cb2ce4f480783ec409beeccb5f4eb595dd22ab9dd6fb0b6c25",
"flacSha256": "51f6641757834d05578dc11dd627c0deafb210e7979ffc01df0e2effcab9c79d",
"cues": [
{
"startMs": 180,
"endMs": 12191,
"text": "The lane has vanished beneath fallen branches. One last page in the cottage points you towards the harbour. Use what the areas share to work out what lies outside them."
}
]
},
"cottage.compass.memory": {
"pageId": "cottage.compass.memory",
"resource": "narration_cottage_compass_memory",
"text": "The compass needle settles towards the sea. Tucked inside its lid is a note: ‘When the path disappears, keep your bearings.’ You step into the rain.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_compass_memory.wav",
"flacFile": "narration_cottage_compass_memory.flac",
"wavSha256": "f48f72546552401da03f5288177f690a4dff35c4811bde7589034534759ca30b",
"sampleRate": 24000,
"channels": 1,
"frames": 273696,
"durationMs": 11404,
"textSha256": "66b381628bd2c774e0372f4afb69783aad92363c142e41305b4b2980d4ad6ba7",
"flacSha256": "798488e7b13b1d858b90c8507cbfedbad558ed33a172128438978b3594a1cb42",
"cues": [
{
"startMs": 180,
"endMs": 10804,
"text": "The compass needle settles towards the sea. Tucked inside its lid is a note: ‘When the path disappears, keep your bearings.’ You step into the rain."
}
]
},
"cottage.threshold": {
"pageId": "cottage.threshold",
"resource": "narration_cottage_threshold",
"text": "The lantern waits by the door. You fold Gran’s note along its old crease and tuck it beside the harbour key.\n\nOutside, the lane smells of rain. You remember her advice about the latch: lift it a little, then turn.\n\nBeyond the cottage, the path leads down to the water. There is still a light to bring home.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_threshold.wav",
"flacFile": "narration_cottage_threshold.flac",
"wavSha256": "11c280d613222ccc2eecd68aac6f594950d3007f6d9269d208d4fef9aad29660",
"sampleRate": 24000,
"channels": 1,
"frames": 549280,
"durationMs": 22887,
"textSha256": "6eaa8e719d1a747a6201279182a2ce4c8c56fcd8f60132525ed23a242c617e82",
"flacSha256": "eadafc890ee55f2855d80ff5f2b4fa7011d68bb4dbf521820902aeebfe7870c1",
"cues": [
{
"startMs": 180,
"endMs": 7561,
"text": "The lantern waits by the door. You fold Gran’s note along its old crease and tuck it beside the harbour key."
},
{
"startMs": 8161,
"endMs": 15841,
"text": "Outside, the lane smells of rain. You remember her advice about the latch: lift it a little, then turn."
},
{
"startMs": 16441,
"endMs": 22287,
"text": "Beyond the cottage, the path leads down to the water. There is still a light to bring home."
}
]
},
"campaign.4.before": {
"pageId": "campaign.4.before",
"resource": "narration_campaign_4_before",
"text": "The tide has covered the causeway. A shape knocks gently against the harbour steps. Mara’s notebook has a page for this crossing too.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_4_before.wav",
"flacFile": "narration_campaign_4_before.flac",
"wavSha256": "da3226933f6c6ee0c0fe15369b321dc032a5f436baef58b8a449f29561e59a75",
"sampleRate": 24000,
"channels": 1,
"frames": 237856,
"durationMs": 9911,
"textSha256": "239a9687e7edc99f13cd9f0dc0784aa9023f0e542feefb7fe76122c983b851af",
"flacSha256": "0fb36a1f2e3dc856bf98c8699dcf2d4d1e67679237e3f093de21b1fd1fa042e0",
"cues": [
{
"startMs": 180,
"endMs": 9311,
"text": "The tide has covered the causeway. A shape knocks gently against the harbour steps. Mara’s notebook has a page for this crossing too."
}
]
},
"campaign.4.after": {
"pageId": "campaign.4.after",
"resource": "narration_campaign_4_after",
"text": "The little boat is still tied fast. You bail out the rainwater, set the lantern in the bow, and push away from the steps.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_4_after.wav",
"flacFile": "narration_campaign_4_after.flac",
"wavSha256": "4c9a053729fbee2e7324642e22e82f021ff59f04a035dec4d0f7bf4c3e2f4ec3",
"sampleRate": 24000,
"channels": 1,
"frames": 221984,
"durationMs": 9249,
"textSha256": "8b041c5d167c54c2189be16043ed299551046d83067df75652847ccd05ea8675",
"flacSha256": "05c07db2e53969f82d6e9387db92ec53d401ed9378971a41708074e431cc0f6a",
"cues": [
{
"startMs": 180,
"endMs": 8649,
"text": "The little boat is still tied fast. You bail out the rainwater, set the lantern in the bow, and push away from the steps."
}
]
},
"campaign.5.before": {
"pageId": "campaign.5.before",
"resource": "narration_campaign_5_before",
"text": "The current tugs you towards the outer rocks. Something heavy is tangled beneath the seat. The pattern tells you what to reach for.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_5_before.wav",
"flacFile": "narration_campaign_5_before.flac",
"wavSha256": "cd99d067df878bf9792b24c15a37ae350855f1b5650f177fcfd0e88dfa279f1a",
"sampleRate": 24000,
"channels": 1,
"frames": 219936,
"durationMs": 9164,
"textSha256": "32eb4035740297dd56922779e5cfa830dff9a94d3044fd7b668e97b7c1178fef",
"flacSha256": "c6955d7f797e35bd2beeb938458c6cf9963780cbaa1c88852b0a51bdbb8723ba",
"cues": [
{
"startMs": 180,
"endMs": 8564,
"text": "The current tugs you towards the outer rocks. Something heavy is tangled beneath the seat. The pattern tells you what to reach for."
}
]
},
"campaign.5.after": {
"pageId": "campaign.5.after",
"resource": "narration_campaign_5_after",
"text": "The anchor catches. The boat swings into calmer water. In the pause, you hear a bell somewhere beyond the fog.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_5_after.wav",
"flacFile": "narration_campaign_5_after.flac",
"wavSha256": "e3997b534cf3b953a6a04fd32a02ac0f5ff907f444ec2602e263b240a92c2fef",
"sampleRate": 24000,
"channels": 1,
"frames": 200480,
"durationMs": 8353,
"textSha256": "63e03e04b4d267e38d042787aa813b246b248e366e9ad32a3a289539161eea02",
"flacSha256": "f2c000ab339c66019fc9c66fa60d9907ee6081099e733e9aa50a82368d4e5408",
"cues": [
{
"startMs": 180,
"endMs": 7753,
"text": "The anchor catches. The boat swings into calmer water. In the pause, you hear a bell somewhere beyond the fog."
}
]
},
"campaign.6.before": {
"pageId": "campaign.6.before",
"resource": "narration_campaign_6_before",
"text": "You land beneath the lighthouse hill. The old crossing is hidden by reeds. Mara marked its outline long before the storm.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_6_before.wav",
"flacFile": "narration_campaign_6_before.flac",
"wavSha256": "aa608ff2544d0ca9417f1676bb45e4f0398632a9587242e6b77a1ad47b1c7373",
"sampleRate": 24000,
"channels": 1,
"frames": 217888,
"durationMs": 9079,
"textSha256": "cafa0efdd8fd07e9fc4b2f35f0f3ba1b1324193cea4d6b524e60382b4663b2e6",
"flacSha256": "f3cb885505deaeb7cd80926fffd27fcfccb7715a10d6a869c0331003ca68bec9",
"cues": [
{
"startMs": 180,
"endMs": 8479,
"text": "You land beneath the lighthouse hill. The old crossing is hidden by reeds. Mara marked its outline long before the storm."
}
]
},
"campaign.6.after": {
"pageId": "campaign.6.after",
"resource": "narration_campaign_6_after",
"text": "The bridge is intact. You cross with the lantern held high. On the far bank, a fresh bootprint tells you someone else has passed this way.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_6_after.wav",
"flacFile": "narration_campaign_6_after.flac",
"wavSha256": "0898962455959f57ba4dc533561dd56255d1d2ced7161470881e31d8abfcaf43",
"sampleRate": 24000,
"channels": 1,
"frames": 245536,
"durationMs": 10231,
"textSha256": "51d543acaa3ed8d0da5fa294a7b210f2375030a0fda6ce3a97c83dfaa0408bda",
"flacSha256": "bbaa067856e323723fea0a74e7f6cda47b701d8f0a61c9bdbb124bfa7757ba57",
"cues": [
{
"startMs": 180,
"endMs": 9631,
"text": "The bridge is intact. You cross with the lantern held high. On the far bank, a fresh bootprint tells you someone else has passed this way."
}
]
},
"campaign.7.before": {
"pageId": "campaign.7.before",
"resource": "narration_campaign_7_before",
"text": "A rope hangs from a timber frame. The bell above it has fallen silent. Restore the pattern before you call out across the water.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_7_before.wav",
"flacFile": "narration_campaign_7_before.flac",
"wavSha256": "cca7a758b8f93793fec73cd7173f175fd58b0ecd86802b5a27ad0f8c2e9d9cdc",
"sampleRate": 24000,
"channels": 1,
"frames": 226080,
"durationMs": 9420,
"textSha256": "fbe874dbb47488fe436439e3c6e57cf86d049389f01218dbe45b094b020f633a",
"flacSha256": "1d0fd3c2c788c517aa6ef3fd784ead9067da5399a7ac1a6c32d32e8876a23d89",
"cues": [
{
"startMs": 180,
"endMs": 8820,
"text": "A rope hangs from a timber frame. The bell above it has fallen silent. Restore the pattern before you call out across the water."
}
]
},
"campaign.7.after": {
"pageId": "campaign.7.after",
"resource": "narration_campaign_7_after",
"text": "One clear note travels into the fog. Two notes answer from the hill. Someone is waiting at the lighthouse.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_7_after.wav",
"flacFile": "narration_campaign_7_after.flac",
"wavSha256": "bc1c6162ea5b88055eddbf91952d6d5f49af3be103703433e26eb532c6d507cc",
"sampleRate": 24000,
"channels": 1,
"frames": 192800,
"durationMs": 8033,
"textSha256": "1a14efc63b63744efdf0c8b3eeb3f7fdba29412e91740eaff5ecc9d68894d87e",
"flacSha256": "cd4caa09c07336ea1816190ab737129da4227659ad7eb95779b64d50811534ba",
"cues": [
{
"startMs": 180,
"endMs": 7433,
"text": "One clear note travels into the fog. Two notes answer from the hill. Someone is waiting at the lighthouse."
}
]
},
"campaign.8.before": {
"pageId": "campaign.8.before",
"resource": "narration_campaign_8_before",
"text": "Mara opens the lighthouse door. ‘I knew you’d find the notebook,’ she says. The storm stopped the turning mechanism. Together, you lay out its scattered parts.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_8_before.wav",
"flacFile": "narration_campaign_8_before.flac",
"wavSha256": "4282678379a27aade271230eda6219c97937a0a58e3cef69916dae355591cb02",
"sampleRate": 24000,
"channels": 1,
"frames": 270624,
"durationMs": 11276,
"textSha256": "4a5d2997866ad6d570db169562c4d636fa4a4a5dbbc46938bb62c800718df24f",
"flacSha256": "d928d24044567f7eccb2e1d63ace14f5dcaf5bcc83e7b0969379b019e98ffa04",
"cues": [
{
"startMs": 180,
"endMs": 10676,
"text": "Mara opens the lighthouse door. ‘I knew you’d find the notebook,’ she says. The storm stopped the turning mechanism. Together, you lay out its scattered parts."
}
]
},
"campaign.8.after": {
"pageId": "campaign.8.after",
"resource": "narration_campaign_8_after",
"text": "The missing gear slips into place. You turn the handle; the mechanism answers with a familiar, steady ticking. Mara smiles without looking up.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_8_after.wav",
"flacFile": "narration_campaign_8_after.flac",
"wavSha256": "476f45fe49f4dcb86c8c02999e357392a75d9732622ae4bfa28268a792fc37e1",
"sampleRate": 24000,
"channels": 1,
"frames": 257824,
"durationMs": 10743,
"textSha256": "0661c45756104d69eab2c6f02eb7c6fac8cac4c59fb46673b94b32e6431b3b57",
"flacSha256": "00d60f40e56567da445cf22db5b4769fdab15d42767293200680f7f3e740172d",
"cues": [
{
"startMs": 180,
"endMs": 10143,
"text": "The missing gear slips into place. You turn the handle; the mechanism answers with a familiar, steady ticking. Mara smiles without looking up."
}
]
},
"campaign.9.before": {
"pageId": "campaign.9.before",
"resource": "narration_campaign_9_before",
"text": "The great lens is clouded with salt. Mara holds the lantern while you work. The areas overlap like the rings in the glass; compare them carefully.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_9_before.wav",
"flacFile": "narration_campaign_9_before.flac",
"wavSha256": "971cad8505dc195c83db6380df21590d9c4bc61556acce027af7058b757a64c0",
"sampleRate": 24000,
"channels": 1,
"frames": 261408,
"durationMs": 10892,
"textSha256": "431d704d2c8104e6fbe948daca7432def0eeec3156336f27917a9749f9c8549b",
"flacSha256": "dca8cb3c4441a59e74932b8923c71f3e791cf8c314c8758a21540ddedda5e26c",
"cues": [
{
"startMs": 180,
"endMs": 10292,
"text": "The great lens is clouded with salt. Mara holds the lantern while you work. The areas overlap like the rings in the glass; compare them carefully."
}
]
},
"campaign.9.after": {
"pageId": "campaign.9.after",
"resource": "narration_campaign_9_after",
"text": "You wipe the last salt from the lens. The lantern’s tiny flame stretches into a bright arc across the walls. Everything is ready.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_9_after.wav",
"flacFile": "narration_campaign_9_after.flac",
"wavSha256": "4480becccac21933a6bcda2ae3f2b3a62eef67be1f59f25f3cc671e5c3d94e28",
"sampleRate": 24000,
"channels": 1,
"frames": 232224,
"durationMs": 9676,
"textSha256": "aa73c3ace90d17beb2a1ed211212dfa090580b9a3a3f193fd915d80d0a3f90eb",
"flacSha256": "efc8e3e8efc8a247915a1863ecbf4979f72f8c69964d4f7bcb3e3360e89d0cd4",
"cues": [
{
"startMs": 180,
"endMs": 9076,
"text": "You wipe the last salt from the lens. The lantern’s tiny flame stretches into a bright arc across the walls. Everything is ready."
}
]
},
"campaign.10.before": {
"pageId": "campaign.10.before",
"resource": "narration_campaign_10_before",
"text": "Mara gives you the handle. Below the windows, the island lies dark. This is the pattern all the other pages were leading towards.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_10_before.wav",
"flacFile": "narration_campaign_10_before.flac",
"wavSha256": "65e5937cbe744f54638521126efb90b0fbc8367a414706260289c11a2e1e5b8c",
"sampleRate": 24000,
"channels": 1,
"frames": 237344,
"durationMs": 9889,
"textSha256": "739aa7897897bd49aa50d2ebade7695842223c55556200ac74faa18a569ff325",
"flacSha256": "51971ccc9deb0c3d0c9d04ac825a22bf0be0af661b85465b6ae1edca92d7267c",
"cues": [
{
"startMs": 180,
"endMs": 9289,
"text": "Mara gives you the handle. Below the windows, the island lies dark. This is the pattern all the other pages were leading towards."
}
]
},
"campaign.10.after": {
"pageId": "campaign.10.after",
"resource": "narration_campaign_10_after",
"text": "The beacon turns. Its light sweeps the harbour, the bridge, the little boat. Far offshore, a ship sounds its horn. The island has its light again.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_10_after.wav",
"flacFile": "narration_campaign_10_after.flac",
"wavSha256": "18f7d76a00368834f17be7574efc599dc169d5a0524747459c66ea3c0af559a3",
"sampleRate": 24000,
"channels": 1,
"frames": 256800,
"durationMs": 10700,
"textSha256": "dc91b4d6ed86eb779dd76b9da3f2126925a922b4abc931b0086caf7de5139570",
"flacSha256": "5d58cb915687f4637c2b0fa6d36a4b51de819c8658be52f89376f3a37eeab377",
"cues": [
{
"startMs": 180,
"endMs": 10100,
"text": "The beacon turns. Its light sweeps the harbour, the bridge, the little boat. Far offshore, a ship sounds its horn. The island has its light again."
}
]
},
"campaign.11.before": {
"pageId": "campaign.11.before",
"resource": "narration_campaign_11_before",
"text": "Dawn finds you walking back with Mara. There is one blank page at the end of the notebook. ‘That one is yours,’ she says.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_11_before.wav",
"flacFile": "narration_campaign_11_before.flac",
"wavSha256": "d3d3bb3ca73cfca83dd8ecd01597dd46bc9ededaad66ad1abc4c058919574e70",
"sampleRate": 24000,
"channels": 1,
"frames": 208160,
"durationMs": 8673,
"textSha256": "54f7f521c2b6ae2d1011b0d608336b69e28fa7d949d2a2fca21461936c39dcc9",
"flacSha256": "8b12af7b26eec93fee27facee760e80db4d2f92501690444fff2ae5dcd39c069",
"cues": [
{
"startMs": 180,
"endMs": 8073,
"text": "Dawn finds you walking back with Mara. There is one blank page at the end of the notebook. ‘That one is yours,’ she says."
}
]
},
"campaign.11.after": {
"pageId": "campaign.11.after",
"resource": "narration_campaign_11_after",
"text": "You light the cottage window. Mara puts the kettle on. Beneath your new drawing, you write: ‘No one comes home to an unlit shore.’ The notebook closes. Your watch has begun.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_11_after.wav",
"flacFile": "narration_campaign_11_after.flac",
"wavSha256": "5e632c3b02667996f557c84403a0a784ffed988395ddeff75c50869b16db5b61",
"sampleRate": 24000,
"channels": 1,
"frames": 303392,
"durationMs": 12641,
"textSha256": "0407091c76fcbe254d034f11b7a630f2cb38c8fa65a7e6611db48a5aab0a5dfd",
"flacSha256": "423452dd38c406206733dd47211d86f06e4eefb735be78cc3601bfb0a7a25561",
"cues": [
{
"startMs": 180,
"endMs": 12041,
"text": "You light the cottage window. Mara puts the kettle on. Beneath your new drawing, you write: ‘No one comes home to an unlit shore.’ The notebook closes. Your watch has begun."
}
]
} }
} }
} }
+10 -4
View File
@@ -1,15 +1,15 @@
# Bundled diary readings # Bundled diary readings and guiding narration
Five fixed readings accompany the opening notebook leaves. They are **synthetic narration rendered during development**, using Kokoro v1.0 / `bf_emma` (British female), not human voice-actor recordings. The app only plays files using just_audio’s platform decoder. It contains no speech model, Android reader integration, runtime synthesis, or audio download. Twenty-eight fixed recordings accompany the story. Mara’s five original diary readings use `bf_emma` (British female); twenty-three guiding passages use a distinct `bm_george` narrator (British male). These are **synthetic recordings rendered during development**, not human voice-actor recordings. The app plays bundled files through just_audio, with no speech model, Android reader, runtime synthesis or download. Mara’s original WAV masters remain unchanged.
- `scripts.json`: canonical non-puzzle text loaded directly by the Flutter story pages. - `scripts.json`: canonical scripts with stable IDs, speaker, voice and rendering speed. Narrator passages match notebook entry/memory/closing text or the later campaign before/after passages.
- `wav/`: reviewable 24 kHz mono PCM16 WAV masters. - `wav/`: reviewable 24 kHz mono PCM16 WAV masters.
- `manifest.json`: model/voice checksums, generator versions, exact scripts, passage timings and WAV and FLAC checksums. - `manifest.json`: model/voice checksums, generator versions, exact scripts, passage timings and WAV and FLAC checksums.
- `assets/audio/narration_*.wav`: bundled PCM16 copies, byte-identical to the WAV masters. - `assets/audio/narration_*.wav`: bundled PCM16 copies, byte-identical to the WAV masters.
- `assets/audio/narration_*.flac`: archival lossless exports, excluded from the APK. - `assets/audio/narration_*.flac`: archival lossless exports, excluded from the APK.
- `licenses/`: Kokoro ONNX wrapper MIT and model Apache 2.0 licenses. - `licenses/`: Kokoro ONNX wrapper MIT and model Apache 2.0 licenses.
The voice uses generation speed 0.82, short fades, paragraph pauses and peak normalization. The in-app speed control changes playback speed without changing pitch. Pausing preserves the actual recording position; leaving a page releases playback. Readings never autoplay on entry. Mara uses generation speed 0.82 and the narrator 0.88, with short fades, paragraph pauses and peak normalization. The in-app speed control changes playback speed without changing pitch. Pausing preserves the actual recording position; leaving a page releases playback. Readings never autoplay on entry.
## Regeneration ## Regeneration
@@ -20,6 +20,9 @@ Use Python 3.12, dependencies pinned in `requirements.txt` and ffmpeg. Keep mode
```sh ```sh
python scripts/render_narration.py --model /path/to/kokoro-v1.0.onnx --voices /path/to/voices-v1.0.bin python scripts/render_narration.py --model /path/to/kokoro-v1.0.onnx --voices /path/to/voices-v1.0.bin
python3 scripts/check_narration_assets.py python3 scripts/check_narration_assets.py
# Regenerate only guiding narration, preserving Mara’s existing takes:
python scripts/render_narration.py --model /path/to/kokoro-v1.0.onnx --voices /path/to/voices-v1.0.bin --speaker Narrator
``` ```
The check requires only Python’s standard library and ffmpeg. It verifies script freshness, cue coverage, master format, checksums and runtime WAV/master equality and bit-identical WAV/FLAC decoding. It also rejects Flutter device-reader imports in app code. Listen to new takes before accepting them; automated checks cannot judge performance or pronunciation. The check requires only Python’s standard library and ffmpeg. It verifies script freshness, cue coverage, master format, checksums and runtime WAV/master equality and bit-identical WAV/FLAC decoding. It also rejects Flutter device-reader imports in app code. Listen to new takes before accepting them; automated checks cannot judge performance or pronunciation.
@@ -27,3 +30,6 @@ The check requires only Python’s standard library and ffmpeg. It verifies scri
A future actor recording can replace the masters and bundled assets while preserving stable page IDs. Update passage timings and checksums with that recording; never silently change the written script to fit audio. A future actor recording can replace the masters and bundled assets while preserving stable page IDs. Update passage timings and checksums with that recording; never silently change the written script to fit audio.
Playback uses PCM WAV because the connected Huawei API 26 tablet advanced the FLAC clock without creating an AudioTrack. WAV produces an active, unmuted 24 kHz mono PCM media track through the speaker, and the user confirmed audible speech. The release smoke test now checks that mixer track, in addition to pause/resume and elapsed time. Playback uses PCM WAV because the connected Huawei API 26 tablet advanced the FLAC clock without creating an AudioTrack. WAV produces an active, unmuted 24 kHz mono PCM media track through the speaker, and the user confirmed audible speech. The release smoke test now checks that mixer track, in addition to pause/resume and elapsed time.
The seven cottage narrator recordings cover the lantern/key/compass entries and memories and the closing threshold leaf. Sixteen more cover the before/after passages for campaign levels 4–11. Puzzle instruction leaves remain unvoiced. On-screen labels distinguish “Mara · diary reading” from “Narrator · recorded story”; playback is opt-in and stops on navigation or backgrounding. Cue highlighting follows the exact displayed passage.
+572
View File
@@ -3,6 +3,16 @@
"speed": 0.82, "speed": 0.82,
"language": "en-gb", "language": "en-gb",
"method": "Synthetic narration rendered during development; bundled file playback only.", "method": "Synthetic narration rendered during development; bundled file playback only.",
"speakers": {
"Mara": {
"voice": "bf_emma",
"speed": 0.82
},
"Narrator": {
"voice": "bm_george",
"speed": 0.88
}
},
"modelSha256": "7d5df8ecf7d4b1878015a32686053fd0eebe2bc377234608764cc0ef3636a6c5", "modelSha256": "7d5df8ecf7d4b1878015a32686053fd0eebe2bc377234608764cc0ef3636a6c5",
"voicesSha256": "bca610b8308e8d99f32e6fe4197e7ec01679264efed0cac9140fe9c29f1fbf7d", "voicesSha256": "bca610b8308e8d99f32e6fe4197e7ec01679264efed0cac9140fe9c29f1fbf7d",
"packages": { "packages": {
@@ -161,6 +171,568 @@
], ],
"flacFile": "narration_cottage_lantern_sketch.flac", "flacFile": "narration_cottage_lantern_sketch.flac",
"wavSha256": "53dd694b9933f94bcda72582d0c6b1bb5b656898a73c87d66ecfa0874ba3a29d" "wavSha256": "53dd694b9933f94bcda72582d0c6b1bb5b656898a73c87d66ecfa0874ba3a29d"
},
"cottage.lantern.entry": {
"pageId": "cottage.lantern.entry",
"resource": "narration_cottage_lantern_entry",
"text": "A small flame will not survive the wind. Mara’s next page shows what she carried on her evening rounds.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_lantern_entry.wav",
"flacFile": "narration_cottage_lantern_entry.flac",
"wavSha256": "9ad019bd823e3d31dbfde3f1a29c6d643e11640cafd009ca77d3b3ff5096995a",
"sampleRate": 24000,
"channels": 1,
"frames": 201504,
"durationMs": 8396,
"textSha256": "ca19c2ac4a7aa40f3d4c9c5c85957618972432a71a3e12dce1ccdd59ada65b0c",
"flacSha256": "0b76706fbb868ddcb26a36e6a90f4badc2fd4c7e751ca6639c75a46c4fcb1323",
"cues": [
{
"startMs": 180,
"endMs": 7796,
"text": "A small flame will not survive the wind. Mara’s next page shows what she carried on her evening rounds."
}
]
},
"cottage.lantern.memory": {
"pageId": "cottage.lantern.memory",
"resource": "narration_cottage_lantern_memory",
"text": "The lantern is soot-black but sound. Its warm circle of light reaches the cottage door. Beneath the handle, Mara has scratched your initials.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_lantern_memory.wav",
"flacFile": "narration_cottage_lantern_memory.flac",
"wavSha256": "80485840ab6d00a1c6883ec2eaab36a19cffe2fbb69d026b3a417613787b4aa0",
"sampleRate": 24000,
"channels": 1,
"frames": 254752,
"durationMs": 10615,
"textSha256": "3c6af7f276cb7f24b9d20d0c120c85d1fad02a62328a2fd230826b9f6b2f3ba5",
"flacSha256": "ad285b1ac2717f93b284e727748fa8bbe0a72dd1cea4607eca5d723330e5b305",
"cues": [
{
"startMs": 180,
"endMs": 10015,
"text": "The lantern is soot-black but sound. Its warm circle of light reaches the cottage door. Beneath the handle, Mara has scratched your initials."
}
]
},
"cottage.key.entry": {
"pageId": "cottage.key.entry",
"resource": "narration_cottage_key_entry",
"text": "‘Some clues belong to more than one place,’ Mara wrote. Compare the overlapping areas on this page; a shared cell counts in both. A loose floorboard waits by the door.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_key_entry.wav",
"flacFile": "narration_cottage_key_entry.flac",
"wavSha256": "8124e1c156b41b69b52305c4c1e2fcae5005f6d2829eddbbecc952eebb73cfdb",
"sampleRate": 24000,
"channels": 1,
"frames": 299808,
"durationMs": 12492,
"textSha256": "e9659d973e1c29a9b21479959a3859978ffb1feace593d6f15fd0536a9810269",
"flacSha256": "c54b40e8cdc5cd229a2ed3590a5ca59b103458082dae5a431a46a51c4bce2d94",
"cues": [
{
"startMs": 180,
"endMs": 11892,
"text": "‘Some clues belong to more than one place,’ Mara wrote. Compare the overlapping areas on this page; a shared cell counts in both. A loose floorboard waits by the door."
}
]
},
"cottage.key.memory": {
"pageId": "cottage.key.memory",
"resource": "narration_cottage_key_memory",
"text": "A brass key turns up beneath the board. The tag reads ‘harbour store’. Someone prepared for a journey and never quite made it out of the cottage.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_key_memory.wav",
"flacFile": "narration_cottage_key_memory.flac",
"wavSha256": "1f65e40bffcd282c2a87e087c952fa62f66e6207885e11eef3ca1fb0810c2991",
"sampleRate": 24000,
"channels": 1,
"frames": 249632,
"durationMs": 10401,
"textSha256": "f1587b172b4801b53b45f45d26e761e77dda0c7417308000307efed88b20e576",
"flacSha256": "53449485cb0f384ecfa5c88c427bec74a2fbbb8d71a9e92ad93bddc41a8b6844",
"cues": [
{
"startMs": 180,
"endMs": 9801,
"text": "A brass key turns up beneath the board. The tag reads ‘harbour store’. Someone prepared for a journey and never quite made it out of the cottage."
}
]
},
"cottage.compass.entry": {
"pageId": "cottage.compass.entry",
"resource": "narration_cottage_compass_entry",
"text": "The lane has vanished beneath fallen branches. One last page in the cottage points you towards the harbour. Use what the areas share to work out what lies outside them.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_compass_entry.wav",
"flacFile": "narration_cottage_compass_entry.flac",
"wavSha256": "2671c9657c54803c9b5e571cf5bea42cd5a2bffb0ca848444e99bdbaf5effa55",
"sampleRate": 24000,
"channels": 1,
"frames": 306976,
"durationMs": 12791,
"textSha256": "2fef65403ef1a1cb2ce4f480783ec409beeccb5f4eb595dd22ab9dd6fb0b6c25",
"flacSha256": "51f6641757834d05578dc11dd627c0deafb210e7979ffc01df0e2effcab9c79d",
"cues": [
{
"startMs": 180,
"endMs": 12191,
"text": "The lane has vanished beneath fallen branches. One last page in the cottage points you towards the harbour. Use what the areas share to work out what lies outside them."
}
]
},
"cottage.compass.memory": {
"pageId": "cottage.compass.memory",
"resource": "narration_cottage_compass_memory",
"text": "The compass needle settles towards the sea. Tucked inside its lid is a note: ‘When the path disappears, keep your bearings.’ You step into the rain.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_compass_memory.wav",
"flacFile": "narration_cottage_compass_memory.flac",
"wavSha256": "f48f72546552401da03f5288177f690a4dff35c4811bde7589034534759ca30b",
"sampleRate": 24000,
"channels": 1,
"frames": 273696,
"durationMs": 11404,
"textSha256": "66b381628bd2c774e0372f4afb69783aad92363c142e41305b4b2980d4ad6ba7",
"flacSha256": "798488e7b13b1d858b90c8507cbfedbad558ed33a172128438978b3594a1cb42",
"cues": [
{
"startMs": 180,
"endMs": 10804,
"text": "The compass needle settles towards the sea. Tucked inside its lid is a note: ‘When the path disappears, keep your bearings.’ You step into the rain."
}
]
},
"cottage.threshold": {
"pageId": "cottage.threshold",
"resource": "narration_cottage_threshold",
"text": "The lantern waits by the door. You fold Gran’s note along its old crease and tuck it beside the harbour key.\n\nOutside, the lane smells of rain. You remember her advice about the latch: lift it a little, then turn.\n\nBeyond the cottage, the path leads down to the water. There is still a light to bring home.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_cottage_threshold.wav",
"flacFile": "narration_cottage_threshold.flac",
"wavSha256": "11c280d613222ccc2eecd68aac6f594950d3007f6d9269d208d4fef9aad29660",
"sampleRate": 24000,
"channels": 1,
"frames": 549280,
"durationMs": 22887,
"textSha256": "6eaa8e719d1a747a6201279182a2ce4c8c56fcd8f60132525ed23a242c617e82",
"flacSha256": "eadafc890ee55f2855d80ff5f2b4fa7011d68bb4dbf521820902aeebfe7870c1",
"cues": [
{
"startMs": 180,
"endMs": 7561,
"text": "The lantern waits by the door. You fold Gran’s note along its old crease and tuck it beside the harbour key."
},
{
"startMs": 8161,
"endMs": 15841,
"text": "Outside, the lane smells of rain. You remember her advice about the latch: lift it a little, then turn."
},
{
"startMs": 16441,
"endMs": 22287,
"text": "Beyond the cottage, the path leads down to the water. There is still a light to bring home."
}
]
},
"campaign.4.before": {
"pageId": "campaign.4.before",
"resource": "narration_campaign_4_before",
"text": "The tide has covered the causeway. A shape knocks gently against the harbour steps. Mara’s notebook has a page for this crossing too.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_4_before.wav",
"flacFile": "narration_campaign_4_before.flac",
"wavSha256": "da3226933f6c6ee0c0fe15369b321dc032a5f436baef58b8a449f29561e59a75",
"sampleRate": 24000,
"channels": 1,
"frames": 237856,
"durationMs": 9911,
"textSha256": "239a9687e7edc99f13cd9f0dc0784aa9023f0e542feefb7fe76122c983b851af",
"flacSha256": "0fb36a1f2e3dc856bf98c8699dcf2d4d1e67679237e3f093de21b1fd1fa042e0",
"cues": [
{
"startMs": 180,
"endMs": 9311,
"text": "The tide has covered the causeway. A shape knocks gently against the harbour steps. Mara’s notebook has a page for this crossing too."
}
]
},
"campaign.4.after": {
"pageId": "campaign.4.after",
"resource": "narration_campaign_4_after",
"text": "The little boat is still tied fast. You bail out the rainwater, set the lantern in the bow, and push away from the steps.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_4_after.wav",
"flacFile": "narration_campaign_4_after.flac",
"wavSha256": "4c9a053729fbee2e7324642e22e82f021ff59f04a035dec4d0f7bf4c3e2f4ec3",
"sampleRate": 24000,
"channels": 1,
"frames": 221984,
"durationMs": 9249,
"textSha256": "8b041c5d167c54c2189be16043ed299551046d83067df75652847ccd05ea8675",
"flacSha256": "05c07db2e53969f82d6e9387db92ec53d401ed9378971a41708074e431cc0f6a",
"cues": [
{
"startMs": 180,
"endMs": 8649,
"text": "The little boat is still tied fast. You bail out the rainwater, set the lantern in the bow, and push away from the steps."
}
]
},
"campaign.5.before": {
"pageId": "campaign.5.before",
"resource": "narration_campaign_5_before",
"text": "The current tugs you towards the outer rocks. Something heavy is tangled beneath the seat. The pattern tells you what to reach for.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_5_before.wav",
"flacFile": "narration_campaign_5_before.flac",
"wavSha256": "cd99d067df878bf9792b24c15a37ae350855f1b5650f177fcfd0e88dfa279f1a",
"sampleRate": 24000,
"channels": 1,
"frames": 219936,
"durationMs": 9164,
"textSha256": "32eb4035740297dd56922779e5cfa830dff9a94d3044fd7b668e97b7c1178fef",
"flacSha256": "c6955d7f797e35bd2beeb938458c6cf9963780cbaa1c88852b0a51bdbb8723ba",
"cues": [
{
"startMs": 180,
"endMs": 8564,
"text": "The current tugs you towards the outer rocks. Something heavy is tangled beneath the seat. The pattern tells you what to reach for."
}
]
},
"campaign.5.after": {
"pageId": "campaign.5.after",
"resource": "narration_campaign_5_after",
"text": "The anchor catches. The boat swings into calmer water. In the pause, you hear a bell somewhere beyond the fog.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_5_after.wav",
"flacFile": "narration_campaign_5_after.flac",
"wavSha256": "e3997b534cf3b953a6a04fd32a02ac0f5ff907f444ec2602e263b240a92c2fef",
"sampleRate": 24000,
"channels": 1,
"frames": 200480,
"durationMs": 8353,
"textSha256": "63e03e04b4d267e38d042787aa813b246b248e366e9ad32a3a289539161eea02",
"flacSha256": "f2c000ab339c66019fc9c66fa60d9907ee6081099e733e9aa50a82368d4e5408",
"cues": [
{
"startMs": 180,
"endMs": 7753,
"text": "The anchor catches. The boat swings into calmer water. In the pause, you hear a bell somewhere beyond the fog."
}
]
},
"campaign.6.before": {
"pageId": "campaign.6.before",
"resource": "narration_campaign_6_before",
"text": "You land beneath the lighthouse hill. The old crossing is hidden by reeds. Mara marked its outline long before the storm.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_6_before.wav",
"flacFile": "narration_campaign_6_before.flac",
"wavSha256": "aa608ff2544d0ca9417f1676bb45e4f0398632a9587242e6b77a1ad47b1c7373",
"sampleRate": 24000,
"channels": 1,
"frames": 217888,
"durationMs": 9079,
"textSha256": "cafa0efdd8fd07e9fc4b2f35f0f3ba1b1324193cea4d6b524e60382b4663b2e6",
"flacSha256": "f3cb885505deaeb7cd80926fffd27fcfccb7715a10d6a869c0331003ca68bec9",
"cues": [
{
"startMs": 180,
"endMs": 8479,
"text": "You land beneath the lighthouse hill. The old crossing is hidden by reeds. Mara marked its outline long before the storm."
}
]
},
"campaign.6.after": {
"pageId": "campaign.6.after",
"resource": "narration_campaign_6_after",
"text": "The bridge is intact. You cross with the lantern held high. On the far bank, a fresh bootprint tells you someone else has passed this way.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_6_after.wav",
"flacFile": "narration_campaign_6_after.flac",
"wavSha256": "0898962455959f57ba4dc533561dd56255d1d2ced7161470881e31d8abfcaf43",
"sampleRate": 24000,
"channels": 1,
"frames": 245536,
"durationMs": 10231,
"textSha256": "51d543acaa3ed8d0da5fa294a7b210f2375030a0fda6ce3a97c83dfaa0408bda",
"flacSha256": "bbaa067856e323723fea0a74e7f6cda47b701d8f0a61c9bdbb124bfa7757ba57",
"cues": [
{
"startMs": 180,
"endMs": 9631,
"text": "The bridge is intact. You cross with the lantern held high. On the far bank, a fresh bootprint tells you someone else has passed this way."
}
]
},
"campaign.7.before": {
"pageId": "campaign.7.before",
"resource": "narration_campaign_7_before",
"text": "A rope hangs from a timber frame. The bell above it has fallen silent. Restore the pattern before you call out across the water.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_7_before.wav",
"flacFile": "narration_campaign_7_before.flac",
"wavSha256": "cca7a758b8f93793fec73cd7173f175fd58b0ecd86802b5a27ad0f8c2e9d9cdc",
"sampleRate": 24000,
"channels": 1,
"frames": 226080,
"durationMs": 9420,
"textSha256": "fbe874dbb47488fe436439e3c6e57cf86d049389f01218dbe45b094b020f633a",
"flacSha256": "1d0fd3c2c788c517aa6ef3fd784ead9067da5399a7ac1a6c32d32e8876a23d89",
"cues": [
{
"startMs": 180,
"endMs": 8820,
"text": "A rope hangs from a timber frame. The bell above it has fallen silent. Restore the pattern before you call out across the water."
}
]
},
"campaign.7.after": {
"pageId": "campaign.7.after",
"resource": "narration_campaign_7_after",
"text": "One clear note travels into the fog. Two notes answer from the hill. Someone is waiting at the lighthouse.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_7_after.wav",
"flacFile": "narration_campaign_7_after.flac",
"wavSha256": "bc1c6162ea5b88055eddbf91952d6d5f49af3be103703433e26eb532c6d507cc",
"sampleRate": 24000,
"channels": 1,
"frames": 192800,
"durationMs": 8033,
"textSha256": "1a14efc63b63744efdf0c8b3eeb3f7fdba29412e91740eaff5ecc9d68894d87e",
"flacSha256": "cd4caa09c07336ea1816190ab737129da4227659ad7eb95779b64d50811534ba",
"cues": [
{
"startMs": 180,
"endMs": 7433,
"text": "One clear note travels into the fog. Two notes answer from the hill. Someone is waiting at the lighthouse."
}
]
},
"campaign.8.before": {
"pageId": "campaign.8.before",
"resource": "narration_campaign_8_before",
"text": "Mara opens the lighthouse door. ‘I knew you’d find the notebook,’ she says. The storm stopped the turning mechanism. Together, you lay out its scattered parts.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_8_before.wav",
"flacFile": "narration_campaign_8_before.flac",
"wavSha256": "4282678379a27aade271230eda6219c97937a0a58e3cef69916dae355591cb02",
"sampleRate": 24000,
"channels": 1,
"frames": 270624,
"durationMs": 11276,
"textSha256": "4a5d2997866ad6d570db169562c4d636fa4a4a5dbbc46938bb62c800718df24f",
"flacSha256": "d928d24044567f7eccb2e1d63ace14f5dcaf5bcc83e7b0969379b019e98ffa04",
"cues": [
{
"startMs": 180,
"endMs": 10676,
"text": "Mara opens the lighthouse door. ‘I knew you’d find the notebook,’ she says. The storm stopped the turning mechanism. Together, you lay out its scattered parts."
}
]
},
"campaign.8.after": {
"pageId": "campaign.8.after",
"resource": "narration_campaign_8_after",
"text": "The missing gear slips into place. You turn the handle; the mechanism answers with a familiar, steady ticking. Mara smiles without looking up.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_8_after.wav",
"flacFile": "narration_campaign_8_after.flac",
"wavSha256": "476f45fe49f4dcb86c8c02999e357392a75d9732622ae4bfa28268a792fc37e1",
"sampleRate": 24000,
"channels": 1,
"frames": 257824,
"durationMs": 10743,
"textSha256": "0661c45756104d69eab2c6f02eb7c6fac8cac4c59fb46673b94b32e6431b3b57",
"flacSha256": "00d60f40e56567da445cf22db5b4769fdab15d42767293200680f7f3e740172d",
"cues": [
{
"startMs": 180,
"endMs": 10143,
"text": "The missing gear slips into place. You turn the handle; the mechanism answers with a familiar, steady ticking. Mara smiles without looking up."
}
]
},
"campaign.9.before": {
"pageId": "campaign.9.before",
"resource": "narration_campaign_9_before",
"text": "The great lens is clouded with salt. Mara holds the lantern while you work. The areas overlap like the rings in the glass; compare them carefully.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_9_before.wav",
"flacFile": "narration_campaign_9_before.flac",
"wavSha256": "971cad8505dc195c83db6380df21590d9c4bc61556acce027af7058b757a64c0",
"sampleRate": 24000,
"channels": 1,
"frames": 261408,
"durationMs": 10892,
"textSha256": "431d704d2c8104e6fbe948daca7432def0eeec3156336f27917a9749f9c8549b",
"flacSha256": "dca8cb3c4441a59e74932b8923c71f3e791cf8c314c8758a21540ddedda5e26c",
"cues": [
{
"startMs": 180,
"endMs": 10292,
"text": "The great lens is clouded with salt. Mara holds the lantern while you work. The areas overlap like the rings in the glass; compare them carefully."
}
]
},
"campaign.9.after": {
"pageId": "campaign.9.after",
"resource": "narration_campaign_9_after",
"text": "You wipe the last salt from the lens. The lantern’s tiny flame stretches into a bright arc across the walls. Everything is ready.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_9_after.wav",
"flacFile": "narration_campaign_9_after.flac",
"wavSha256": "4480becccac21933a6bcda2ae3f2b3a62eef67be1f59f25f3cc671e5c3d94e28",
"sampleRate": 24000,
"channels": 1,
"frames": 232224,
"durationMs": 9676,
"textSha256": "aa73c3ace90d17beb2a1ed211212dfa090580b9a3a3f193fd915d80d0a3f90eb",
"flacSha256": "efc8e3e8efc8a247915a1863ecbf4979f72f8c69964d4f7bcb3e3360e89d0cd4",
"cues": [
{
"startMs": 180,
"endMs": 9076,
"text": "You wipe the last salt from the lens. The lantern’s tiny flame stretches into a bright arc across the walls. Everything is ready."
}
]
},
"campaign.10.before": {
"pageId": "campaign.10.before",
"resource": "narration_campaign_10_before",
"text": "Mara gives you the handle. Below the windows, the island lies dark. This is the pattern all the other pages were leading towards.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_10_before.wav",
"flacFile": "narration_campaign_10_before.flac",
"wavSha256": "65e5937cbe744f54638521126efb90b0fbc8367a414706260289c11a2e1e5b8c",
"sampleRate": 24000,
"channels": 1,
"frames": 237344,
"durationMs": 9889,
"textSha256": "739aa7897897bd49aa50d2ebade7695842223c55556200ac74faa18a569ff325",
"flacSha256": "51971ccc9deb0c3d0c9d04ac825a22bf0be0af661b85465b6ae1edca92d7267c",
"cues": [
{
"startMs": 180,
"endMs": 9289,
"text": "Mara gives you the handle. Below the windows, the island lies dark. This is the pattern all the other pages were leading towards."
}
]
},
"campaign.10.after": {
"pageId": "campaign.10.after",
"resource": "narration_campaign_10_after",
"text": "The beacon turns. Its light sweeps the harbour, the bridge, the little boat. Far offshore, a ship sounds its horn. The island has its light again.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_10_after.wav",
"flacFile": "narration_campaign_10_after.flac",
"wavSha256": "18f7d76a00368834f17be7574efc599dc169d5a0524747459c66ea3c0af559a3",
"sampleRate": 24000,
"channels": 1,
"frames": 256800,
"durationMs": 10700,
"textSha256": "dc91b4d6ed86eb779dd76b9da3f2126925a922b4abc931b0086caf7de5139570",
"flacSha256": "5d58cb915687f4637c2b0fa6d36a4b51de819c8658be52f89376f3a37eeab377",
"cues": [
{
"startMs": 180,
"endMs": 10100,
"text": "The beacon turns. Its light sweeps the harbour, the bridge, the little boat. Far offshore, a ship sounds its horn. The island has its light again."
}
]
},
"campaign.11.before": {
"pageId": "campaign.11.before",
"resource": "narration_campaign_11_before",
"text": "Dawn finds you walking back with Mara. There is one blank page at the end of the notebook. ‘That one is yours,’ she says.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_11_before.wav",
"flacFile": "narration_campaign_11_before.flac",
"wavSha256": "d3d3bb3ca73cfca83dd8ecd01597dd46bc9ededaad66ad1abc4c058919574e70",
"sampleRate": 24000,
"channels": 1,
"frames": 208160,
"durationMs": 8673,
"textSha256": "54f7f521c2b6ae2d1011b0d608336b69e28fa7d949d2a2fca21461936c39dcc9",
"flacSha256": "8b12af7b26eec93fee27facee760e80db4d2f92501690444fff2ae5dcd39c069",
"cues": [
{
"startMs": 180,
"endMs": 8073,
"text": "Dawn finds you walking back with Mara. There is one blank page at the end of the notebook. ‘That one is yours,’ she says."
}
]
},
"campaign.11.after": {
"pageId": "campaign.11.after",
"resource": "narration_campaign_11_after",
"text": "You light the cottage window. Mara puts the kettle on. Beneath your new drawing, you write: ‘No one comes home to an unlit shore.’ The notebook closes. Your watch has begun.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88,
"file": "narration_campaign_11_after.wav",
"flacFile": "narration_campaign_11_after.flac",
"wavSha256": "5e632c3b02667996f557c84403a0a784ffed988395ddeff75c50869b16db5b61",
"sampleRate": 24000,
"channels": 1,
"frames": 303392,
"durationMs": 12641,
"textSha256": "0407091c76fcbe254d034f11b7a630f2cb38c8fa65a7e6611db48a5aab0a5dfd",
"flacSha256": "423452dd38c406206733dd47211d86f06e4eefb735be78cc3601bfb0a7a25561",
"cues": [
{
"startMs": 180,
"endMs": 12041,
"text": "You light the cottage window. Mara puts the kettle on. Beneath your new drawing, you write: ‘No one comes home to an unlit shore.’ The notebook closes. Your watch has begun."
}
]
} }
} }
} }
+226 -1
View File
@@ -1 +1,226 @@
[{"pageId":"cottage.dedication","resource":"narration_cottage_dedication","text":"My dear,\n\nI never could keep a proper diary. I wrote down the tides, the things that needed mending, and whatever I was afraid I might forget.\n\nYou will find a little of all three in here. Take your time. There is no right way to turn these pages.\n\nWith all my love,\nGran"},{"pageId":"cottage.window","resource":"narration_cottage_window","text":"The wind has finally gone quiet. I have put the blue cup by the window, where you always liked to sit.\n\nThe latch still sticks. Lift it a little before you turn it. Some things on this island need a gentle hand, not a stronger one.\n\nIf you arrive after dark, there is something in the little drawer beside the hearth."},{"pageId":"cottage.match.memory","resource":"narration_cottage_match_memory","text":"You used to insist on lighting the evening lantern yourself. I held the matchbox, and you held your breath.\n\nOnce, you asked how such a little flame could help anyone out at sea.\n\nIt cannot, I told you. But it can help us find the next light.\n\nI kept one dry match in a tin after that. Just in case."},{"pageId":"cottage.folded.note","resource":"narration_cottage_folded_note","text":"If the tide has covered the causeway, use the little boat by the harbour steps. The knot looks worse than it is.\n\nTake the lantern. When you reach the bell, ring twice. I will know it is you.\n\nAnd do not let the tea go cold while you are deciding.\n\nLove, Gran"},{"pageId":"cottage.lantern.sketch","resource":"narration_cottage_lantern_sketch","text":"Your grandfather repaired this handle with a piece of wire and far too much confidence. I wrapped the join so it would not catch your fingers.\n\nPeople notice the flame first. I tend to notice the things that let us carry it."}] [
{
"pageId": "cottage.dedication",
"resource": "narration_cottage_dedication",
"text": "My dear,\n\nI never could keep a proper diary. I wrote down the tides, the things that needed mending, and whatever I was afraid I might forget.\n\nYou will find a little of all three in here. Take your time. There is no right way to turn these pages.\n\nWith all my love,\nGran",
"speaker": "Mara",
"voice": "bf_emma",
"speed": 0.82
},
{
"pageId": "cottage.window",
"resource": "narration_cottage_window",
"text": "The wind has finally gone quiet. I have put the blue cup by the window, where you always liked to sit.\n\nThe latch still sticks. Lift it a little before you turn it. Some things on this island need a gentle hand, not a stronger one.\n\nIf you arrive after dark, there is something in the little drawer beside the hearth.",
"speaker": "Mara",
"voice": "bf_emma",
"speed": 0.82
},
{
"pageId": "cottage.match.memory",
"resource": "narration_cottage_match_memory",
"text": "You used to insist on lighting the evening lantern yourself. I held the matchbox, and you held your breath.\n\nOnce, you asked how such a little flame could help anyone out at sea.\n\nIt cannot, I told you. But it can help us find the next light.\n\nI kept one dry match in a tin after that. Just in case.",
"speaker": "Mara",
"voice": "bf_emma",
"speed": 0.82
},
{
"pageId": "cottage.folded.note",
"resource": "narration_cottage_folded_note",
"text": "If the tide has covered the causeway, use the little boat by the harbour steps. The knot looks worse than it is.\n\nTake the lantern. When you reach the bell, ring twice. I will know it is you.\n\nAnd do not let the tea go cold while you are deciding.\n\nLove, Gran",
"speaker": "Mara",
"voice": "bf_emma",
"speed": 0.82
},
{
"pageId": "cottage.lantern.sketch",
"resource": "narration_cottage_lantern_sketch",
"text": "Your grandfather repaired this handle with a piece of wire and far too much confidence. I wrapped the join so it would not catch your fingers.\n\nPeople notice the flame first. I tend to notice the things that let us carry it.",
"speaker": "Mara",
"voice": "bf_emma",
"speed": 0.82
},
{
"pageId": "cottage.lantern.entry",
"resource": "narration_cottage_lantern_entry",
"text": "A small flame will not survive the wind. Mara’s next page shows what she carried on her evening rounds.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "cottage.lantern.memory",
"resource": "narration_cottage_lantern_memory",
"text": "The lantern is soot-black but sound. Its warm circle of light reaches the cottage door. Beneath the handle, Mara has scratched your initials.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "cottage.key.entry",
"resource": "narration_cottage_key_entry",
"text": "‘Some clues belong to more than one place,’ Mara wrote. Compare the overlapping areas on this page; a shared cell counts in both. A loose floorboard waits by the door.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "cottage.key.memory",
"resource": "narration_cottage_key_memory",
"text": "A brass key turns up beneath the board. The tag reads ‘harbour store’. Someone prepared for a journey and never quite made it out of the cottage.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "cottage.compass.entry",
"resource": "narration_cottage_compass_entry",
"text": "The lane has vanished beneath fallen branches. One last page in the cottage points you towards the harbour. Use what the areas share to work out what lies outside them.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "cottage.compass.memory",
"resource": "narration_cottage_compass_memory",
"text": "The compass needle settles towards the sea. Tucked inside its lid is a note: ‘When the path disappears, keep your bearings.’ You step into the rain.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "cottage.threshold",
"resource": "narration_cottage_threshold",
"text": "The lantern waits by the door. You fold Gran’s note along its old crease and tuck it beside the harbour key.\n\nOutside, the lane smells of rain. You remember her advice about the latch: lift it a little, then turn.\n\nBeyond the cottage, the path leads down to the water. There is still a light to bring home.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.4.before",
"resource": "narration_campaign_4_before",
"text": "The tide has covered the causeway. A shape knocks gently against the harbour steps. Mara’s notebook has a page for this crossing too.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.4.after",
"resource": "narration_campaign_4_after",
"text": "The little boat is still tied fast. You bail out the rainwater, set the lantern in the bow, and push away from the steps.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.5.before",
"resource": "narration_campaign_5_before",
"text": "The current tugs you towards the outer rocks. Something heavy is tangled beneath the seat. The pattern tells you what to reach for.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.5.after",
"resource": "narration_campaign_5_after",
"text": "The anchor catches. The boat swings into calmer water. In the pause, you hear a bell somewhere beyond the fog.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.6.before",
"resource": "narration_campaign_6_before",
"text": "You land beneath the lighthouse hill. The old crossing is hidden by reeds. Mara marked its outline long before the storm.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.6.after",
"resource": "narration_campaign_6_after",
"text": "The bridge is intact. You cross with the lantern held high. On the far bank, a fresh bootprint tells you someone else has passed this way.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.7.before",
"resource": "narration_campaign_7_before",
"text": "A rope hangs from a timber frame. The bell above it has fallen silent. Restore the pattern before you call out across the water.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.7.after",
"resource": "narration_campaign_7_after",
"text": "One clear note travels into the fog. Two notes answer from the hill. Someone is waiting at the lighthouse.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.8.before",
"resource": "narration_campaign_8_before",
"text": "Mara opens the lighthouse door. ‘I knew you’d find the notebook,’ she says. The storm stopped the turning mechanism. Together, you lay out its scattered parts.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.8.after",
"resource": "narration_campaign_8_after",
"text": "The missing gear slips into place. You turn the handle; the mechanism answers with a familiar, steady ticking. Mara smiles without looking up.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.9.before",
"resource": "narration_campaign_9_before",
"text": "The great lens is clouded with salt. Mara holds the lantern while you work. The areas overlap like the rings in the glass; compare them carefully.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.9.after",
"resource": "narration_campaign_9_after",
"text": "You wipe the last salt from the lens. The lantern’s tiny flame stretches into a bright arc across the walls. Everything is ready.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.10.before",
"resource": "narration_campaign_10_before",
"text": "Mara gives you the handle. Below the windows, the island lies dark. This is the pattern all the other pages were leading towards.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.10.after",
"resource": "narration_campaign_10_after",
"text": "The beacon turns. Its light sweeps the harbour, the bridge, the little boat. Far offshore, a ship sounds its horn. The island has its light again.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.11.before",
"resource": "narration_campaign_11_before",
"text": "Dawn finds you walking back with Mara. There is one blank page at the end of the notebook. ‘That one is yours,’ she says.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
},
{
"pageId": "campaign.11.after",
"resource": "narration_campaign_11_after",
"text": "You light the cottage window. Mara puts the kettle on. Beneath your new drawing, you write: ‘No one comes home to an unlit shore.’ The notebook closes. Your watch has begun.",
"speaker": "Narrator",
"voice": "bm_george",
"speed": 0.88
}
]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+124
View File
@@ -0,0 +1,124 @@
{
"chapterId": "cottage",
"pages": [
{
"id": "cottage.dedication",
"title": "For you, when you are ready",
"type": "dedication",
"speaker": "Mara",
"textSource": "recording"
},
{
"id": "cottage.window",
"title": "By the cottage window",
"type": "entry",
"speaker": "Mara",
"campaignIndex": 0,
"textSource": "recording",
"illustrationAsset": "assets/artwork/cottage-vignette-v1.png"
},
{
"id": "cottage.match.puzzle",
"title": "A spark in the drawer",
"type": "puzzle",
"campaignIndex": 0
},
{
"id": "cottage.match.memory",
"title": "One small light",
"type": "memory",
"speaker": "Mara",
"campaignIndex": 0,
"textSource": "recording"
},
{
"id": "cottage.folded.note",
"title": "A note I nearly forgot",
"type": "note",
"speaker": "Mara",
"textSource": "recording"
},
{
"id": "cottage.lantern.sketch",
"title": "The handle, carefully mended",
"type": "inspection",
"speaker": "Mara",
"campaignIndex": 1,
"textSource": "recording"
},
{
"id": "cottage.lantern.entry",
"title": "Something to carry the flame",
"type": "entry",
"speaker": "Narrator",
"campaignIndex": 1,
"textSource": "before"
},
{
"id": "cottage.lantern.puzzle",
"title": "Something to carry the flame",
"type": "puzzle",
"campaignIndex": 1
},
{
"id": "cottage.lantern.memory",
"title": "A light at the door",
"type": "memory",
"speaker": "Narrator",
"campaignIndex": 1,
"textSource": "after"
},
{
"id": "cottage.key.entry",
"title": "Under the loose floorboard",
"type": "entry",
"speaker": "Narrator",
"campaignIndex": 2,
"textSource": "before"
},
{
"id": "cottage.key.puzzle",
"title": "Under the loose floorboard",
"type": "puzzle",
"campaignIndex": 2
},
{
"id": "cottage.key.memory",
"title": "A journey kept ready",
"type": "memory",
"speaker": "Narrator",
"campaignIndex": 2,
"textSource": "after"
},
{
"id": "cottage.compass.entry",
"title": "A direction in the dark",
"type": "entry",
"speaker": "Narrator",
"campaignIndex": 3,
"textSource": "before"
},
{
"id": "cottage.compass.puzzle",
"title": "A direction in the dark",
"type": "puzzle",
"campaignIndex": 3
},
{
"id": "cottage.compass.memory",
"title": "Keep your bearings",
"type": "memory",
"speaker": "Narrator",
"campaignIndex": 3,
"textSource": "after"
},
{
"id": "cottage.threshold",
"title": "Before you leave",
"type": "closing",
"speaker": "Narrator",
"campaignIndex": 3,
"text": "The lantern waits by the door. You fold Gran’s note along its old crease and tuck it beside the harbour key.\n\nOutside, the lane smells of rain. You remember her advice about the latch: lift it a little, then turn.\n\nBeyond the cottage, the path leads down to the water. There is still a light to bring home."
}
]
}
+33 -21
View File
@@ -31,7 +31,7 @@ lib/
├── main.dart LumenApp, Notebook, all screen builders, dialogs, routing ├── main.dart LumenApp, Notebook, all screen builders, dialogs, routing
├── domain/ ├── domain/
│ ├── puzzle.dart Puzzle, JavaRandom, LogicSolver, Difficulty, Region, Hint │ ├── puzzle.dart Puzzle, JavaRandom, LogicSolver, Difficulty, Region, Hint
│ ├── book.dart Book, CampaignLevel, StoryPage — loads authored content │ ├── book.dart Book, CampaignLevel, StoryPage/StoryPageType — loads authored content
│ └── game.dart Game (ChangeNotifier), Screen/Mode, puzzle session, awards │ └── game.dart Game (ChangeNotifier), Screen/Mode, puzzle session, awards
├── services/ ├── services/
│ ├── progress.dart Progress — typed façade over SharedPreferencesAsync │ ├── progress.dart Progress — typed façade over SharedPreferencesAsync
@@ -43,16 +43,17 @@ lib/
assets/ assets/
├── campaign.json premise + 12 authored levels (chapter/title/object/before/after/picture/clues/areas; optional illustrationAsset) ├── campaign.json premise + 12 authored levels (chapter/title/object/before/after/picture/clues/areas; optional illustrationAsset)
├── notebook.json sixteen stable cottage leaf records (type, speaker, campaignIndex, text source)
├── narration/scripts.json canonical diary text, one record per recorded page ├── narration/scripts.json canonical diary text, one record per recorded page
├── narration/manifest.json source masters and checksums for narration ├── narration/manifest.json source masters and checksums for narration
├── audio/narration_manifest.json runtime tracks: file, duration, cue timings ├── audio/narration_manifest.json runtime tracks: file, duration, cue timings
├── audio/*.wav five bundled PCM16 readings (APK runtime assets) ├── audio/*.wav 28 bundled PCM16 recordings (APK runtime assets)
├── audio/*.flac archival lossless exports (not declared in pubspec) ├── audio/*.flac archival lossless exports (not declared in pubspec)
├── artwork/*.png watercolours, vignettes and the notebook page ├── artwork/*.png watercolours, vignettes and the notebook page
└── fonts/DancingScript.ttf bundled as family MaraHand; OFL.txt ships with licences └── 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/puzzle_test.dart 11 domain tests (Java parity, generation, solver, awards, restore)
test/widget_test.dart 6 widget tests (page gestures, scrolling, landscape layout) test/widget_test.dart 9 widget tests (page gestures, scrolling, landscape layout)
test/fixtures/java_boards.json 40 reference boards from the Java 1.7 version 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) integration_test/notebook_test.dart one on-device end-to-end test (QA flavour only)
scripts/ narration verification, install smoke check, narration rendering scripts/ narration verification, install smoke check, narration rendering
@@ -86,6 +87,7 @@ flowchart TD
game --> progress game --> progress
book --> puzzle book --> puzzle
book --> campaign[("assets/campaign.json")] book --> campaign[("assets/campaign.json")]
book --> notebook[("assets/notebook.json")]
book --> scripts[("assets/narration/scripts.json")] book --> scripts[("assets/narration/scripts.json")]
narrator --> manifest[("assets/audio/narration_manifest.json")] narrator --> manifest[("assets/audio/narration_manifest.json")]
narrator --> wav[("assets/audio/*.wav")] narrator --> wav[("assets/audio/*.wav")]
@@ -129,11 +131,11 @@ stateDiagram-v2
[*] --> home [*] --> home
home --> story: openNotebook / showStory home --> story: openNotebook / showStory
home --> game: startDaily or startPractice home --> game: startDaily or startPractice
story --> story: turn within 0..5 story --> story: turn within sixteen cottage leaves
story --> contents: Contents story --> contents: Contents
story --> home: Close book story --> home: Close book
story --> briefing: leaf 6 lantern link story --> briefing: leaf 6 lantern link
contents --> story: opening leaf or bookmark contents --> story: cottage entry, memory or bookmark
contents --> briefing: accessible campaign entry contents --> briefing: accessible campaign entry
contents --> reveal: recovered campaign entry contents --> reveal: recovered campaign entry
contents --> home: Close the notebook contents --> home: Close the notebook
@@ -153,8 +155,8 @@ stateDiagram-v2
| Screen | Builder in `_NotebookState` | Leaf key | Content | `onTurn` | | Screen | Builder in `_NotebookState` | Leaf key | Content | `onTurn` |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| `home` | `home()` | none (own `Scaffold` body) | Harbour art, notebook cover, daily ritual, difficulty, rules, privacy, licences | none | | `home` | `home()` | none (own `Scaffold` body) | Harbour art, notebook cover, daily ritual, difficulty, rules, privacy, licences | none |
| `story` | `story()` | `story-<index>` | Six opening leaves: dedication, cottage, match puzzle, memory, folded note, lantern | `turn()` | | `story` | `story()` | `story-<index>` | Sixteen cottage leaves: dedication, four entry/puzzle/memory beats, note, inspection, closing | `turn()` |
| `contents` | `contents()` | `contents` | Dedication, opening-leaf links, ribbon bookmark, twelve campaign entries with access state, premise | none | | `contents` | `contents()` | `contents-<chapter>` | Four chapter entries, ribbon bookmark, reading resume and optional cottage scraps; chapter navigation | none |
| `briefing` | `briefing()` | `briefing-<i>` | Chapter, title, `before` passage, "Restore the pattern →" | `turnCampaign()` | | `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 | | `game` | `game()` | `game-<key>` | Puzzle heading, area totals, square board, hint/undo, actions | `turnCampaign()` in campaign mode only |
| `reveal` | `reveal()` | `reveal-<i>` | Object name, watercolour (or `PixelPicture` fallback), `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()` |
@@ -165,16 +167,17 @@ stateDiagram-v2
| --- | --- | | --- | --- |
| `home()` | `Screen.home`; cancels pending board generation | | `home()` | `Screen.home`; cancels pending board generation |
| `openNotebook()` | `showStory(index of notebook_last_page, else 0)` | | `openNotebook()` | `showStory(index of notebook_last_page, else 0)` |
| `showStory(i)` | Clamp `i` to 0–5, `mode = campaign`, `campaignIndex = 0`; on `i == 2` load `book.levels[0]` under key `story_v1_0` unless already loaded; persist last page and `viewed_<pageId>`; `Screen.story` | | `showStory(i)` | Clamp `i` to available pages; set campaign mode and the record’s campaign index; on a puzzle leaf load its `story_v1_<index>` unless already loaded; persist last page and `viewed_<pageId>`; `Screen.story` |
| `contents()` | `Screen.contents` | | `contents([chapter])` | One chapter’s four entries; persist `notebook_contents_chapter`; default to current campaign chapter |
| `briefing(i)` | Clamp to `accessible`, `Screen.briefing` | | `leaveCottage()` | Open Chapter II for reading without awarding unfinished cottage puzzles |
| `reveal(i, {readAhead})` | Redirect to `briefing(i)` unless recovered, or read-ahead is allowed for an accessible level; otherwise `Screen.reveal` | | `briefing(i)` | Clamp to `accessible`; cottage entry leaf or later `Screen.briefing` |
| `startCampaign(i)` | No-op if `i > accessible`; recovered levels go to `reveal`; else load `book.levels[i]` under `story_v1_<i>` and open `Screen.game` | | `reveal(i, {readAhead})` | Redirect to `briefing(i)` unless recovered, or read-ahead is allowed for an accessible level; otherwise the cottage memory leaf or later `Screen.reveal` |
| `startCampaign(i)` | No-op if `i > accessible`; recovered levels go to `reveal`; else load `book.levels[i]` under `story_v1_<i>` and open the cottage puzzle leaf or later `Screen.game` |
| `startDaily(day)` | Load `Puzzle.seeded(epochDay(date) * 7919)` under `d<YYYY-MM-DD>`; `Screen.game` | | `startDaily(day)` | Load `Puzzle.seeded(epochDay(date) * 7919)` under `d<YYYY-MM-DD>`; `Screen.game` |
| `startPractice([level])` | Generate 5×5 board off the UI isolate with `compute(generatePractice)`; key `v2_<DIFFICULTY>_<level>`; `Screen.game` | | `startPractice([level])` | Generate 5×5 board off the UI isolate with `compute(generatePractice)`; key `v2_<DIFFICULTY>_<level>`; `Screen.game` |
| `mark(i)` / `undo()` / `area(i)` | Cycle a cell 0→1→2→0, restore the previous snapshot, select an A/B/C area | | `mark(i)` / `undo()` / `area(i)` | Cycle a cell 0→1→2→0, restore the previous snapshot, select an A/B/C area |
| `applyHint()` | Return one explained `Hint` and apply it (prefers detecting a conflicting earlier mark) | | `applyHint()` | Return one explained `Hint` and apply it (prefers detecting a conflicting earlier mark) |
| `check()` | Award completion exactly once; campaign solve advances to story leaf 3 or the reveal; classic levels advance; daily updates the streak | | `check()` | Award completion exactly once; cottage solves advance to the matching memory record; later solves advance to the reveal; classic levels advance; daily updates the streak |
| `restore()` | Re-open the saved screen (`flutter_screen`), including read-ahead reveals and unfinished campaign/classic boards | | `restore()` | Re-open the saved screen (`flutter_screen`), including read-ahead reveals and unfinished campaign/classic boards |
### `main.dart` internal map ### `main.dart` internal map
@@ -265,10 +268,11 @@ All writes go through `Progress.set` (memory is updated synchronously, disk is w
| Key | Type | Written by | Purpose | | Key | Type | Written by | Purpose |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `notebook_last_page` | page id | `Game.showStory` | Resume the last opening leaf | | `notebook_last_page` | page id | `Game.showStory` | Resume the last cottage leaf |
| `notebook_contents_chapter` | int 0–2 | `Game.contents` | Restored chapter contents leaf |
| `notebook_manual_bookmark` | page id | `bookmark()` | "Return to my ribbon bookmark" in Contents | | `notebook_manual_bookmark` | page id | `bookmark()` | "Return to my ribbon bookmark" in Contents |
| `notebook_note_open` | bool | folded-note leaf | Note unfolded/folded state | | `notebook_note_open` | bool | folded-note leaf | Note unfolded/folded state |
| `notebook_handle_seen` | bool | `inspect()` | Lantern handle discovered | | `notebook_handle_seen` | bool | `inspect()` | Repair margin note read; never reveals pre-puzzle artwork |
| `notebook_read_ahead` | bool | `turn()` | Written when leaving the unsolved story puzzle; currently no reader | | `notebook_read_ahead` | bool | `turn()` | Written when leaving the unsolved story puzzle; currently no reader |
| `viewed_<pageId>` | bool | `Game.showStory` | Written per visited leaf; currently no reader | | `viewed_<pageId>` | bool | `Game.showStory` | Written per visited leaf; currently no reader |
@@ -286,7 +290,7 @@ All writes go through `Progress.set` (memory is updated synchronously, disk is w
| `lastDaily` | int (epoch day) | daily completion | Streak bookkeeping | | `lastDaily` | int (epoch day) | daily completion | Streak bookkeeping |
| `streak` | int | daily completion | Consecutive daily completions | | `streak` | int | daily completion | Consecutive daily completions |
| `campaignUnlocked` | int 0–11 | campaign completion | Furthest solved campaign level | | `campaignUnlocked` | int 0–11 | campaign completion | Furthest solved campaign level |
| `story_access_level` | int 0–11 | `nextCampaign`, leaf 6 link | Furthest readable campaign level (independent of awards) | | `story_access_level` | int 0–11 | `nextCampaign`, `leaveCottage` | Furthest readable campaign level; effective access is at least 3 for cottage exploration, independent of awards |
| `storyAd_<index>` | bool | `nextCampaign` | At most one interstitial per fourth campaign step | | `storyAd_<index>` | bool | `nextCampaign` | At most one interstitial per fourth campaign step |
| `recording_speed` | double | speed dialog | `0.85`, `1.0` or `1.15` | | `recording_speed` | double | speed dialog | `0.85`, `1.0` or `1.15` |
@@ -299,14 +303,21 @@ Board key formats (`<key>`):
## Content and assets ## Content and assets
- `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/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/notebook.json`: sixteen ordered records with stable `id`, `type`, `title`, optional `campaignIndex`, `speaker`, `illustrationAsset` and `textSource` (`recording`, `before`, `after`) or inline `text`. `Book.pageFor()` finds a campaign entry/puzzle/memory. Preserve the first six IDs when extending the chapter.
- Cottage `briefing`, `startCampaign` and `reveal` route to the entry, puzzle or memory leaf for levels 0–3. This migrates older saved routes while retaining marks, hint keys and completion awards. Chapters II/III use the existing screens.
- `assets/narration/scripts.json`: canonical diary text, one record per recorded page (`pageId`, `text`). `Book.load()` resolves `recording` text by stable page ID; a missing script yields empty text.
- `assets/narration/manifest.json`: source masters, text hashes, WAV/FLAC hashes and cues — the provenance record. - `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>`. - `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. - Five Mara recordings exist: `cottage.dedication`, `cottage.window`, `cottage.match.memory`, `cottage.folded.note`, `cottage.lantern.sketch`. The match-puzzle leaf has no recording.
- Twenty-three narrator tracks use `bm_george`: seven cottage prose leaves and `campaign.<4..11>.before/after`. `scripts.json` records speaker/voice/speed; the renderer accepts `--speaker Narrator` to preserve Mara’s original takes. The asset checker validates narrator scripts against notebook/campaign text.
- `audio()` uses the story ID or `campaign.<index>.before/after`, with a visible speaker label. Never show a recording control for an ID without a bundled track.
- `discoveryArt()` returns only a text placeholder until `Game.recovered(index)` is true. This gates both watercolours and pixel fallbacks; entry, inspection and closing leaves never call it, regardless of completed progress. The helper also rejects calls outside a memory/reveal screen. The repair note uses a text action rather than a picture hotspot; completed saves must not re-enable artwork on earlier leaves. Contextual cottage/background art is separate from the discovery images.
- The `check` Android flavor (`com.lumen.daily.check`) isolates device automation from the user’s installed QA app and progress.
- 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. - 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`, `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. - 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. - 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()`. - Font: `assets/fonts/DancingScript.ttf` registered as `MaraHand`; `assets/fonts/OFL.txt` is registered with `LicenseRegistry` in `main()`.
- `android/app/src/qa/AndroidManifest.xml` opts the isolated QA package into external installation (`preferExternal`); the production manifest keeps its existing installation policy. Android/OEM support still determines whether an SD-card install is accepted. The review Huawei reports `sm has-adoptable=false` and rejects new ASEC installs; use a compact release build installed internally there.
- `pubspec.yaml` lists every bundled asset explicitly (no directory globs), so new assets must be added there. - `pubspec.yaml` lists every bundled asset explicitly (no directory globs), so new assets must be added there.
### Audio flow ### Audio flow
@@ -332,6 +343,7 @@ Board key formats (`<key>`):
| `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/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, illustrated campaign reveals and pixel fallback at 1.5× text | | `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/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/cottage_test.dart` | All sixteen leaves, larger-text portrait/landscape, bookmarks, legacy-key marks, all four awards, all 23 narrator tracks and isolated test persistence; eight 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 | | `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_narration_assets.py` | Script text ↔ manifest ↔ WAV masters checksums |
| `scripts/check_flutter_install.py` | Read-only installed-app smoke check and screenshots | | `scripts/check_flutter_install.py` | Read-only installed-app smoke check and screenshots |
@@ -386,7 +398,7 @@ Each run checks four discoveries in both orientations at 1.5× text, including n
| Goal | Touch | Also | | Goal | Touch | Also |
| --- | --- | --- | | --- | --- | --- |
| Edit campaign content or pictures | `assets/campaign.json` | Re-run `flutter test` (uniqueness/no-guess campaign tests) and `scripts/check_narration_assets.py` only if text changes | | Edit campaign content or pictures | `assets/campaign.json` | Re-run `flutter test` (uniqueness/no-guess campaign tests) and `scripts/check_narration_assets.py` only if text changes |
| Add or reorder opening leaves | `_NotebookState.story()` switch, `Book` page ids/titles, `assets/narration/scripts.json` | Add a WAV + manifests + `pubspec.yaml` if narrated; update integration test | | Add or reorder cottage leaves | `assets/notebook.json`, `StoryPageType` builders, `Book.pageFor()`, narration scripts if recorded | Add a WAV + manifests + `pubspec.yaml` if narrated; update integration test |
| Add a screen | `Screen` enum, `Game._route`/navigation method, `_NotebookState.build` switch, new builder | Back-button behaviour in `back()` and `PopScope` | | Add a screen | `Screen` enum, `Game._route`/navigation method, `_NotebookState.build` switch, new builder | Back-button behaviour in `back()` and `PopScope` |
| Change puzzle rules, hints or grading | `lib/domain/puzzle.dart` (`Constraint`, `LogicSolver`, `Puzzle`) | `test/puzzle_test.dart`, `Game.applyHint`, board semantics | | Change puzzle rules, hints or grading | `lib/domain/puzzle.dart` (`Constraint`, `LogicSolver`, `Puzzle`) | `test/puzzle_test.dart`, `Game.applyHint`, board semantics |
| Change marks, undo, hints or awards | `lib/domain/game.dart` (`mark`, `undo`, `applyHint`, `check`) | `_NotebookState.hint()`, `puzzleNotes()`, widget tests | | Change marks, undo, hints or awards | `lib/domain/game.dart` (`mark`, `undo`, `applyHint`, `check`) | `_NotebookState.hint()`, `puzzleNotes()`, widget tests |
@@ -403,7 +415,7 @@ Each run checks four discoveries in both orientations at 1.5× text, including n
- **`pumpAndSettle` can struggle with the full app.** Prefer a bounded `pump()` loop when mounting `LumenApp`; the audio streams keep notifying and may prevent settling. - **`pumpAndSettle` can struggle with the full app.** Prefer a bounded `pump()` loop when mounting `LumenApp`; the audio streams keep notifying and may prevent settling.
- **`Game.restore()` must be awaited before `runApp`.** Otherwise the app opens on `home` and ignores the saved screen. - **`Game.restore()` must be awaited before `runApp`.** Otherwise the app opens on `home` and ignores the saved screen.
- **Story page 3 is index 2.** Solving the opening match puzzle awards the first campaign entry (`story_v1_0`) and jumps to story page 4 (`showStory(3)`), skipping the campaign reveal. - **Story page 3 is index 2.** Solving the opening match puzzle awards the first campaign entry (`story_v1_0`) and jumps to story page 4 (`showStory(3)`), skipping the campaign reveal.
- **`showStory()` resets `mode` to campaign and `campaignIndex` to 0.** Daily and classic starts set their own mode afterwards; keep that order. - **`showStory()` sets campaign mode and the page record’s campaign index (0 if absent).** Daily and classic starts set their own mode afterwards; keep that order.
- **`startPractice` discards stale results** with `_request`. Do not remove that guard when refactoring. - **`startPractice` discards stale results** with `_request`. Do not remove that guard when refactoring.
- **Hints are applied immediately.** `Game.applyHint()` writes a mark and pushes an undo snapshot; the free/ad gate lives in `_NotebookState.hint()` via `hint_<key>`, not in the domain. - **Hints are applied immediately.** `Game.applyHint()` writes a mark and pushes an undo snapshot; the free/ad gate lives in `_NotebookState.hint()` via `hint_<key>`, not in the domain.
- **Read-ahead never bypasses access.** `reveal(i, readAhead: true)` still redirects when `i > accessible`. - **Read-ahead never bypasses access.** `reveal(i, readAhead: true)` still redirects when `i > accessible`.
+191
View File
@@ -0,0 +1,191 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:integration_test/integration_test.dart';
import 'package:lumen/domain/book.dart';
import 'package:lumen/domain/game.dart';
import 'package:lumen/main.dart';
import 'package:lumen/services/progress.dart';
import 'package:lumen/services/narrator.dart';
void main() {
final binding = IntegrationTestWidgetsFlutterBinding.ensureInitialized();
testWidgets('complete cottage chapter, bookmarks and larger-text rotation', (
tester,
) async {
expect(const bool.fromEnvironment('QA_TEST'), true);
final book = await Book.load();
final game = Game(book, Progress.memory());
final voice = Narrator(book.tracks);
for (final id in book.tracks.keys.where(
(id) => book.tracks[id]['speaker'] == 'Narrator',
)) {
await voice.toggle(id, 1);
await Future<void>.delayed(const Duration(milliseconds: 900));
await voice.pause();
expect(voice.error, isEmpty, reason: id);
expect(voice.position.inMilliseconds, greaterThan(200), reason: id);
await voice.stop();
}
voice.dispose();
addTearDown(() => SystemChrome.setPreferredOrientations([]));
await SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp]);
game.showStory(0);
await tester.pumpWidget(
MaterialApp(
theme: ThemeData(fontFamily: 'MaraHand'),
home: Builder(
builder: (context) => MediaQuery(
data: MediaQuery.of(context)
.copyWith(textScaler: const TextScaler.linear(1.5)),
child: Notebook(game: game, adsEnabled: false),
),
),
),
);
await tester.pumpAndSettle();
await binding.convertFlutterSurfaceToImage();
Future<void> tap(String label) async {
await tester.ensureVisible(find.text(label));
await tester.pumpAndSettle();
await tester.tap(find.text(label));
await tester.pumpAndSettle();
}
for (var i = 0; i < book.pages.length; i++) {
expect(game.storyIndex, i);
final page = book.pages[i];
if (page.campaignIndex case final index?) {
expect(
find.image(AssetImage(book.levels[index].illustrationAsset!)),
findsNothing,
);
}
if (page.speaker == 'Narrator') {
expect(find.text('Narrator · recorded story'), findsOneWidget);
}
if (page.type == StoryPageType.puzzle) {
final cell = game.puzzle!.given.indexOf(false);
final target = find.byKey(ValueKey('cell-$cell'));
await tester.ensureVisible(target);
await tester.pumpAndSettle();
await tester.tap(target);
await tester.pumpAndSettle();
final marks = List<int>.of(game.cells);
await tap('Bookmark');
final savedId = game.progress.text('notebook_manual_bookmark');
expect(savedId, page.id);
final restored = Game(book, Progress.memory(game.progress.snapshot));
await restored.restore();
expect(restored.storyPage.id, page.id);
expect(restored.cells, marks);
}
if ([6, 10, 14, 15].contains(i)) {
await tester.ensureVisible(find.text(page.title));
await tester.pumpAndSettle();
await binding.takeScreenshot('cottage-$i-portrait');
}
expect(tester.takeException(), isNull, reason: page.id);
await tap(
i == book.pages.length - 1 ? 'Across the tide →' : 'Next leaf →',
);
if (page.type == StoryPageType.puzzle) await tap('Read ahead');
expect(game.solved, 0);
}
expect(game.screen, Screen.briefing);
expect(game.campaignIndex, 4);
await tester.drag(find.text('At the water’s edge'), const Offset(170, 0));
await tester.pumpAndSettle();
expect(game.storyPage.type, StoryPageType.closing);
expect(game.screen, Screen.story);
game.contents(0);
await tester.pumpAndSettle();
await binding.takeScreenshot('cottage-contents-portrait');
await tap('Return to my ribbon bookmark');
expect(game.storyPage.id, 'cottage.compass.puzzle');
final marks = List<int>.of(game.cells);
await SystemChrome.setPreferredOrientations([
DeviceOrientation.landscapeLeft,
]);
for (
var attempt = 0;
attempt < 20 &&
tester.view.physicalSize.width < tester.view.physicalSize.height;
attempt++
) {
await tester.pump(const Duration(milliseconds: 100));
}
await tester.pumpAndSettle();
expect(
tester.view.physicalSize.width,
greaterThan(tester.view.physicalSize.height),
);
expect(game.cells, marks);
await tester.ensureVisible(find.text('Hint · free'));
await tester.pumpAndSettle();
expect(find.text('Hint · free').hitTestable(), findsOneWidget);
final lastCell = tester.getRect(find.byKey(const ValueKey('cell-48')));
expect(
lastCell.bottom,
lessThan(tester.getTopLeft(find.text('Contents')).dy),
);
await binding.takeScreenshot('cottage-compass-landscape');
for (var i = 0; i < 4; i++) {
game.showStory(book.pageFor(i, StoryPageType.puzzle));
final solution = List<int>.of(game.puzzle!.solution);
for (var c = 0; c < solution.length; c++) {
while (game.cells[c] != (solution[c] == 1 ? 1 : 2)) {
game.mark(c);
}
}
expect(game.storyPage.type, StoryPageType.memory);
expect(game.campaignIndex, i);
expect(game.solved, i + 1);
await tester.pumpAndSettle();
expect(
find.image(AssetImage(book.levels[i].illustrationAsset!)),
findsOneWidget,
);
game.showStory(book.pageFor(i, StoryPageType.puzzle));
game.check();
expect(game.solved, i + 1);
}
for (final index in [5, 6, 9, 12, 15]) {
game.showStory(index);
await tester.pumpAndSettle();
for (final level in book.levels) {
expect(
find.image(AssetImage(level.illustrationAsset!)),
findsNothing,
reason:
'Completed progress must not reveal art on ${game.storyPage.id}',
);
}
}
game.showStory(6);
await tester.pumpAndSettle();
await binding.takeScreenshot('cottage-revisit-entry-landscape');
game.showStory(8);
await tester.pumpAndSettle();
expect(
find.image(AssetImage(book.levels[1].illustrationAsset!)),
findsOneWidget,
);
await binding.takeScreenshot('cottage-discovery-landscape');
game.contents(0);
await tester.pumpAndSettle();
final disk = await Progress.load();
for (final entry in game.progress.snapshot.entries) {
await disk.set(entry.key, entry.value);
}
await disk.flushed;
final restarted = Game(book, await Progress.load());
await restarted.restore();
expect(restarted.screen, Screen.contents);
expect(restarted.contentsChapter, 0);
expect(restarted.solved, 4);
expect(tester.takeException(), isNull);
await tester.pumpWidget(const SizedBox());
await tester.pumpAndSettle();
});
}
+12 -2
View File
@@ -19,7 +19,13 @@ void main() {
// in reportData at once exhausts the tablet when the driver encodes JSON. // in reportData at once exhausts the tablet when the driver encodes JSON.
const chapter = int.fromEnvironment('ART_CHAPTER', defaultValue: 0); const chapter = int.fromEnvironment('ART_CHAPTER', defaultValue: 0);
expect(chapter, inInclusiveRange(0, 2)); expect(chapter, inInclusiveRange(0, 2));
final game = Game(book, Progress.memory({'story_access_level': 11})); final game = Game(
book,
Progress.memory({
'story_access_level': 11,
for (var i = 0; i < 12; i++) 'done_story_v1_$i': true,
}),
);
addTearDown(() => SystemChrome.setPreferredOrientations([])); addTearDown(() => SystemChrome.setPreferredOrientations([]));
await binding.convertFlutterSurfaceToImage(); await binding.convertFlutterSurfaceToImage();
for (final orientation in [ for (final orientation in [
@@ -54,7 +60,11 @@ void main() {
'discovery-$index-${orientation.name}-art', 'discovery-$index-${orientation.name}-art',
); );
final next = find.text( final next = find.text(
index == 11 ? 'Return to the notebook' : 'Turn the page →', index < 4
? 'Next leaf →'
: index == 11
? 'Return to the notebook'
: 'Turn the page →',
); );
await tester.ensureVisible(next); await tester.ensureVisible(next);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
+25 -27
View File
@@ -118,14 +118,13 @@ void main() {
await tap('Bookmark'); await tap('Bookmark');
await tap('Next leaf →'); await tap('Next leaf →');
await shot('06-lantern'); await shot('06-lantern');
await tester.tap( expect(
find.bySemanticsLabel( find.bySemanticsLabel(
'Watercolour of Mara’s blue storm lantern. Tap to examine the repaired handle.', 'Watercolour of Mara’s blue storm lantern. Tap to examine the repaired handle.',
), ),
findsNothing,
); );
await tester.pumpAndSettle(); expect(store.flag('notebook_handle_seen'), false);
await tap('Keep that thought');
expect(store.flag('notebook_handle_seen'), true);
await tap('Contents'); await tap('Contents');
await tap('Return to my ribbon bookmark'); await tap('Return to my ribbon bookmark');
expect(g.storyIndex, 4); expect(g.storyIndex, 4);
@@ -151,9 +150,9 @@ void main() {
g.showStory(5); g.showStory(5);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
await tap('Follow the lantern into the next entry →'); await tap('Follow the lantern into the next entry →');
expect(g.screen, Screen.briefing); expect(g.storyIndex, 6);
await tap('Restore the pattern →'); await tap('Turn to the pattern →');
expect(g.screen, Screen.game); expect(g.storyIndex, 7);
final lantern = g.puzzle!; final lantern = g.puzzle!;
for (var i = 0; i < 49; i++) { for (var i = 0; i < 49; i++) {
while (g.cells[i] != (lantern.solution[i] == 1 ? 1 : 2)) { while (g.cells[i] != (lantern.solution[i] == 1 ? 1 : 2)) {
@@ -161,9 +160,17 @@ void main() {
} }
} }
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(g.screen, Screen.reveal); expect(g.storyIndex, 8);
expect(g.solved, 2); expect(g.solved, 2);
await shot('07-campaign-reveal'); await shot('07-campaign-reveal');
g.showStory(5);
await tester.pumpAndSettle();
await tap('Read Gran’s margin note');
await tap('Keep that thought');
expect(store.flag('notebook_handle_seen'), true);
g.showStory(8);
await tester.pumpAndSettle();
// The later campaign leaves need swipes too, including read-ahead. // The later campaign leaves need swipes too, including read-ahead.
Future<void> swipeWriting(String text, double dx) async { Future<void> swipeWriting(String text, double dx) async {
final target = find.text(text); final target = find.text(text);
@@ -172,38 +179,29 @@ void main() {
await tester.pumpAndSettle(); await tester.pumpAndSettle();
} }
await swipeWriting('The lantern', 170); await swipeWriting('A light at the door', -170);
expect(g.screen, Screen.briefing); expect(g.storyIndex, 9);
await swipeWriting('Something to carry the flame', -170);
expect(g.screen, Screen.reveal);
await swipeWriting('The lantern', -170);
expect(g.screen, Screen.briefing);
expect(g.campaignIndex, 2);
await swipeWriting('Under the loose floorboard', -170); await swipeWriting('Under the loose floorboard', -170);
expect(g.screen, Screen.game); expect(g.storyIndex, 10);
await tester.ensureVisible(find.byKey(const ValueKey('cell-0'))); await tester.ensureVisible(find.byKey(const ValueKey('cell-0')));
await tester.tap(find.byKey(const ValueKey('cell-0'))); await tester.tap(find.byKey(const ValueKey('cell-0')));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
final keyMarks = List<int>.of(g.cells); final keyMarks = List<int>.of(g.cells);
await swipeWriting('Under the loose floorboard', -170); await swipeWriting('Under the loose floorboard', -170);
await tap('Keep solving'); await tap('Keep solving');
expect(g.screen, Screen.game); expect(g.storyIndex, 10);
await swipeWriting('Under the loose floorboard', -170); await swipeWriting('Under the loose floorboard', -170);
await tap('Read ahead'); await tap('Read ahead');
expect(g.screen, Screen.reveal); expect(g.storyIndex, 11);
expect(g.recovered(2), false); expect(g.recovered(2), false);
expect(g.solved, 2); expect(g.solved, 2);
await shot('08-campaign-read-ahead'); await shot('08-campaign-read-ahead');
await swipeWriting('The brass key', -170); await swipeWriting('A journey kept ready', -170);
expect(g.screen, Screen.briefing); expect(g.storyIndex, 12);
expect(g.campaignIndex, 3);
await swipeWriting('A direction in the dark', 170); await swipeWriting('A direction in the dark', 170);
expect(g.screen, Screen.reveal); expect(g.storyIndex, 11);
expect(g.campaignIndex, 2); await swipeWriting('A journey kept ready', 170);
await swipeWriting('The brass key', 170); expect(g.storyIndex, 10);
expect(g.screen, Screen.briefing);
await swipeWriting('Under the loose floorboard', -170);
expect(g.screen, Screen.game);
expect(g.cells, keyMarks); expect(g.cells, keyMarks);
expect(g.solved, 2); expect(g.solved, 2);
// Exercise real plugin persistence without touching main-app data. // Exercise real plugin persistence without touching main-app data.
+56 -30
View File
@@ -38,9 +38,31 @@ class CampaignLevel {
} }
} }
enum StoryPageType {
dedication,
entry,
puzzle,
memory,
note,
inspection,
closing,
}
class StoryPage { class StoryPage {
const StoryPage(this.id, this.title, this.text); const StoryPage(
this.id,
this.title,
this.text, {
this.type = StoryPageType.entry,
this.campaignIndex,
this.speaker = '',
this.illustrationAsset,
});
final String id, title, text; final String id, title, text;
final StoryPageType type;
final int? campaignIndex;
final String speaker;
final String? illustrationAsset;
} }
class Book { class Book {
@@ -49,6 +71,9 @@ class Book {
final List<CampaignLevel> levels; final List<CampaignLevel> levels;
final List<StoryPage> pages; final List<StoryPage> pages;
final Map<String, dynamic> tracks; final Map<String, dynamic> tracks;
int pageFor(int campaignIndex, StoryPageType type) => pages.indexWhere(
(p) => p.campaignIndex == campaignIndex && p.type == type,
);
static Future<Book> load() async { static Future<Book> load() async {
final campaign = jsonDecode( final campaign = jsonDecode(
await rootBundle.loadString('assets/campaign.json'), await rootBundle.loadString('assets/campaign.json'),
@@ -63,37 +88,38 @@ class Book {
), ),
)['tracks'] )['tracks']
as Map<String, dynamic>; as Map<String, dynamic>;
const ids = [ final levels = (campaign['levels'] as List)
'cottage.dedication', .map((e) => CampaignLevel(e))
'cottage.window', .toList();
'cottage.match.puzzle', final notebook = jsonDecode(
'cottage.match.memory', await rootBundle.loadString('assets/notebook.json'),
'cottage.folded.note', ) as Map<String, dynamic>;
'cottage.lantern.sketch',
];
const titles = [
'For you, when you are ready',
'By the cottage window',
'A spark in the drawer',
'One small light',
'A note I nearly forgot',
'The handle, carefully mended',
];
return Book( return Book(
campaign['premise'], campaign['premise'],
(campaign['levels'] as List).map((e) => CampaignLevel(e)).toList(), levels,
List.generate( (notebook['pages'] as List).map((record) {
6, final index = record['campaignIndex'] as int?;
(i) => StoryPage( final text = switch (record['textSource']) {
ids[i], 'before' => levels[index!].before,
titles[i], 'after' => levels[index!].after,
scripts 'recording' =>
.where((s) => s['pageId'] == ids[i]) scripts
.map((s) => s['text'] as String) .where((s) => s['pageId'] == record['id'])
.firstOrNull ?? .map((s) => s['text'] as String)
'', .firstOrNull ??
), '',
), _ => record['text'] as String? ?? '',
};
return StoryPage(
record['id'],
record['title'],
text,
type: StoryPageType.values.byName(record['type']),
campaignIndex: index,
speaker: record['speaker'] as String? ?? '',
illustrationAsset: record['illustrationAsset'] as String?,
);
}).toList(),
tracks, tracks,
); );
} }
+34 -10
View File
@@ -25,6 +25,8 @@ class Game extends ChangeNotifier {
Difficulty get difficulty => Difficulty get difficulty =>
Difficulty.fromStored(progress.text('difficulty', 'EASY')); Difficulty.fromStored(progress.text('difficulty', 'EASY'));
int storyIndex = 0, campaignIndex = 0, playingLevel = 1, selectedArea = 0; int storyIndex = 0, campaignIndex = 0, playingLevel = 1, selectedArea = 0;
int contentsChapter = 0;
StoryPage get storyPage => book.pages[storyIndex];
DateTime date = DateTime.now(); DateTime date = DateTime.now();
Puzzle? puzzle; Puzzle? puzzle;
List<int> cells = []; List<int> cells = [];
@@ -38,8 +40,10 @@ class Game extends ChangeNotifier {
int get recoveredCount => int get recoveredCount =>
List.generate(12, (i) => recovered(i)).where((v) => v).length; List.generate(12, (i) => recovered(i)).where((v) => v).length;
int get unlocked => progress.number('campaignUnlocked').clamp(0, 11); int get unlocked => progress.number('campaignUnlocked').clamp(0, 11);
int get accessible => int get accessible => math.max(
math.max(unlocked, progress.number('story_access_level').clamp(0, 11)); 3,
math.max(unlocked, progress.number('story_access_level').clamp(0, 11)),
);
int get practiceLevel => progress.number('level_${difficulty.stored}', 1); int get practiceLevel => progress.number('level_${difficulty.stored}', 1);
int get streak => visibleStreak( int get streak => visibleStreak(
progress.number('lastDaily', -99999), progress.number('lastDaily', -99999),
@@ -54,10 +58,10 @@ class Game extends ChangeNotifier {
showStory( showStory(
book.pages book.pages
.indexWhere((p) => p.id == progress.text('notebook_last_page')) .indexWhere((p) => p.id == progress.text('notebook_last_page'))
.clamp(0, 5), .clamp(0, book.pages.length - 1),
); );
} else if (saved == 'contents') { } else if (saved == 'contents') {
contents(); contents(progress.number('notebook_contents_chapter'));
} else if (saved == 'briefing') { } else if (saved == 'briefing') {
briefing(campaignIndex); briefing(campaignIndex);
} else if (saved == 'reveal' && } else if (saved == 'reveal' &&
@@ -109,25 +113,37 @@ class Game extends ChangeNotifier {
void showStory(int i) { void showStory(int i) {
_request++; _request++;
busy = false; busy = false;
storyIndex = i.clamp(0, 5); storyIndex = i.clamp(0, book.pages.length - 1);
mode = Mode.campaign; mode = Mode.campaign;
campaignIndex = 0; campaignIndex = storyPage.campaignIndex ?? 0;
if (storyIndex == 2 && key != 'story_v1_0') { if (storyPage.type == StoryPageType.puzzle &&
_read(book.levels[0].puzzle(), 'story_v1_0'); key != 'story_v1_$campaignIndex') {
_read(book.levels[campaignIndex].puzzle(), 'story_v1_$campaignIndex');
} }
unawaited(progress.set('notebook_last_page', book.pages[storyIndex].id)); unawaited(progress.set('notebook_last_page', book.pages[storyIndex].id));
unawaited(progress.set('viewed_${book.pages[storyIndex].id}', true)); unawaited(progress.set('viewed_${book.pages[storyIndex].id}', true));
_route(Screen.story); _route(Screen.story);
} }
void contents() { void contents([int? chapter]) {
_request++; _request++;
busy = false; busy = false;
contentsChapter = (chapter ?? campaignIndex ~/ 4).clamp(0, accessible ~/ 4);
unawaited(progress.set('notebook_contents_chapter', contentsChapter));
_route(Screen.contents); _route(Screen.contents);
} }
void leaveCottage() {
unawaited(progress.set('story_access_level', math.max(accessible, 4)));
briefing(4);
}
void briefing(int i) { void briefing(int i) {
campaignIndex = i.clamp(0, accessible); campaignIndex = i.clamp(0, accessible);
if (campaignIndex < 4) {
showStory(book.pageFor(campaignIndex, StoryPageType.entry));
return;
}
mode = Mode.campaign; mode = Mode.campaign;
_route(Screen.briefing); _route(Screen.briefing);
} }
@@ -138,6 +154,10 @@ class Game extends ChangeNotifier {
return; return;
} }
campaignIndex = i; campaignIndex = i;
if (i < 4) {
showStory(book.pageFor(i, StoryPageType.memory));
return;
}
mode = Mode.campaign; mode = Mode.campaign;
_route(Screen.reveal); _route(Screen.reveal);
} }
@@ -187,6 +207,10 @@ class Game extends ChangeNotifier {
} }
campaignIndex = i; campaignIndex = i;
mode = Mode.campaign; mode = Mode.campaign;
if (i < 4) {
showStory(book.pageFor(i, StoryPageType.puzzle));
return;
}
_read(book.levels[i].puzzle(), 'story_v1_$i'); _read(book.levels[i].puzzle(), 'story_v1_$i');
_route(Screen.game); _route(Screen.game);
} }
@@ -287,7 +311,7 @@ class Game extends ChangeNotifier {
), ),
); );
if (screen == Screen.story) { if (screen == Screen.story) {
showStory(3); showStory(book.pageFor(campaignIndex, StoryPageType.memory));
} else { } else {
reveal(campaignIndex); reveal(campaignIndex);
} }
+188 -103
View File
@@ -167,9 +167,14 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
} }
Future<void> turn(int direction) async { Future<void> turn(int direction) async {
final next = (g.storyIndex + direction).clamp(0, 5); if (direction > 0 && g.storyIndex == g.book.pages.length - 1) {
crossToHarbour();
return;
}
final next = (g.storyIndex + direction).clamp(0, g.book.pages.length - 1);
if (next == g.storyIndex) return; if (next == g.storyIndex) return;
if (g.storyIndex == 2 && direction > 0 && !g.won) { final pageId = g.storyPage.id;
if (g.storyPage.type == StoryPageType.puzzle && direction > 0 && !g.won) {
unawaited(narrator.stop()); unawaited(narrator.stop());
if (!await confirm( if (!await confirm(
'Leave a ribbon here?', 'Leave a ribbon here?',
@@ -181,7 +186,11 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
} }
await prefs.set('notebook_read_ahead', true); await prefs.set('notebook_read_ahead', true);
} }
g.showStory(next); if (mounted && g.storyPage.id == pageId) g.showStory(next);
}
void crossToHarbour() {
g.leaveCottage();
} }
Future<void> turnCampaign(int direction) async { Future<void> turnCampaign(int direction) async {
@@ -191,7 +200,11 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
if (direction > 0) { if (direction > 0) {
g.startCampaign(index); g.startCampaign(index);
} else if (index > 0) { } else if (index > 0) {
g.reveal(index - 1, readAhead: true); if (index == 4) {
g.showStory(g.book.pages.length - 1);
} else {
g.reveal(index - 1, readAhead: true);
}
} else { } else {
g.contents(); g.contents();
} }
@@ -435,8 +448,10 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
size: wide ? 19 : 21, size: wide ? 19 : 21,
); );
final next = InkButton( final next = InkButton(
g.storyIndex == 5 ? 'End of this trail' : 'Next leaf →', g.storyIndex == g.book.pages.length - 1
g.storyIndex < 5 ? () => turn(1) : null, ? 'Across the tide →'
: 'Next leaf →',
() => turn(1),
size: wide ? 19 : 21, size: wide ? 19 : 21,
); );
if (wide) { if (wide) {
@@ -476,7 +491,11 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
]); ]);
} }
Widget reading(String text) => ListenableBuilder( String get recordingId => g.screen == Screen.story
? g.storyPage.id
: 'campaign.${g.campaignIndex}.${g.screen == Screen.briefing ? 'before' : 'after'}';
Widget reading(String text, {double? size}) => ListenableBuilder(
listenable: narrator, listenable: narrator,
builder: (context, _) { builder: (context, _) {
final passage = narrator.passage, final passage = narrator.passage,
@@ -485,7 +504,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8),
child: Text.rich( child: Text.rich(
TextSpan( TextSpan(
style: hand(g.storyIndex == 0 ? 22 : 21), style: hand(size ?? (g.storyIndex == 0 ? 22 : 21)),
children: index < 0 children: index < 0
? [TextSpan(text: text)] ? [TextSpan(text: text)]
: [ : [
@@ -506,6 +525,13 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
Widget audio() => ListenableBuilder( Widget audio() => ListenableBuilder(
listenable: narrator, listenable: narrator,
builder: (context, _) => column([ builder: (context, _) => column([
writing(
g.book.tracks[recordingId]?['speaker'] == 'Narrator'
? 'Narrator · recorded story'
: 'Mara · diary reading',
size: 17,
color: muted,
),
Row( Row(
children: [ children: [
Expanded( Expanded(
@@ -515,7 +541,7 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
narrator.loading narrator.loading
? null ? null
: () => narrator.toggle( : () => narrator.toggle(
g.book.pages[g.storyIndex].id, recordingId,
prefs.decimal('recording_speed'), prefs.decimal('recording_speed'),
), ),
size: 21, size: 21,
@@ -530,53 +556,42 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
writing(narrator.status, size: 17, color: muted), writing(narrator.status, size: 17, color: muted),
]), ]),
); );
Widget illustration(
String asset,
String description, {
VoidCallback? onTap,
}) => Semantics(
image: true,
button: onTap != null,
label: description,
child: GestureDetector(
onTap: onTap,
child: Image.asset(
'assets/artwork/$asset',
height: 155,
fit: BoxFit.contain,
excludeFromSemantics: true,
),
),
);
Widget story() { Widget story() {
final p = g.book.pages[g.storyIndex]; final p = g.book.pages[g.storyIndex];
final heading = <Widget>[ final heading = <Widget>[
folio('MARA’S NOTEBOOK / ${g.storyIndex + 1} OF 6'), folio('THE COTTAGE / ${g.storyIndex + 1} OF ${g.book.pages.length}'),
writing(p.title, size: 31), writing(p.title, size: 31),
]; ];
final body = <Widget>[...heading]; final body = <Widget>[...heading];
Widget? wideBody; Widget? wideBody;
switch (g.storyIndex) { switch (p.type) {
case 0: case StoryPageType.dedication:
body.addAll([ body.addAll([
writing('A few things worth keeping', size: 20, color: muted), writing('A few things worth keeping', size: 20, color: muted),
divider(), divider(),
reading(p.text), reading(p.text),
audio(), audio(),
]); ]);
case 1: case StoryPageType.entry:
body.addAll([ body.addAll([
illustration( if (p.illustrationAsset case final asset?)
'cottage-vignette-v1.png', Image.asset(
'Watercolour of Gran’s stone cottage, blue door and warm window.', asset,
), height: 155,
writing('A note beside the window · Mara', size: 17, color: muted), fit: BoxFit.contain,
semanticLabel: 'Watercolour of Gran’s stone cottage, blue door and warm window.',
),
writing(p.speaker, size: 17, color: muted),
reading(p.text), reading(p.text),
audio(), if (g.book.tracks.containsKey(p.id)) audio(),
if (p.campaignIndex != 0)
action('Turn to the pattern →', () => turn(1)),
]); ]);
case 2: case StoryPageType.puzzle:
final intro = writing( final intro = writing(
'Restore a small light, or leave a bookmark and read on.', g.campaignIndex < 2
? 'Restore a small light, or leave a bookmark and read on.'
: 'Compare the shared areas. Each cell counts in every area it belongs to.',
size: 21, size: 21,
color: muted, color: muted,
); );
@@ -584,20 +599,27 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
wideBody = splitPuzzle( wideBody = splitPuzzle(
side: [...heading, intro, areaPicker(), ...puzzleNotes()], side: [...heading, intro, areaPicker(), ...puzzleNotes()],
); );
case 3: case StoryPageType.memory:
body.addAll([ body.addAll([
discoveryArt(g.book.levels.first, height: 155), discoveryArt(g.book.levels[p.campaignIndex!], height: 155),
writing( writing(
g.recovered(0) g.recovered(p.campaignIndex!)
? 'A pattern restored · a memory kept' ? 'A pattern restored · a memory kept'
: 'A memory to read · your puzzle can wait', : 'A memory to read · your puzzle can wait',
size: 17, size: 17,
color: muted, color: muted,
), ),
reading(p.text), reading(p.text),
audio(), if (g.book.tracks.containsKey(p.id)) audio(),
if (!g.recovered(p.campaignIndex!))
action(
'Return to this pattern',
() => g.showStory(
g.book.pageFor(p.campaignIndex!, StoryPageType.puzzle),
),
),
]); ]);
case 4: case StoryPageType.note:
if (!prefs.flag('notebook_note_open')) { if (!prefs.flag('notebook_note_open')) {
body.addAll([ body.addAll([
writing('A folded scrap, tucked between the leaves.'), writing('A folded scrap, tucked between the leaves.'),
@@ -628,31 +650,39 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
}), }),
]); ]);
} }
case 5: case StoryPageType.inspection:
body.addAll([ body.addAll([
illustration(
'lantern-vignette-v1.png',
'Watercolour of Mara’s blue storm lantern. Tap to examine the repaired handle.',
onTap: inspect,
),
writing( writing(
prefs.flag('notebook_handle_seen') prefs.flag('notebook_handle_seen')
? 'A repair made to keep small fingers safe.' ? 'A repair made to keep small fingers safe.'
: 'Tap the lantern to look a little closer.', : 'A repair note, tucked into the margin.',
size: 20, size: 20,
color: muted, color: muted,
), ),
reading(p.text), reading(p.text),
audio(), audio(),
action('Follow the lantern into the next entry →', () { action('Read Gran’s margin note', inspect),
unawaited( action('Follow the lantern into the next entry →', () => turn(1)),
prefs.set( ]);
'story_access_level', case StoryPageType.closing:
g.accessible < 1 ? 1 : g.accessible, body.addAll([
), reading(p.text),
); if (g.book.tracks.containsKey(p.id)) audio(),
g.briefing(1); writing(
}), 'Four memories in the cottage · ${List.generate(4, (i) => g.recovered(i)).where((v) => v).length} patterns restored',
size: 19,
color: muted,
),
action(
'Take the path to the harbour →',
crossToHarbour,
primary: true,
),
writing(
'Your unfinished patterns will wait here for you.',
size: 19,
color: muted,
),
]); ]);
} }
return Leaf( return Leaf(
@@ -704,42 +734,36 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
); );
} }
Widget contents() => Leaf( Widget contents() {
key: const ValueKey('contents'), final chapter = g.contentsChapter;
body: column([ final first = chapter * 4;
folio('THE NOTEBOOK BELONGS TO'), final savedId = prefs.text('notebook_last_page');
writing('Mara Wren', size: 40), final saved = g.book.pages.where((p) => p.id == savedId).firstOrNull;
writing('The Last Light', size: 33), final bookmarkId = prefs.text('notebook_manual_bookmark');
writing( final ribbon = g.book.pages.where((p) => p.id == bookmarkId).firstOrNull;
'For you, when you are ready.\nWith all my love, Gran.', return Leaf(
color: const Color(0xff70503b), key: ValueKey('contents-$chapter'),
), body: column([
divider(), folio('MARA’S NOTEBOOK · CONTENTS'),
folio('THE COTTAGE · OPENING LEAVES'), writing(g.book.levels[first].chapter, size: 34),
for (var i = 0; i < 6; i++) if (chapter == 0) ...[
action('${i + 1} · ${g.book.pages[i].title}', () => g.showStory(i)), writing(
action('Return to my ribbon bookmark', () { 'For you, when you are ready. With all my love, Gran.',
final i = g.book.pages.indexWhere( color: const Color(0xff70503b),
(p) => p.id == prefs.text('notebook_manual_bookmark'), ),
); action('Open the dedication', () => g.showStory(0)),
g.showStory(i < 0 ? 0 : i); if (saved != null)
}), action('Continue reading · ${saved.title}', g.openNotebook),
divider(), if (ribbon != null)
writing(g.book.premise), action(
writing( 'Return to my ribbon bookmark',
'${g.recoveredCount} / 12 memories tucked between these pages', () => g.showStory(g.book.pages.indexOf(ribbon)),
size: 20, ),
color: muted, divider(),
),
for (var i = 0; i < 12; i++) ...[
if (i % 4 == 0) ...[
gap(24),
writing(g.book.levels[i].chapter, size: 28, color: blue),
], ],
Padding( for (var i = first; i < first + 4; i++) ...[
padding: const EdgeInsets.symmetric(vertical: 5), InkButton(
child: InkButton( '${i + 1} · ${g.book.levels[i].title}${g.recovered(i) ? ' ✓' : ''}${chapter == 0 && ribbon?.campaignIndex == i ? ' · ribbon' : ''}',
'${(i + 1).toString().padLeft(2, '0')} · ${g.recovered(i) ? '${g.book.levels[i].object} ✓' : g.book.levels[i].title}${i > g.accessible ? ' · not yet' : ''}',
i <= g.accessible i <= g.accessible
? () { ? () {
if (g.recovered(i)) { if (g.recovered(i)) {
@@ -750,11 +774,48 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
} }
: null, : null,
), ),
],
if (chapter == 0) ...[
divider(),
action('The folded note', () => g.showStory(4)),
action('Gran’s repair note', () => g.showStory(5)),
action(
'Before you leave',
() => g.showStory(g.book.pages.length - 1),
),
],
writing(
'${g.recoveredCount} / 12 memories restored',
size: 20,
color: muted,
), ),
], ]),
action('Close the notebook', g.home), footer: column([
]), Row(
); children: [
Expanded(
child: InkButton(
'← Previous chapter',
chapter > 0 ? () => g.contents(chapter - 1) : null,
size: 19,
),
),
Expanded(
child: InkButton(
'Next chapter →',
chapter < 2 && (chapter + 1) * 4 <= g.accessible
? () => g.contents(chapter + 1)
: null,
size: 19,
),
),
],
),
InkButton('Close the notebook', g.home, size: 19),
]),
);
}
Widget briefing() { Widget briefing() {
final l = g.book.levels[g.campaignIndex]; final l = g.book.levels[g.campaignIndex];
return Leaf( return Leaf(
@@ -765,7 +826,8 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
writing(l.chapter, size: 20, color: blue), writing(l.chapter, size: 20, color: blue),
writing(l.title, size: 33), writing(l.title, size: 33),
gap(), gap(),
writing(l.before, size: 25), reading(l.before, size: 25),
if (g.book.tracks.containsKey(recordingId)) audio(),
divider(), divider(),
writing( writing(
g.campaignIndex < 2 g.campaignIndex < 2
@@ -987,7 +1049,8 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
g.key != requested || g.key != requested ||
g.won || g.won ||
!(g.screen == Screen.game || !(g.screen == Screen.game ||
g.screen == Screen.story && g.storyIndex == 2)) { g.screen == Screen.story &&
g.storyPage.type == StoryPageType.puzzle)) {
return; return;
} }
final h = g.applyHint(); final h = g.applyHint();
@@ -996,7 +1059,13 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
'Row ${h.cell ~/ g.puzzle!.size + 1}, column ${h.cell % g.puzzle!.size + 1}', 'Row ${h.cell ~/ g.puzzle!.size + 1}, column ${h.cell % g.puzzle!.size + 1}',
'${h.explanation}\n\n${h.value == 1 ? 'This cell is lit.' : 'This cell stays dark.'}', '${h.explanation}\n\n${h.value == 1 ? 'This cell is lit.' : 'This cell stays dark.'}',
); );
if (mounted && g.key == requested) g.check(); if (mounted &&
g.key == requested &&
(g.screen == Screen.game ||
g.screen == Screen.story &&
g.storyPage.type == StoryPageType.puzzle)) {
g.check();
}
} }
if (!prefs.flag('hint_$requested')) { if (!prefs.flag('hint_$requested')) {
@@ -1027,6 +1096,19 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
} }
Widget discoveryArt(CampaignLevel level, {double height = 190}) { Widget discoveryArt(CampaignLevel level, {double height = 190}) {
// Discovery images belong only to the leaf after the puzzle, even when
// revisiting an earlier page with a completed save.
if (!(g.screen == Screen.reveal ||
g.screen == Screen.story && g.storyPage.type == StoryPageType.memory)) {
return const SizedBox.shrink();
}
if (!g.recovered(g.book.levels.indexOf(level))) {
return writing(
'The picture will appear once you restore the pattern.',
size: 19,
color: muted,
);
}
if (level.illustrationAsset case final asset?) { if (level.illustrationAsset case final asset?) {
return Image.asset( return Image.asset(
asset, asset,
@@ -1057,7 +1139,10 @@ class _NotebookState extends State<Notebook> with WidgetsBindingObserver {
), ),
writing(l.object, size: 35), writing(l.object, size: 35),
discoveryArt(l), discoveryArt(l),
writing(l.after, size: 25), reading(l.after, size: 25),
if (g.book.tracks.containsKey(recordingId)) audio(),
if (!g.recovered(i))
action('Return to this pattern', () => g.startCampaign(i)),
gap(), gap(),
writing( writing(
g.recovered(i) g.recovered(i)
+24
View File
@@ -23,6 +23,7 @@ flutter:
assets: assets:
- assets/fonts/OFL.txt - assets/fonts/OFL.txt
- assets/campaign.json - assets/campaign.json
- assets/notebook.json
- assets/artwork/mara-single-page-v2.png - assets/artwork/mara-single-page-v2.png
- assets/artwork/home-harbour-v2.png - assets/artwork/home-harbour-v2.png
- assets/artwork/home-notebook-cover-v2.png - assets/artwork/home-notebook-cover-v2.png
@@ -46,6 +47,29 @@ flutter:
- assets/audio/narration_cottage_match_memory.wav - assets/audio/narration_cottage_match_memory.wav
- assets/audio/narration_cottage_folded_note.wav - assets/audio/narration_cottage_folded_note.wav
- assets/audio/narration_cottage_lantern_sketch.wav - assets/audio/narration_cottage_lantern_sketch.wav
- assets/audio/narration_cottage_lantern_entry.wav
- assets/audio/narration_cottage_lantern_memory.wav
- assets/audio/narration_cottage_key_entry.wav
- assets/audio/narration_cottage_key_memory.wav
- assets/audio/narration_cottage_compass_entry.wav
- assets/audio/narration_cottage_compass_memory.wav
- assets/audio/narration_cottage_threshold.wav
- assets/audio/narration_campaign_4_before.wav
- assets/audio/narration_campaign_4_after.wav
- assets/audio/narration_campaign_5_before.wav
- assets/audio/narration_campaign_5_after.wav
- assets/audio/narration_campaign_6_before.wav
- assets/audio/narration_campaign_6_after.wav
- assets/audio/narration_campaign_7_before.wav
- assets/audio/narration_campaign_7_after.wav
- assets/audio/narration_campaign_8_before.wav
- assets/audio/narration_campaign_8_after.wav
- assets/audio/narration_campaign_9_before.wav
- assets/audio/narration_campaign_9_after.wav
- assets/audio/narration_campaign_10_before.wav
- assets/audio/narration_campaign_10_after.wav
- assets/audio/narration_campaign_11_before.wav
- assets/audio/narration_campaign_11_after.wav
fonts: fonts:
- family: MaraHand - family: MaraHand
fonts: fonts:
+16 -2
View File
@@ -5,14 +5,28 @@ from pathlib import Path
root=Path(__file__).resolve().parents[1] root=Path(__file__).resolve().parents[1]
source=root/'assets/narration';raw=root/'assets/audio' source=root/'assets/narration';raw=root/'assets/audio'
canonical=json.loads((source/'scripts.json').read_text()) canonical=json.loads((source/'scripts.json').read_text())
campaign=json.loads((root/'assets/campaign.json').read_text())['levels']
pages={p['id']:p for p in json.loads((root/'assets/notebook.json').read_text())['pages']}
manifest=json.loads((source/'manifest.json').read_text());runtime=json.loads((raw/'narration_manifest.json').read_text()) manifest=json.loads((source/'manifest.json').read_text());runtime=json.loads((raw/'narration_manifest.json').read_text())
assert runtime['tracks']==manifest['tracks'] assert runtime['tracks']==manifest['tracks']
assert len(canonical)==5==len(manifest['tracks']) assert len(canonical)==len(manifest['tracks'])
assert {r['pageId'] for r in canonical}==set(manifest['tracks'])
for record in canonical: for record in canonical:
if record['pageId'].startswith('campaign.'):
_,index,phase=record['pageId'].split('.')
assert record['text']==campaign[int(index)][phase], 'Campaign narration is stale'
elif record.get('speaker')=='Narrator':
page=pages[record['pageId']]
expected=campaign[page['campaignIndex']][page['textSource']] if page.get('textSource') in ('before','after') else page['text']
assert record['text']==expected, 'Notebook narration is stale'
track=manifest['tracks'][record['pageId']] track=manifest['tracks'][record['pageId']]
assert track['text']==record['text'] assert track['text']==record['text']
assert track['textSha256']==hashlib.sha256(record['text'].encode()).hexdigest() assert track['textSha256']==hashlib.sha256(record['text'].encode()).hexdigest()
assert track['resource']==record['resource'] assert track['resource']==record['resource']
if record.get('speaker')=='Narrator':
assert track['speaker']=='Narrator' and track['voice']=='bm_george'
assert track['speed']==record['speed']
assert 'assets/audio/'+track['file'] in (root/'pubspec.yaml').read_text()
assert '\n\n'.join(cue['text'] for cue in track['cues'])==record['text'] assert '\n\n'.join(cue['text'] for cue in track['cues'])==record['text']
previous=0 previous=0
for cue in track['cues']: for cue in track['cues']:
@@ -33,4 +47,4 @@ for record in canonical:
print(f"PASS {record['pageId']}: {track['durationMs']/1000:.1f}s, WAV/master match, FLAC lossless, text/cues match") print(f"PASS {record['pageId']}: {track['durationMs']/1000:.1f}s, WAV/master match, FLAC lossless, text/cues match")
for p in (root/'lib').rglob('*.dart'): for p in (root/'lib').rglob('*.dart'):
assert 'flutter_tts' not in p.read_text(),f'Device reader reintroduced in {p}' assert 'flutter_tts' not in p.read_text(),f'Device reader reintroduced in {p}'
print('All five recordings verified; bundled file playback only.') print(f'All {len(canonical)} recordings verified; bundled file playback only.')
+8 -4
View File
@@ -1,5 +1,5 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
"""Prepare immutable WAV masters and bundled FLACs; Android performs no speech synthesis.""" """Prepare WAV masters, runtime WAVs and archival FLACs; playback never synthesizes speech."""
import argparse, hashlib, importlib.metadata, json, subprocess, shutil import argparse, hashlib, importlib.metadata, json, subprocess, shutil
from pathlib import Path from pathlib import Path
import numpy as np import numpy as np
@@ -14,6 +14,7 @@ parser.add_argument('--model',type=Path,required=True)
parser.add_argument('--voices',type=Path,required=True) parser.add_argument('--voices',type=Path,required=True)
parser.add_argument('--voice',default='bf_emma') parser.add_argument('--voice',default='bf_emma')
parser.add_argument('--speed',type=float,default=.82) parser.add_argument('--speed',type=float,default=.82)
parser.add_argument('--speaker', help='Render only this speaker, preserving all other recordings')
parser.add_argument('--root',type=Path,default=Path(__file__).resolve().parents[1]) parser.add_argument('--root',type=Path,default=Path(__file__).resolve().parents[1])
a=parser.parse_args() a=parser.parse_args()
source=a.root/'assets/narration';raw=a.root/'assets/audio' source=a.root/'assets/narration';raw=a.root/'assets/audio'
@@ -23,8 +24,10 @@ session=ort.InferenceSession(str(a.model),sess_options=options,providers=['CPUEx
session.disable_fallback() session.disable_fallback()
config=EspeakConfig(lib_path=str(espeakng_loader.get_library_path()),data_path=str(espeakng_loader.get_data_path())) config=EspeakConfig(lib_path=str(espeakng_loader.get_library_path()),data_path=str(espeakng_loader.get_data_path()))
engine=Kokoro.from_session(session,str(a.voices),espeak_config=config) engine=Kokoro.from_session(session,str(a.voices),espeak_config=config)
tracks={} previous=json.loads((source/'manifest.json').read_text()) if (source/'manifest.json').exists() else {}
tracks=dict(previous.get('tracks',{})) if a.speaker else {}
for record in json.loads((source/'scripts.json').read_text()): for record in json.loads((source/'scripts.json').read_text()):
if a.speaker and record.get('speaker')!=a.speaker: continue
paragraphs=[] paragraphs=[]
for part in record['text'].split('\n\n'): for part in record['text'].split('\n\n'):
if paragraphs and len(part)<45:paragraphs[-1]+='\n\n'+part if paragraphs and len(part)<45:paragraphs[-1]+='\n\n'+part
@@ -33,7 +36,7 @@ for record in json.loads((source/'scripts.json').read_text()):
rate=24000;pieces=[np.zeros(int(rate*.18),dtype=np.float32)];frames=len(pieces[0]);cues=[] rate=24000;pieces=[np.zeros(int(rate*.18),dtype=np.float32)];frames=len(pieces[0]);cues=[]
for part in paragraphs: for part in paragraphs:
print(f"Rendering {record['pageId']} · {len(cues)+1}/{len(paragraphs)}",flush=True) print(f"Rendering {record['pageId']} · {len(cues)+1}/{len(paragraphs)}",flush=True)
samples,sample_rate=engine.create(part.replace('\n',' '),voice=a.voice,speed=a.speed,lang='en-gb',sentence_pause=.38,clause_pause=.14) samples,sample_rate=engine.create(part.replace('\n',' '),voice=record.get('voice',a.voice),speed=record.get('speed',a.speed),lang='en-gb',sentence_pause=.38,clause_pause=.14)
assert sample_rate==rate assert sample_rate==rate
samples=np.asarray(samples,dtype=np.float32).reshape(-1) samples=np.asarray(samples,dtype=np.float32).reshape(-1)
assert len(samples)>rate*.3 and np.isfinite(samples).all() assert len(samples)>rate*.3 and np.isfinite(samples).all()
@@ -55,8 +58,9 @@ for record in json.loads((source/'scripts.json').read_text()):
'flacSha256':hashlib.sha256(flac.read_bytes()).hexdigest(),'cues':cues} 'flacSha256':hashlib.sha256(flac.read_bytes()).hexdigest(),'cues':cues}
print(f"Saved {wav.name}: {len(audio)/rate:.1f}s; lossless FLAC verified",flush=True) print(f"Saved {wav.name}: {len(audio)/rate:.1f}s; lossless FLAC verified",flush=True)
manifest={'voice':a.voice,'speed':a.speed,'language':'en-gb','method':'Synthetic narration rendered during development; bundled file playback only.', manifest={'voice':a.voice,'speed':a.speed,'language':'en-gb','method':'Synthetic narration rendered during development; bundled file playback only.',
'speakers':{'Mara':{'voice':'bf_emma','speed':.82},'Narrator':{'voice':'bm_george','speed':.88}},
'modelSha256':hashlib.sha256(a.model.read_bytes()).hexdigest(),'voicesSha256':hashlib.sha256(a.voices.read_bytes()).hexdigest(), 'modelSha256':hashlib.sha256(a.model.read_bytes()).hexdigest(),'voicesSha256':hashlib.sha256(a.voices.read_bytes()).hexdigest(),
'packages':{p:importlib.metadata.version(p) for p in ['kokoro-onnx','onnxruntime','soundfile','espeakng-loader']},'tracks':tracks} 'packages':{p:importlib.metadata.version(p) for p in ['kokoro-onnx','onnxruntime','soundfile','espeakng-loader']},'tracks':tracks}
(source/'manifest.json').write_text(json.dumps(manifest,ensure_ascii=False,indent=2)+'\n') (source/'manifest.json').write_text(json.dumps(manifest,ensure_ascii=False,indent=2)+'\n')
(raw/'narration_manifest.json').write_text(json.dumps({'tracks':tracks},ensure_ascii=False,indent=2)+'\n') (raw/'narration_manifest.json').write_text(json.dumps({'tracks':tracks},ensure_ascii=False,indent=2)+'\n')
print('All five narration masters and runtime FLACs prepared.',flush=True) print(f'{len(tracks)} narration masters and runtime assets prepared.',flush=True)
+116 -4
View File
@@ -10,6 +10,118 @@ import 'package:lumen/services/progress.dart';
void main() { void main() {
TestWidgetsFlutterBinding.ensureInitialized(); TestWidgetsFlutterBinding.ensureInitialized();
test(
'cottage pages have stable identities and complete puzzle beats',
() async {
final book = await Book.load();
expect(book.pages.length, 16);
expect(book.pages.map((p) => p.id).toSet().length, 16);
expect(book.pages.take(6).map((p) => p.id), [
'cottage.dedication',
'cottage.window',
'cottage.match.puzzle',
'cottage.match.memory',
'cottage.folded.note',
'cottage.lantern.sketch',
]);
for (var i = 0; i < 4; i++) {
final entry = book.pageFor(i, StoryPageType.entry);
final puzzle = book.pageFor(i, StoryPageType.puzzle);
final memory = book.pageFor(i, StoryPageType.memory);
expect(entry, lessThan(puzzle));
expect(puzzle + 1, memory);
expect(book.pages[entry].text, isNotEmpty);
expect(book.pages[memory].text, isNotEmpty);
}
expect(book.pages.last.type, StoryPageType.closing);
expect(
book.tracks.keys
.where((id) => id.startsWith('cottage.'))
.every((id) => book.pages.any((p) => p.id == id)),
true,
);
},
);
test(
'all cottage puzzles survive read-ahead, restart and exactly-once awards',
() async {
final book = await Book.load();
final store = Progress.memory();
var g = Game(book, store);
for (var i = 0; i < 4; i++) {
final puzzle = book.pageFor(i, StoryPageType.puzzle);
final memory = book.pageFor(i, StoryPageType.memory);
g.showStory(puzzle);
final cell = g.puzzle!.given.indexOf(false);
g.mark(cell);
final marks = List<int>.of(g.cells);
g.showStory(memory);
await g.progress.set('notebook_manual_bookmark', book.pages[memory].id);
g = Game(book, Progress.memory(g.progress.snapshot));
await g.restore();
expect(g.storyIndex, memory);
expect(g.solved, i);
g.showStory(puzzle);
expect(g.key, 'story_v1_$i');
expect(g.cells, marks);
final solution = List<int>.of(g.puzzle!.solution);
for (var c = 0; c < solution.length; c++) {
while (g.cells[c] != (solution[c] == 1 ? 1 : 2)) {
g.mark(c);
}
}
expect(g.storyIndex, memory);
expect(g.solved, i + 1);
g.showStory(puzzle);
g.check();
expect(g.solved, i + 1);
}
},
);
test(
'legacy cottage routes migrate without changing marks or awards',
() async {
final book = await Book.load();
for (var i = 0; i < 4; i++) {
for (final route in ['briefing', 'game', 'reveal']) {
final store = Progress.memory({
'flutter_screen': route,
'flutter_campaign': i,
'flutter_mode': 'campaign',
'flutter_read_ahead': true,
'grid_story_v1_$i': '1${'0' * 48}',
'solved': 2,
});
final g = Game(book, store);
await g.restore();
final type = switch (route) {
'game' => StoryPageType.puzzle,
'reveal' => StoryPageType.memory,
_ => StoryPageType.entry,
};
expect(g.storyPage.type, type);
expect(g.campaignIndex, i);
expect(g.solved, 2);
expect(store.text('grid_story_v1_$i'), startsWith('1'));
}
}
final g = Game(book, Progress.memory());
for (var i = 0; i < book.pages.length; i++) {
g.showStory(i);
final restored = Game(book, Progress.memory(g.progress.snapshot));
await restored.restore();
expect(restored.storyPage.id, book.pages[i].id);
}
g.leaveCottage();
expect(g.screen, Screen.briefing);
expect(g.campaignIndex, 4);
expect(g.solved, 0);
g.contents(1);
final restored = Game(book, Progress.memory(g.progress.snapshot));
await restored.restore();
expect(restored.contentsChapter, 1);
},
);
test('Dart generation matches 40 Java reference boards including signed 64-bit seeds', () { test('Dart generation matches 40 Java reference boards including signed 64-bit seeds', () {
final fixtures = jsonDecode( final fixtures = jsonDecode(
File('test/fixtures/java_boards.json').readAsStringSync(), File('test/fixtures/java_boards.json').readAsStringSync(),
@@ -167,18 +279,18 @@ void main() {
g.mark(0); g.mark(0);
final marks = List<int>.of(g.cells); final marks = List<int>.of(g.cells);
g.reveal(2, readAhead: true); g.reveal(2, readAhead: true);
expect(g.screen, Screen.reveal); expect(g.screen, Screen.story);
expect(g.recovered(2), false); expect(g.recovered(2), false);
expect(g.solved, 0); expect(g.solved, 0);
final restored = Game(g.book, Progress.memory(store.snapshot)); final restored = Game(g.book, Progress.memory(store.snapshot));
await restored.restore(); await restored.restore();
expect(restored.screen, Screen.reveal); expect(restored.screen, Screen.story);
expect(restored.campaignIndex, 2); expect(restored.campaignIndex, 2);
expect(restored.solved, 0); expect(restored.solved, 0);
restored.startCampaign(2); restored.startCampaign(2);
expect(restored.cells, marks); expect(restored.cells, marks);
restored.reveal(5, readAhead: true); restored.reveal(5, readAhead: true);
expect(restored.screen, Screen.briefing); expect(restored.screen, Screen.story);
expect(restored.campaignIndex, 2); expect(restored.campaignIndex, 3);
}); });
} }
+175 -5
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:lumen/domain/book.dart'; import 'package:lumen/domain/book.dart';
import 'package:lumen/domain/game.dart'; import 'package:lumen/domain/game.dart';
@@ -9,12 +10,177 @@ import 'package:lumen/ui/board.dart';
import 'package:lumen/ui/paper.dart'; import 'package:lumen/ui/paper.dart';
void main() { void main() {
testWidgets(
'object illustrations remain hidden until their own pattern is solved',
(tester) async {
tester.view.physicalSize = const Size(600, 960);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final book = (await tester.runAsync(Book.load))!;
final game = Game(book, Progress.memory({'story_access_level': 11}));
game.showStory(0);
await tester.pumpWidget(LumenApp(game: game, adsEnabled: false));
await tester.pumpAndSettle();
void expectHidden() {
for (final level in book.levels) {
expect(
find.image(AssetImage(level.illustrationAsset!)),
findsNothing,
);
}
expect(find.byType(PixelPicture), findsNothing);
}
for (var i = 0; i < 12; i++) {
game.reveal(i, readAhead: true);
await tester.pumpAndSettle();
expectHidden();
expect(game.solved, 0);
}
for (final index in [5, 6, 9, 12, 15]) {
game.showStory(index);
await tester.pumpAndSettle();
expectHidden();
}
game.showStory(book.pageFor(1, StoryPageType.puzzle));
final solution = List<int>.of(game.puzzle!.solution);
for (var c = 0; c < solution.length; c++) {
while (game.cells[c] != (solution[c] == 1 ? 1 : 2)) {
game.mark(c);
}
}
await tester.pumpAndSettle();
expect(
find.image(AssetImage(book.levels[1].illustrationAsset!)),
findsOneWidget,
);
game.showStory(5);
await tester.pumpAndSettle();
expectHidden();
game.reveal(2, readAhead: true);
await tester.pumpAndSettle();
expectHidden();
expect(game.solved, 1);
final restarted = Game(book, Progress.memory(game.progress.snapshot));
await restarted.restore();
expect(restarted.recovered(1), true);
expect(restarted.recovered(2), false);
expect(tester.takeException(), isNull);
await tester.pumpWidget(const SizedBox());
},
);
testWidgets('completed saves never put discovery art on earlier leaves', (
tester,
) async {
tester.view.physicalSize = const Size(600, 960);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
final book = (await tester.runAsync(Book.load))!;
final game = Game(
book,
Progress.memory({
for (var i = 0; i < 12; i++) 'done_story_v1_$i': true,
'notebook_handle_seen': true,
}),
);
game.showStory(0);
await tester.pumpWidget(LumenApp(game: game, adsEnabled: false));
await tester.pumpAndSettle();
for (var i = 0; i < book.pages.length; i++) {
game.showStory(i);
await tester.pumpAndSettle();
final page = book.pages[i];
for (var object = 0; object < 12; object++) {
expect(
find.image(AssetImage(book.levels[object].illustrationAsset!)),
page.type == StoryPageType.memory && page.campaignIndex == object
? findsOneWidget
: findsNothing,
reason: '${page.id} must not reveal object $object before its puzzle',
);
}
expect(find.byType(PixelPicture), findsNothing);
expect(tester.takeException(), isNull);
}
await tester.pumpWidget(const SizedBox());
});
testWidgets('all cottage leaves turn, offer hints and fit larger text', (
tester,
) async {
addTearDown(tester.view.reset);
await tester.runAsync(() async {
final font = FontLoader('MaraHand')
..addFont(rootBundle.load('assets/fonts/DancingScript.ttf'));
await font.load();
});
final book = (await tester.runAsync(Book.load))!;
for (final size in [const Size(360, 640), const Size(960, 600)]) {
tester.view.physicalSize = size;
tester.view.devicePixelRatio = 1;
final g = Game(book, Progress.memory());
g.showStory(0);
await tester.pumpWidget(
MaterialApp(
home: MediaQuery(
data: MediaQueryData(
size: size,
textScaler: const TextScaler.linear(1.5),
),
child: Notebook(game: g, adsEnabled: false),
),
),
);
await tester.pumpAndSettle();
for (var i = 0; i < book.pages.length; i++) {
expect(g.storyIndex, i);
final page = book.pages[i];
if (page.type == StoryPageType.puzzle) {
final before = List<int>.of(g.cells);
final hint = find.text('Hint · free');
await tester.ensureVisible(hint);
await tester.pumpAndSettle();
await tester.tap(hint);
await tester.pumpAndSettle();
expect(g.cells, isNot(before), reason: page.id);
await tester.tap(find.text('Keep going'));
await tester.pumpAndSettle();
}
final next = find.text(
i == book.pages.length - 1 ? 'Across the tide →' : 'Next leaf →',
);
expect(next.hitTestable(), findsOneWidget, reason: page.id);
await tester.tap(next);
await tester.pumpAndSettle();
if (page.type == StoryPageType.puzzle) {
await tester.tap(find.text('Read ahead'));
await tester.pumpAndSettle();
}
expect(g.solved, 0);
expect(tester.takeException(), isNull, reason: page.id);
}
expect(g.screen, Screen.briefing);
expect(g.campaignIndex, 4);
g.contents(0);
await tester.pumpAndSettle();
expect(find.text('I · The keeper’s cottage'), findsOneWidget);
expect(find.text('2 · Something to carry the flame'), findsOneWidget);
expect(tester.takeException(), isNull);
await tester.pumpWidget(const SizedBox());
await tester.pumpAndSettle();
}
});
testWidgets('campaign discoveries use bundled art with a pixel fallback', ( testWidgets('campaign discoveries use bundled art with a pixel fallback', (
tester, tester,
) async { ) async {
addTearDown(tester.view.reset); addTearDown(tester.view.reset);
final book = (await tester.runAsync(Book.load))!; final book = (await tester.runAsync(Book.load))!;
final g = Game(book, Progress.memory({'story_access_level': 11})); final g = Game(
book,
Progress.memory({
'story_access_level': 11,
for (var i = 0; i < 12; i++) 'done_story_v1_$i': true,
}),
);
expect(book.levels.every((l) => l.illustrationAsset != null), true); expect(book.levels.every((l) => l.illustrationAsset != null), true);
for (final size in [const Size(360, 640), const Size(960, 600)]) { for (final size in [const Size(360, 640), const Size(960, 600)]) {
tester.view.physicalSize = size; tester.view.physicalSize = size;
@@ -40,12 +206,16 @@ void main() {
expect(find.byType(PixelPicture), findsNothing); expect(find.byType(PixelPicture), findsNothing);
await tester.ensureVisible(art); await tester.ensureVisible(art);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
expect(tester.getSize(art).height, 190); expect(tester.getSize(art).height, index < 4 ? 155 : 190);
} else { } else {
expect(find.byType(PixelPicture), findsOneWidget); expect(find.byType(PixelPicture), findsOneWidget);
} }
final next = find.text( final next = find.text(
index == 11 ? 'Return to the notebook' : 'Turn the page →', index < 4
? 'Next leaf →'
: index == 11
? 'Return to the notebook'
: 'Turn the page →',
); );
await tester.ensureVisible(next); await tester.ensureVisible(next);
await tester.pumpAndSettle(); await tester.pumpAndSettle();
@@ -84,7 +254,7 @@ void main() {
'clues': original.clues, 'clues': original.clues,
'areas': original.areas, 'areas': original.areas,
}); });
final game = Game(book, Progress.memory()); final game = Game(book, Progress.memory({'done_story_v1_0': true}));
game.reveal(0, readAhead: true); game.reveal(0, readAhead: true);
await tester.pumpWidget(LumenApp(game: game, adsEnabled: false)); await tester.pumpWidget(LumenApp(game: game, adsEnabled: false));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
@@ -280,7 +450,7 @@ void main() {
greaterThan(lastCell.right), greaterThan(lastCell.right),
); );
expect(find.text('Hint · free'), findsOneWidget); expect(find.text('Hint · free'), findsOneWidget);
expect(find.text('Back to notebook'), findsOneWidget); expect(find.text('Next leaf →'), findsOneWidget);
expect(tester.takeException(), isNull); expect(tester.takeException(), isNull);
// The opening notebook's puzzle leaf uses the same two columns, with the // The opening notebook's puzzle leaf uses the same two columns, with the