Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Savefile Editing #6

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 120 additions & 0 deletions doc/rooms.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
Room ID,Name,Location ID,Variant,Description,Exits to,Image variants
1,Drawbridge,1,,First room in the game,4,
2,Village Square,2,,The clock tower area,"3, 4, 5, 6, 16, 87",some cut content
3,Manor Road,3,,"Right of the Village Square, where Marco stands","2, 7, 11",
4,Entrance,4,,"Right after the Drawbridge, where the Inn is","1, 2, 8, 15",
5,Park Road,5,,"Left of the Village Square, where the angry guy stands","2, 9, 10",
6,Village Hall,6,,Right door on the Village Square,2,
7,Village Shop,7,,Blue door on Manor Road,3,
8,Inn,8,,,"4, 23",
9,Restaurant,9,,"On Park Road, where Crouton works",5,~n: nighttime (cut content)
10,Park Gate,10,,,5,
11,Manor Border,11,,The river where Ramon stands,"3, 14",
12,Manor Foyer,12,,,"13, 14",~_o: bookshelf opened
13,Manor Parlour,13,,,12,~n: nighttime (cut content)
14,Reinhold Manor,14,,Before the entrance,"12, 11",
15,Drawbridge,15,Let down,Only very briefly visible: drawbridge let down,4,
16,Clock Tower,16,,Behind it,"2, 17",
17,Fork in the Road,17,,,"16, 18, 19",
18,Market,18,,Left of the Fork in the Road,"17, 20",
19,Northern Path,19,,Right of the Fork in the Road,"17, 20",
20,Northern Hill,20,,,"18, 19",
21,Village Square,2,Nighttime,,"22, 23, 24, 26, 87",
22,Manor Road,3,Nighttime,,"11, 21",
23,Entrance,4,Nighttime,,"8, 21",
24,Park Road,5,Nighttime,,"21, 25",
25,Park Gate,10,Nighttime,,24,
26,Clock Tower,16,Nighttime,,"21, 27",
27,Fork in the Road,17,Nighttime,,"26, 28, 29, 31",
28,Market,18,Nighttime,,"27, 30",
29,Northern Path,19,Nighttime,,"27, 30, 32",
30,Northern Hill,20,Nighttime,,"28, 29",
31,Crumm's Cafe,31,,On the Fork in the Road,27,
32,Prosciutto's,32,,On the Northern Path,29,
33,Archibald's,33,,On the Clock Tower lil plaza thing,48,
34,Village Square,2,Day 2,,"35, 36",
35,Manor Road,3,Day 2,,"34, 39, 43",
36,Entrance,4,Day 2,,"34, 40",
37,Park Road,5,Day 2,,"34, 41, 42",
38,Village Hall,6,Day 2,,34,
39,Village Shop,7,Day 2,,35,
40,Inn,8,Day 2/?,,"36, 96",
41,Restaurant,9,Day 2,,37,
42,Park Gate,10,Day 2,,"37, 53","~_o: gate open, ~_o2: gate open and ferris wheel destroyed"
43,Manor Border,11,Day 2,What happens if you define the same exit twice?,"35, 46",
44,Manor Foyer,12,Day 2,,"45, 46",
45,Manor Parlour,13,Day 2,,"44, 116",
46,Reinhold Manor,14,Day 2,,"43, 44",
47,Drawbridge,1,Day 2,,36,
48,Clock Tower,16,Day 2,,"33, 34, 49",
49,Fork in the Road,17,Day 2,"room_49_bg is a 6x4 grid of squares, seems to be technical","48, 50, 51",
50,Market,18,Day 2,,"49, 52, 64",
51,Northern Path,19,Day 2,,"49, 52, 118",
52,Northern Hill,20,Day 2,,"50, 51",
53,Park Path Fork,53,,First room in the park,"54, 56, 59, 102",b_~: destroyed
54,Abandoned Tent,54,,Left of the Park Path Fork,"53, 55",
55,Ferris Wheel,55,,,"54, 57",
56,Shack Path,56,,,"53, 57, 60",b_~: destroyed
57,Waterside Shack,57,,,"55, 56",
58,Ferris Wheel,55,Destroyed,,"59, 60",room_58_bg
59,Abandoned Tent,54,Destroyed,,"53, 58",room_59_bg
60,Waterside Shack,57,Destroyed,,"56, 58, 61",room_60_bg
61,Under the Shack,61,,,"60, 62",
62,Underground Path,62,,,"61, 63",
63,Underground Area,63,,The final room under the Waterside Shack,62,
64,Path Entrance,64,,Behind the Market,"65, 110",
65,Tower Road,65,,,"64, 66, 67",
66,Dead End,66,,Before opening,65,
67,Dead End,66,Opened,,"65, 68",room_67_bg
68,Tower Entrance,68,,The Gate at the bottom,"67, 70",
69,Tower Cellar,69,,The room where you crash land and meet Bruno,70,
70,Tower Floor 1,70,,"Ground level, for non-americans. Right behind the Entrance.","68, 69, 71",
71,Tower Floor 2,71,,,"70, 72",
72,Tower Floor 3,72,,,"71, 73",
73,Tower Floor 4,73,,,"72, 74",
74,Tower Floor 5,74,,,"73, 75",
75,Tower Floor 6,75,,,"74, 76",
76,Tower Floor 7,76,,,"75, 77",
77,Spiral Staircase,77,,,"76, 78",
78,Tower Top Floor,78,,,"77, 79",
79,Flora's Room,79,,Can never actually be visited as a room in the game; the in-script does all the work,,
80,Tower Top Floor,78,???,,"77, 79",
81,Village Square,2,Epilogue,"Never actually visitable, but copies the default room image. The special image is the setting of the epilogue, with the tower gone.",87,
82,,---,,,,
83,,---,,"The Reinhold Fortune treasure room, but only as an image.",,
84,Archibald's,33,Desk,A close-up of Archibald's desk,33,
85,Manor Parlour,85,???,,"12, 89",room_13_bg
86,,---,,"Viola's Grave. This isn't actually a room, but the image being called this implies that it was at some point.",,
87,Granny R.'s,87,,"Granny Riddleton's Cottage, outside (Nazobaba)","2, 21, 34, 88, 94",
88,Puzzle Shack,88,,Inside of Granny Riddleton's Cottage,87,
89,Dahlia's Room,89,,,"13, 45, 85",
90,Sewer,90,,Down the manhole on Park Road,"5, 91, 92, 97",
91,Sewer Dead End,91,,Right of the Sewer entrance,90,
92,Sewer Exit,92,,Left of the Sewer entrance,"90, 93",
93,Outside the Sewer,93,,"Behind Sewer Exit, different view on the Laytonmobile",92,
94,Village Square,2,Postgame,,"87, 95, 96, 97, 98, 108",
95,Manor Road,3,Postgame,,"94, 99, 103",
96,Entrance,4,Postgame,,"94, 100, 107",
97,Park Road,5,Postgame,,"90, 94, 101, 102",
98,Village Hall,6,Postgame,,94,
99,Village Shop,7,Postgame,"room_99_bg is a 6x4 grid of squares, seems to be technical",95,
100,Inn,8,Postgame,,96,
101,Restaurant,9,Postgame,,97,
102,Park Gate,10,Postgame,,"53, 97",
103,Manor Border,11,Postgame,,"95, 106",
104,Manor Foyer,12,Postgame,,"105, 106",
105,Manor Parlour,13,Postgame,,"89, 104, 116",
106,Reinhold Manor,14,Postgame,,"103, 104",
107,Drawbridge,1,Postgame,,96,
108,Clock Tower,16,Postgame,,"94, 109, 115",
109,Fork in the Road,17,Postgame,,"108, 110, 111, 113",
110,Market,18,Postgame,,"64, 109, 112",
111,Northern Path,19,Postgame,,"109, 112, 114",
112,Northern Hill,20,Postgame,,"110, 111",
113,Crumm's Cafe,31,Postgame,,109,
114,Prosciutto's,32,Postgame,,111,
115,Archibald's,33,Postgame,,108,
116,Dahlia's Room,89,Day 2/Postgame,,"13, 45, 85, 105",
117,Crumm's Cafe,31,???,Cafe might have been open on Day 2 at some point,49,
118,Prosciutto's,32,Day 2,,51,
119,Flora's Portrait,119,,Used for the final minigame
Binary file added doc/sample_file.sav
Binary file not shown.
122 changes: 122 additions & 0 deletions doc/savefile.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
# Savefile Format documentation (for LT1 EU)

