Difference between revisions of "Save File (OKAMI) File Format"
Jump to navigation
Jump to search
The following article is currently a Work In Progress and will have more details soon.
The following article is currently a Work In Progress and will have more details soon.
The following article is currently a Work In Progress and will have more details soon. The following article is currently a Work In Progress and will have more details soon.
Heinermann (talk | contribs) (→Character Stats: fix a field size) |
Heinermann (talk | contribs) (Finish up more of the character stats structure) |
||
Line 77: | Line 77: | ||
| 0x002C || 0x14 || <code>uint32_t</code> || 4 || unknown | | 0x002C || 0x14 || <code>uint32_t</code> || 4 || unknown | ||
|- | |- | ||
| 0x0030 || 0x18 || <code>uint8_t</code> || 1 || Main weapon equipped. | | 0x0030 || 0x18 || <code>uint8_t</code> || 1 || Main weapon equipped. See [[#Weapon IDs]]. | ||
|- | |- | ||
| 0x0031 || 0x19 || <code>uint8_t</code> || 1 || Sub weapon equipped. | | 0x0031 || 0x19 || <code>uint8_t</code> || 1 || Sub weapon equipped. See [[#Weapon IDs]]. | ||
|- | |- | ||
| 0x0032 || 0x1A || <code>uint8_t</code> || 1 || | | 0x0032 || 0x1A || <code>uint8_t</code> || 1 || Current transformation (for Karmic Transformers). | ||
<pre>0 = Original Form | |||
7 = Karmic Transformer 1 | |||
8 = Karmic Transformer 6 | |||
9 = Karmic Transformer 5 | |||
10 = Karmic Transformer 4 | |||
11 = Karmic Transformer 2 | |||
12 = Karmic Transformer 9 | |||
13 = Karmic Transformer 7 | |||
14 = Karmic Transformer 3 | |||
15 = Karmic Transformer 8</pre> | |||
|- | |- | ||
| 0x0033 || 0x1B || <code>uint8_t</code> || 1 || unknown (padding?) | | 0x0033 || 0x1B || <code>uint8_t</code> || 1 || unknown (padding?) | ||
Line 89: | Line 99: | ||
| 0x0036 || 0x1E || <code>uint16_t</code> || 2 || unknown (padding?) | | 0x0036 || 0x1E || <code>uint16_t</code> || 2 || unknown (padding?) | ||
|- | |- | ||
| 0x0038 || 0x20 || <code> | | 0x0038 || 0x20 || <code>uint64_t</code> || 8 || Weapons upgraded with gold dust. Use <code>1 << [[#Weapon IDs|weapon ID]]</code> to test. | ||
|- | |- | ||
| 0x0040 || 0x28 || <code>uint16_t</code> || 2 || Vengeance Slip (deflect enemy attacks) timer. | | 0x0040 || 0x28 || <code>uint16_t</code> || 2 || Vengeance Slip (deflect enemy attacks) timer. | ||
Line 163: | Line 173: | ||
| 0x17270 || 0x10130 || <code>hx::Texture[2]</code> || 0x30 || Texture 2 unknown | | 0x17270 || 0x10130 || <code>hx::Texture[2]</code> || 0x30 || Texture 2 unknown | ||
|} | |} | ||
== Appendix == | |||
=== Weapon IDs === | |||
<pre> | |||
Reflectors | |||
0x00 - Divine Retribution | |||
0x01 - Snarling Beast | |||
0x02 - Infinity Judge | |||
0x03 - Trinity Mirror | |||
0x04 - Solar Flare | |||
Glaives | |||
0x10 - Tsumugari | |||
0x11 - Seven Strike | |||
0x12 - Blade of Kusanagi | |||
0x13 - Eighth Wonder | |||
0x14 - Thunder Edge | |||
Rosaries | |||
0x20 - Devout Beads | |||
0x21 - Life Beads | |||
0x22 - Exorcism Beads | |||
0x23 - Resurrection Beads | |||
0x24 - Tundra Beads | |||
0xFF - None | |||
</pre> |
Revision as of 22:58, 1 July 2025
Note: This page pertains to Reverse Engineering of Okami File Formats.
Save File
The save file is exactly 2 846 400 bytes (2.71MB), with a fixed allocation of 30 save slots.
Okami HD save file information is located at Steam/userdata/<user-id>/587620/remote/Steam/OKAMI
.
Save Slot
Each save slot is 94880 (0x172A0) bytes.
Offset | Type | Size | Description |
---|---|---|---|
0x0000 | uint32_t |
4 | 00 00 40 40 |
0x0004 | uint32_t |
4 | Area name string ID |
0x0008 | uint64_t |
8 | Slot checksum |
0x0010 | uint64_t |
8 | Save time RTC (result of wk::OSGetTimeRTC from flower_kernel.dll )
|
0x0018 | CharacterStats |
0x48 | Character Stats such as health, food, praise, godhood, position, and some unlocks. |
0x60 | TrackerData |
0x80 | Tracking information such as first-time item acquisition, logbook, bestiary, time played, etc. |
0xE0 | CollectionData |
0x11B0 | Items collected, inventory, current map, travel guides and various tomes collected, time and day, brush techniques, map states, rejuvenated areas, animals fed, money, demon fangs, enemies slain, etc. |
0x1290 | MapData[83] |
0x49EC | Persistent map flags and values (more map flags in CollectionData). Index is the Map Table vanilla index. |
0x5C7C | uint32_t[83][16] |
0x14C0 | Conversation dialog bits. 512 bits per map. If a bit is set, then the dialog has been completed before. First index is the Map Table vanilla index. Second is the bitfield index. |
0x713C | uint32_t |
4 | unknown |
0x7140 | TextureData |
0x10160 | Texture information for drawn in-game art. i.e. the Imp Mask drawn in the Moon Cave. |
Bitfields
Bit access by id is done a specific way, using arrays of 32-bit integers and testing bits from highest to lowest.
The following is an example of how to test a bit at a specific index.
bool IsBitSet(uint32_t *data, uint32_t index) { return (data[index / 32] & (0x80000000 >> (index % 32))) != 0; }
The logic can be verified by using the Item Table IDs on the first item acquisition bitfield.
Character Stats
Save Offset | Relative Offset | Type | Size | Description |
---|---|---|---|---|
0x0018 | 0x00 | uint16_t |
2 | Current health |
0x001A | 0x02 | uint16_t |
2 | Max health |
0x001C | 0x04 | uint16_t |
2 | Current food (Astral Pouch) |
0x001E | 0x06 | uint16_t |
2 | Max food (Astral Pouch) |
0x0020 | 0x08 | uint16_t |
2 | unknown |
0x0022 | 0x0A | uint16_t |
2 | Current praise |
0x0024 | 0x0C | uint16_t |
2 | Total praise |
0x0026 | 0x0E | uint16_t |
2 | unknown (padding?) |
0x0028 | 0x10 | uint32_t[1] |
4 | Bitmask for dojo techniques unlocked |
0x002C | 0x14 | uint32_t |
4 | unknown |
0x0030 | 0x18 | uint8_t |
1 | Main weapon equipped. See #Weapon IDs. |
0x0031 | 0x19 | uint8_t |
1 | Sub weapon equipped. See #Weapon IDs. |
0x0032 | 0x1A | uint8_t |
1 | Current transformation (for Karmic Transformers).
0 = Original Form 7 = Karmic Transformer 1 8 = Karmic Transformer 6 9 = Karmic Transformer 5 10 = Karmic Transformer 4 11 = Karmic Transformer 2 12 = Karmic Transformer 9 13 = Karmic Transformer 7 14 = Karmic Transformer 3 15 = Karmic Transformer 8 |
0x0033 | 0x1B | uint8_t |
1 | unknown (padding?) |
0x0034 | 0x1C | uint16_t |
2 | Godhood Points |
0x0036 | 0x1E | uint16_t |
2 | unknown (padding?) |
0x0038 | 0x20 | uint64_t |
8 | Weapons upgraded with gold dust. Use 1 << weapon ID to test.
|
0x0040 | 0x28 | uint16_t |
2 | Vengeance Slip (deflect enemy attacks) timer. |
0x0042 | 0x2A | uint16_t |
2 | Steel Fist Sake (attack boost) timer. |
0x0044 | 0x2C | uint16_t |
2 | Steel Soul Sake (defense boost) timer. |
0x0046 | 0x2E | uint16_t |
2 | unknown (padding?) |
0x0048 | 0x30 | float[3] |
0xC | x, y, z |
0x0054 | 0x3C | float[3] |
0xC | u, v, w |
Tracker Data
Collection Data
Map Data
Relative Offset | Type | Size | Description |
---|---|---|---|
0x00 | uint32_t[32] |
0x80 | Map specific data, not shared like the remaining structure. For example, index 0 on Kamiki is a bitfield, index 0 on Shinshu is a counter. |
0x80 | uint32_t[3] |
0xC | Bitfield for revealing buried objects. Shares same ID with collected object bitfield. |
0x8C | uint32_t[3] |
0xC | Bitfield for collected objects. Includes chests, permanent fruit, blooming clovers. |
0x98 | uint32_t[1] |
0x4 | Unknown. |
0x9C | uint32_t |
0x4 | Time of day. Usually synchronized with world time of day. |
0xA0 | uint32_t[3] |
0xC | Bitfield for map areas restored. |
0xAC | uint32_t[1] |
0x4 | Bitfield for trees bloomed. |
0xB0 | uint32_t[1] |
0x4 | Bitfield for cursed trees bloomed (the ones that throw cursed fruit at you). |
0xB4 | uint32_t[4] |
0x10 | Bitfield for fixed fights cleared. Maybe other uses. |
0xC4 | uint32_t[2] |
0x8 | Bitfield for whether NPCs have more to say. |
0xCC | uint32_t[2] |
0x8 | Unknown Bitfield related to NPCs. Same IDs as above. |
0xD4 | uint32_t[2] |
0x8 | Bitfield for maps explored (i.e. dungeons). |
0xDC | uint32_t[1] |
0x4 | Unknown Bitfield. |
0xE0 | uint32_t[1] |
0x4 | Unknown Bitfield. |
Texture Data
Save Offset | Relative Offset | Type | Size | Description |
---|---|---|---|---|
0x7140 | 0x00 | uint8_t[0x8000] |
0x8000 | Texture 1 Image bits (4 bits per pixel) (256x256) |
0xF140 | 0x8000 | uint32_t[16] |
0x40 | Texture 1 unknown colour information |
0xF180 | 0x8040 | uint32_t[16] |
0x40 | Texture 1 unknown colour information |
0xF1C0 | 0x8080 | hx::Texture[2] |
0x30 | Texture 1 unknown |
0xF1F0 | 0x80B0 | uint8_t[0x8000] |
0x8000 | Texture 2 Image bits (4 bits per pixel) (256x256) |
0x171F0 | 0x100B0 | uint32_t[16] |
0x40 | Texture 2 unknown colour information |
0x17230 | 0x100F0 | uint32_t[16] |
0x40 | Texture 2 unknown colour information |
0x17270 | 0x10130 | hx::Texture[2] |
0x30 | Texture 2 unknown |
Appendix
Weapon IDs
Reflectors 0x00 - Divine Retribution 0x01 - Snarling Beast 0x02 - Infinity Judge 0x03 - Trinity Mirror 0x04 - Solar Flare Glaives 0x10 - Tsumugari 0x11 - Seven Strike 0x12 - Blade of Kusanagi 0x13 - Eighth Wonder 0x14 - Thunder Edge Rosaries 0x20 - Devout Beads 0x21 - Life Beads 0x22 - Exorcism Beads 0x23 - Resurrection Beads 0x24 - Tundra Beads 0xFF - None