Save adventure location with team and inventory
This commit is contained in:
16 files changed
+444
-203
No files matched your search
@@ -59,7 +59,8 @@ Those numbers mean red, green, and blue, each from 0 to 31. Try `RGB(29, 6, 6)`
|
||||
- `source/world.c`: movement, collisions, doors, map travel, and following.
|
||||
- `source/actors.c`: character and creature artwork and drawing.
|
||||
- `source/battle.c`: species, battle rules, and the battle screen.
|
||||
- `source/story.c`: conversations, gifts, and cartridge SRAM saves.
|
||||
- `source/story.c`: conversations and gifts.
|
||||
- `source/save.c`: versioned cartridge SRAM records and validation.
|
||||
- `source/hud.c`: map status, scene drawing, and the team screen.
|
||||
- `source/menu.c`: Save / Close sidebar input and drawing.
|
||||
- `source/audio.c` and `source/audio.h`: original chiptune scores and the GBA sound-channel sequencer.
|
||||
@@ -80,11 +81,15 @@ Sprite artwork is decoded once into cached palette indices. Character and creatu
|
||||
|
||||
Movement has a separate 60 Hz fixed-step clock using cascaded GBA timers 2 and 3, independent of rendering. Walking is two pixels per tick (120 pixels/second), with normalized diagonal speed. Every pixel is collision-checked and recorded for Sprout and grass encounters, so faster movement does not skip walls or map exits or double the following distance. Missed updates can catch up by at most five ticks; older backlog is dropped after a long stall. Menus, conversations, battles, and map-loading time do not build up movement backlog. The existing footstep artwork is unchanged, with its phase now clocked by simulation ticks rather than rendered frames.
|
||||
|
||||
## Saving your partner and items
|
||||
## Saving your adventure
|
||||
|
||||
Only choosing **Save** in the Start sidebar writes cartridge SRAM, stored by mGBA alongside the ROM as `game.sav`. Gifts, throwing balls (successful or failed, including battle losses), and partner selection change the current session only. Save manually before closing or resetting the emulator; otherwise reload restores your last saved state, including previously unspent balls and unclaimed gifts. Keep `game.sav` to retain Sprout ownership, Finn's gift flag, remaining balls, the rod, caught species and your selected partner. There are no startup, exit, or gameplay autosaves. Your map, position and battle state are not saved; partners recover after battles.
|
||||
Only choosing **Save** in the Start sidebar writes cartridge SRAM, stored by mGBA alongside the ROM as `game.sav`. Save retains Sprout ownership, Finn's gift flag, remaining balls, the rod, caught species, your selected partner, map, position and facing. Gifts, throwing balls (successful or failed, including battle losses), partner selection, walking and map changes affect the current session only until you choose Save. There are no startup, exit, or gameplay autosaves. Battle state, health, conversations, open doors, follower trail, movement timing and music mute are not saved; partners recover after battles.
|
||||
|
||||
The sidebar states **TEAM AND / ITEMS ONLY / NO LOCATION**. **GAME / SAVED** means the complete v5 cartridge record was written and read back, not that mGBA has flushed it to disk. **SAVE / FAILED** means validation or read-back failed. Invalid in-memory state is rejected before writing; a read-back failure or interrupted write does not restore the previous record. Close mGBA normally. Existing v1/v2/v3/v4 saves still load; older formats default newly introduced fields appropriately. Save writes the unchanged v5 format. Do not reopen that save with an old v1/v2-only ROM: it cannot load v5 and could overwrite your newer progress.
|
||||
The sidebar states **SAVES TEAM / ITEMS AND / LOCATION**. **GAME / SAVED** means the complete v6 cartridge record was written and read back, not that mGBA has flushed it to disk. **SAVE / FAILED** means validation or read-back failed. Invalid in-memory progress or location is rejected before writing. The single record uses CRC-16/CCITT-FALSE to detect corruption, not guarantee recovery or atomicity: interrupted writes or read-back failures can lose the previous record. Close mGBA normally, then reopen the same ROM without loading an emulator save state to check persistence. Preserve backups and use disposable ROM/save copies when testing.
|
||||
|
||||
Existing v1–v5 saves still load without changing their bytes; newly introduced fields receive defaults. These saves start outside in Greenleaf Village at (108,103), facing down. A v6 record with valid integrity and progress but an invalid/outdated location retains progress and uses that same default spawn. Invalid integrity, invalid progress or an unknown version rejects the whole record and starts with empty progress at the default spawn, without repairing or overwriting stored bytes. Only explicit Save writes/upgrades to v6. **Older builds cannot read v6**; do not use them with a newer save, as a subsequent save could overwrite your progress.
|
||||
|
||||
The v6 format is 19 bytes: `FQSP` (0–3), version 6 (4), v5 flags (5: Sprout bit 0, balls gift bit 1, rod bit 2, active member bits 3–5), ball count (6), caught count (7), five species IDs/unused `FF` (8–12), room (13), facing (14), x (15), y (16), then CRC high/low bytes (17–18). CRC covers bytes 0–16 with initial `FFFF`, polynomial `1021`, no reflection or final XOR. Byte 0 is invalidated first and committed as `F` last. Persistent room IDs are Outside 0, Cottage 1, Route 2, Mellon Garden 3, Mellon House 4, Beach 5; facing IDs are down 0, up 1, left 2, right 3. These IDs must not be reordered or reused.
|
||||
|
||||
The ROM uses homebrew game code `QST0`. The previous `FQ01` collided with mGBA 0.10.5's Classic NES detection, which forced EEPROM instead of SRAM.
|
||||
|
||||
@@ -125,4 +130,4 @@ We are making an original game. No existing Pokémon ROM or separate BIOS downlo
|
||||
|
||||
Greenleaf Village connects south to Sunpetal Trail and east to Professor Mellon's garden and house. Seashell Beach is south of the garden, with a return path north. Both houses have working doors. Mila and the professor have conversations, and Mellon gives you Sprout once. Ranger Finn gives you five usable Poké Balls. Sprout follows your footsteps and battles the village's golden creature and three wild route species. Battles support two moves, species-specific replies, health bars, catching, victory, defeat, running away, and free recovery. The team screen lets you browse up to six members; use the Start sidebar to save your team and items.
|
||||
|
||||
All artwork and music are original; no Pokémon game assets or ROMs are included. Experience, mid-battle partner switching, sound effects, and full progress saving are not implemented yet.
|
||||
All artwork and music are original; no Pokémon game assets or ROMs are included. Experience, mid-battle partner switching and sound effects are not implemented yet.
|
||||
Reference in new issue
Block a user