**Total length:** 0x2000 (8192)

## Header

**Starts at:** 0
**Length:** 0x150 (336)

```
0x000 w: hash of the following data
0x004 b[14]: magic word "ATAMFIREBELLNY"
0x012 ?x2
0x014 b: current / last saved file
0x015 b[3]: file present? (bool)
0x018 b[64][3]: current location name (or "NO DATA")
0x0d8 w[3]: playtimeMinutes
0x0e4 w[3]: playtimeHours
0x0f0 w[3]: puzzlesDiscovered
0x0fc w[3]: puzzlesSolved
0x108 b[20][3]: savefile name (or 0x81f4838f8393837b81f4, which decodes to "♪ワンボ♪" in SHIFT-JIS)
0x144 b[3]: savefile cleared? (bool)
0x147 ?x9
```

**Padding:** 0x150 to 0x3e8, filled with 0xff

## Savefiles

**Starts at:** 0x3e8 (1000), 0xbb8 (3000), 0x1388 (5000)
**Length:** 0x7d0 (2000)

If a file is not present, this region is filled with 0xff instead.

```
0x000 b: current puzzle ID (internal)
0x001 b: current room ID
0x002 b: current puzzle solved? (bool)
0x003 b: current puzzle should be retried? (bool)
0x004 b: current puzzle was aborted without solving? (bool)
0x005 ?
0x006 ?
0x007 ?
0x008 b: puzzle win image
0x009 b: current script type
0x00a b: return script type (when script type is eg PUZZLE, a puzzle will begin, and when it ends this type will be started)
0x00b b: move mode (whether or not the boot was pressed and the exits shown. They were not.)
0x00c b[256]: puzzle flags
# -------1: discovered
# ------1-: solved
# -----1--: ? (seems to always be set together with solved, at least for story puzzles)
# --111---: least to most significant: hints 1-3 unlocked
# 11------: number of previous failed attempts
0x10c w: is the current script executed right after a puzzle ended? (nonsense in a savefile)
0x110 w: current event
0x114 b[480]: event flags (8bit[])
# 257: hotelroom completed
# 258: painting completed
# 259: game completed
0x2f4 hw: global story progress?? Chapter number??
0x2f6 b[64]: engine played before? (bool[])
0x336 b[64]: hint coins collected (bitfield)
0x376 hw: hint coint count
0x378 dw: playtime (in seconds)
0x380 b[8]: inventory
0x388 b[128]: various story flags
# 500-502: dog/painting/hotel unlocked
# 506: challenges unlocked (probably by clearing the game or any minigame)
# 507-509: dog/hotel/painting completed
# 511: All puzzles except the last Layton's Challenges complete
# 512: game cleared
# puzzleid+800: puzzle sent to nazobaba
# 300-319: mystery discovered
# 320-339: mystery solved
0x408 b: current objective
0x409 b[32]: dog collected (but not placed) part list
0x429 b[4]: dog part placed? (bitfield)
0x42d w: picarat count
0x431 b[20]: puzzle pieces obtained? (list of bool)
0x445 b[20]: puzzle pieces placed slot
0x459 b[20]: puzzle pieces placed rotation
0x46d b[32]: hotelroom layton
0x48d b[32]: hotelroom luke
0x4ad b[32]: ?
0x4cd b[32]: ?
0x4ed b: journal has news?
0x4ee b: dog has news?
0x4ef b: hotelroom has news?
0x4f0 b: painting has news?
0x4f1 b: mysteries has news?
0x4f2 b[32]: puzzle favorites (bitfield)
0x512 b[8]: journal entry unread flags
0x51a b[2]: mysteries unread? (bitfield)
0x51c w: recap event ID
0x520 b[20]: dogname
0x534 w: clues given by dog
0x538 w: hash of all previous data

# ~0x53c to ~0x7d0: padding 0
```

## Postfix

**Starts at:** 0x1b58 (7000)
**Length:** 0x78 (120)

```
0x1b58 w: hash of the following data
0x1b5c w: number of downloadable puzzles
0x1b60 w: number of downloadable puzzles (again???)
# I believe one of these values stores how many puzzle have been downloaded,
# while the other stores how many WILL ever be downloadable. We can't really
# test the distinction now, because the game service is down... maybe the
# program that simulates it knows what these mean.
0x1b64 struct[27]: Wifi puzzles
~0x0 b: puzzle ID (yes all the downloadable puzzles are already in the files, and unlocked by ID)
~0x1 b: date of release: day
~0x2 b: date of release: month
~0x3 b: date of release: year (relative to 2000)
```

**Padding:** 0x1bd0 to 0x2000, filled with 0xff
Empty file added formats/savefile/__init__.py
Empty file.
Loading