A new game now runs NewGame's InitGender and OakSpeech natively before the bedroom: Boy or Girl, InitClock's hour and minute steppers with their YES/NO confirmations, Oak's speech with Wooper, and NamePlayer's preset names or naming field (a blank name takes CHRIS or KRIS). Texts, menus and time strings come from a new INTRO profile table verified by check:reference; Oak's and the player's pictures decode from TrainerPicPointers, ChrisPic/KrisPic and TrainerPalettes. The chosen time is kept as a minute offset from the device clock, which time of day, the weekday, NPC hours and the daily reset now read. The intro runs only when nothing is saved; a save made during it starts it again. Saves gain intro and clock.minuteOffset, migrated by absence. The shell's name and character fields are gone. Intentional change: the steppers start at the device time rather than 10:00. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5a0fe1e313
commit
b13fd20be4
28 files changed
+975
-101
No files matched your search
@@ -34,7 +34,7 @@ flowchart LR
|
||||
| `src/reference`, `src/emulator` | Original-game reference, excluded from the native build |
|
||||
| `reference/public` | Licensed emulator files for the reference build only |
|
||||
|
||||
`GameRuntime` is a lifecycle interface, not an emulator contract. Native state is validated JSON, schema version 3. It holds the map, position, facing, name/avatar, player ID and in-game tile count; event and engine flags and sprite variables; scene values, phone contacts, a queued special call, the rival's name, the weekday offset and DST flag; positions of objects that scripts moved; and the party, bag, Pokédex sets, money and room decoration slots. Older saves without decorations migrate to the original bed and Town Map poster. Decoration imports validate slot categories, ownership and unique doll placement. Early version-3 backups without a money field migrate to the starting balance. It contains no graphics, music, dialogue, GB memory or ROM bytes. Versions 1 and 2 migrate with new-game defaults. Party Pokémon are validated by recomputing their stats from the ROM. The backup envelope retains the historical `coreId` field; native backups use it for their runtime/schema ID.
|
||||
`GameRuntime` is a lifecycle interface, not an emulator contract. Native state is validated JSON, schema version 3. It holds the map, position, facing, name/avatar, player ID and in-game tile count; event and engine flags and sprite variables; scene values, phone contacts, a queued special call, the rival's name, the game clock's minute offset, the weekday offset and DST flag, whether the introduction is still pending; positions of objects that scripts moved; and the party, bag, Pokédex sets, money and room decoration slots. Older saves without decorations migrate to the original bed and Town Map poster. Decoration imports validate slot categories, ownership and unique doll placement. Early version-3 backups without a money field migrate to the starting balance. It contains no graphics, music, dialogue, GB memory or ROM bytes. Versions 1 and 2 migrate with new-game defaults. Party Pokémon are validated by recomputing their stats from the ROM. The backup envelope retains the historical `coreId` field; native backups use it for their runtime/schema ID.
|
||||
|
||||
Saves made during an unfinished walk or jump retain its source tile and completed step count, so loading cannot skip a landing event or map transition. Directional mats wait for exit input; doors, stairs and caves force an animated downward step after arrival.
|
||||
|
||||
@@ -59,6 +59,10 @@ copy and a revision counter, so rollback and the minimap see the same terrain.
|
||||
Surf, Cut and Strength use the ROM scripts. Start/Select opens the Key Items
|
||||
menu, pausing overworld ticks while choosing the Bicycle. The bedroom PC edits
|
||||
decorations on the script draft and reloads the room when the menu commits.
|
||||
`scripts/intro.ts` runs a new game's introduction as a native generator on a
|
||||
script draft; the session starts it only when nothing is saved, and the name,
|
||||
gender and clock offset commit when it ends. `GameWorld` reads a game clock:
|
||||
the device time plus that offset.
|
||||
`scripts/pc.ts` runs the Pokémon Center and house PCs on the same draft, so a
|
||||
refused step leaves boxes and items unchanged. `party/storage.ts` holds the
|
||||
boxes and the PC's items. A `memscript` effect queues Bill's call (like
|
||||
|
||||
+16
-3
@@ -34,7 +34,7 @@ The numbered sections below keep their full scope. Each one opens with a checkli
|
||||
- Native canvas rendering, camera scrolling, walking, solid-tile/NPC collision, doors and stairs within the supported area.
|
||||
- A bounded interpreter for a subset of the game's own event bytecode, plus text decoding. This does not execute GB instructions.
|
||||
- Original initial event flags, readable signs, bedroom radio, bookshelves and supported conversations. Unknown interactions abort without committing partial changes.
|
||||
- Native DOM dialogue, name/avatar choice, touch/keyboard controls and pause/resume.
|
||||
- Native DOM dialogue, name/avatar choice, touch/keyboard controls and pause/resume. (The name and character are now chosen in the introduction; see below.)
|
||||
- A minimal Crystal-style shell with Game, Savegames, Map, Pokédex, Link and Friends tabs across the top. The game uses the available native canvas, and leaving Game releases input and pauses play.
|
||||
- Existing save, backup export and backup import actions in Savegames. Map shares a live local minimap with the game and shows the current supported area, player position and coordinates. Pokédex, Link and Friends are clearly marked as planned rather than populated with placeholder data.
|
||||
- Native JSON state inside the backup envelope, separate IndexedDB storage and a separate tab lock. No emulator snapshot or cartridge save migration is implied.
|
||||
@@ -133,6 +133,19 @@ The numbered sections below keep their full scope. Each one opens with a checkli
|
||||
- Not ported: MOVE PKMN W/O MAIL and the stats screen (both show a notice and return to the menu), printing, a `givepoke` with a full party (refused; no open map reaches it) and the tutorial with a full party and box (the original repeats the unusable ball). Changing boxes does not show the save messages; the native session saves continuously.
|
||||
- Next: the introduction's naming and clock screens, player switching and other items in battle, then party and bag menus.
|
||||
|
||||
## Implemented: the introduction's naming and clock screens
|
||||
|
||||
- A new game runs `NewGame`'s `InitGender` and `OakSpeech` natively before the bedroom: "Boy"/"Girl" (B disabled), `InitClock`, Oak's speech with Wooper, then `NamePlayer`. Texts, menu items, the preset names, the naming title and the time strings come from the ROM (`INTRO` table in the profile, verified by `check:reference`).
|
||||
- `InitClock`: the hour and minute steppers wrap as `SetHour` and `SetMinutes` do, each confirmed with YES/NO; NO asks again. Labels follow `PrintHour` ("DAY 5 o'clock"), and `OakText_ResponseToSetTime` keeps its `DAY_HOUR + 1` comparison, so 10 AM still "overslept".
|
||||
- The chosen time is stored as a minute offset from the device clock (the shortest one, within ±12 hours). Time of day, the weekday, NPC hours and the daily reset all read this game clock. Mom's `SetDayOfWeek` offset is taken from the game clock's day.
|
||||
- `NamePlayer`: NEW NAME opens the naming field; a blank name takes CHRIS or KRIS, as `InitName` does. The other items are the gender's preset names.
|
||||
- Oak's picture decodes `TrainerPicPointers` through `FixPicBank`; the player's is the uncompressed `ChrisPic`/`KrisPic`. Both use `TrainerPalettes` (Chris class 0, Kris class 1), as `DrawIntroPlayerPic` sets them.
|
||||
- The intro covers the world and its minimap until it ends. It runs only when no session is saved. A save made during it keeps `intro: true`, and loading that save starts it again. The Game tab's name and character fields are gone.
|
||||
- Save format 3 gained `intro` and `clock.minuteOffset`, migrated by absence to a finished intro on the device clock.
|
||||
- Intentional change: the steppers start at the device's current time rather than 10:00, so confirming keeps the device clock.
|
||||
- Not presented: the palette fades, Wooper's cry, the picture slide during name selection, `ShrinkPlayer` and the Route 30 music (no audio yet).
|
||||
- Next: player switching and other items in battle; MOVE PKMN W/O MAIL and the stats screen with the party menu; a continuous opening playthrough.
|
||||
|
||||
## Native battles: current state
|
||||
|
||||
The battle core, ROM tables, encounter hooks, battle UI and whiteout hooks are present. Unit tests cover wins, escape, loss, experience, move learning and capture; reference tests compare damage and type effectiveness. Browser tests drive a test-only wild encounter through the real UI: victory with level-up and move learning, escape, whiteout, catching with a nickname, keyboard and on-screen D-pad menu navigation, mid-battle backup restore, and rollback of unsupported effects. Real Route 29 encounters now use the ROM's encounter tables. Player switching and items other than balls in battle remain unfinished.
|
||||
@@ -205,7 +218,7 @@ their scripts and story progression are supported.
|
||||
- [x] Battles: stats, damage, types, accuracy, criticals, status, turn order, fainting, experience, move learning, trainer AI, trainer send-outs and prize money
|
||||
- [ ] Player switching, and items other than balls, in battle
|
||||
- [x] The PC and boxes (catching with a full party)
|
||||
- [ ] The introduction's naming and clock screens
|
||||
- [x] The introduction's naming and clock screens
|
||||
- [ ] Controlled-seed comparisons with the original beyond damage and type effectiveness
|
||||
- [ ] Acceptance: one continuous playthrough of the opening quest with save/reload. The scenes are tested individually from fixtures so far.
|
||||
|
||||
@@ -213,7 +226,7 @@ Introduce native player, party, Pokémon, inventory, money and quest models. Rea
|
||||
|
||||
Expand script calls, choices, scene state, inventory commands and native special handlers. Translate routines reached through assembly calls into explicit native services; never fall back to emulator execution in the shipping game.
|
||||
|
||||
Meeting Mom, Elm's introduction, the starter, the aide's Potion, Route 29, Cherrygrove, Route 30's trainers, Mr. Pokémon's house, the Cherrygrove rival battle, the return to Elm, capture, the catching tutorial and the PC run now. Next: the introduction's naming and clock screens.
|
||||
Meeting Mom, Elm's introduction, the starter, the aide's Potion, Route 29, Cherrygrove, Route 30's trainers, Mr. Pokémon's house, the Cherrygrove rival battle, the return to Elm, capture, the catching tutorial, the PC and the introduction's naming and clock screens run now. Next: player switching and other items in battle.
|
||||
|
||||
Complete and validate the native battle engine: deterministic randomness, stats, move selection, accuracy/critical checks, damage, status, turn order, switching, fainting, experience, capture and rewards. Compare controlled seeds and states with the original, including integer rounding and overflow behavior.
|
||||
|
||||
|
||||
+37
-1
@@ -1,6 +1,6 @@
|
||||
# Recovered Claude session
|
||||
|
||||
Latest continuation: see **The PC and boxes: 2026-09-25** at the end of
|
||||
Latest continuation: see **The introduction's naming and clock: 2026-09-25** at the end of
|
||||
this file. Earlier sections are historical snapshots.
|
||||
|
||||
Recovered on 2026-09-23 from the local Claude Code transcript
|
||||
@@ -475,3 +475,39 @@ Not committed.
|
||||
Next (PLAN section 2): the introduction's naming and clock screens; player
|
||||
switching and non-ball items in battle; MOVE PKMN W/O MAIL and the stats
|
||||
screen with the party menu; a continuous opening playthrough.
|
||||
|
||||
## The introduction's naming and clock: 2026-09-25
|
||||
|
||||
The PC increment above was committed as `3bdca00`. This increment finishes
|
||||
the next open item of PLAN section 2.
|
||||
|
||||
- `scripts/intro.ts` (`IntroRun`): `InitGender`, `OakSpeech` with
|
||||
`InitClock` and `NamePlayer`, as a native generator the world runs like a
|
||||
script (`GameWorld.beginIntro`). Texts, menus, preset names and time
|
||||
strings come from the ROM through a new `INTRO` profile table verified by
|
||||
`check:reference`.
|
||||
- New effects: `portrait` (Oak's trainer picture or the player's, decoded
|
||||
by `PokemonData.trainerPic`, `playerPic` and `trainerPalette`) and a
|
||||
`clock` stepper choice.
|
||||
- Game clock: `clock.minuteOffset` is added to the device time for time of
|
||||
day, weekday, NPC hours and the daily reset. The host's `deviceWeekday`
|
||||
became `clockDay`.
|
||||
- `GameSession.load` calls the runtime's optional `newGame()` when nothing
|
||||
is saved. Saves gained `intro` (true while pending; a save made then
|
||||
restarts the introduction). The shell's name/character fields are gone.
|
||||
- Browser fixture specs strip `this.world?.beginIntro();` from the served
|
||||
runtime, since their worlds stand in for saved sessions. Fresh-load tests
|
||||
play the intro with `tests/intro-driver.ts`.
|
||||
|
||||
Not presented: palette fades, Wooper's cry, the picture slide while
|
||||
naming, `ShrinkPlayer` and music. Intentional change: the steppers start at
|
||||
the device time instead of 10:00.
|
||||
|
||||
Checks: 298 unit tests with the local ROM; native and reference builds;
|
||||
reference, vendor and release checks; `git diff --check`; 87
|
||||
Chromium/WebKit browser tests passed, 19 skipped intentionally (including
|
||||
the new intro flow and a reload during it, in both browsers). Not committed.
|
||||
|
||||
Next (PLAN section 2): player switching and non-ball items in battle; MOVE
|
||||
PKMN W/O MAIL and the stats screen with the party menu; a continuous opening
|
||||
playthrough.
|
||||
Reference in new issue
Block a user