19,577
edits
m (linked to new difficulty mode article) |
(correction to statement on free level slots, and various other clarifications) |
||
(2 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
{{ | {{UpdatedForOniX|1.0.0}} | ||
persist.dat, found next to the game application, is the save-game and preference file for Oni. It can be edited most easily with GUI tools such as [[OSGE]] for Windows and [http://mods.oni2.net/node/155 OniLib] for Mac, though [[OBD]]-style hex-based documentation of this file is given below. | |||
The persist.dat file has nothing to do with Oni's [[Dat|.dat level files]] despite the ".dat" extension (it looks like Bungie West simply used .dat for every kind of file Oni read and wrote – saved_film####.dat, lvl_#_###_corpse.dat, etc. – until they later added .raw and then .sep as unique suffixes when they needed to break out some resource data from levelX_Final.dat). | The persist.dat file has nothing to do with Oni's [[Dat|.dat level files]] despite the ".dat" extension (it looks like Bungie West simply used .dat for every kind of file Oni read and wrote – saved_film####.dat, lvl_#_###_corpse.dat, etc. – until they later added .raw and then .sep as unique suffixes when they needed to break out some resource data from levelX_Final.dat). | ||
Line 7: | Line 7: | ||
As players of Oni are well aware, the game does not allow arbitrary saving ("save anywhere"), but relies on the use of fixed save points activated by reaching certain places in each level, at which point the level scripting uses the [[BSL]] function <tt>save_game</tt> to mark your progress. This means that by deciding on a maximum number of levels and save points, Bungie West could store the total state of the player's progress in a fixed-size file – 206,496 bytes, to be exact. | As players of Oni are well aware, the game does not allow arbitrary saving ("save anywhere"), but relies on the use of fixed save points activated by reaching certain places in each level, at which point the level scripting uses the [[BSL]] function <tt>save_game</tt> to mark your progress. This means that by deciding on a maximum number of levels and save points, Bungie West could store the total state of the player's progress in a fixed-size file – 206,496 bytes, to be exact. | ||
As you will see below, many aspects of the game world are ''not'' saved in persist.dat; essentially, anything not pertaining to Konoko herself, such as the position of AIs and the presence of power-ups on the ground. What <u>is</u> stored is Konoko's position, health and inventory. Everything else is | As you will see below, many aspects of the game world are ''not'' saved in persist.dat; essentially, anything not pertaining to Konoko herself, such as the position of AIs and the presence of power-ups on the ground. What <u>is</u> stored is Konoko's position, health and inventory. Everything else is determined by the level scripting and the game data, and will always be in the same place when that save point is loaded. | ||
==Game preferences== | ==Game preferences== | ||
Line 16: | Line 16: | ||
==Overview== | ==Overview== | ||
The header of the file is 0x60=96 bytes long. It is followed by an array of 400 save points, 0x204=516 bytes each, grouped implicitly into 40 levels with 10 save points per level for a total of 206,400 bytes. The first 10 save points belong to level 0, which contains global game data rather than a specific level, thus they are never written to | The header of the file is 0x60=96 bytes long. It is followed by an array of 400 save points, 0x204=516 bytes each, grouped implicitly into 40 levels with 10 save points per level for a total of 206,400 bytes. The first 10 save points belong to level 0, which contains global game data rather than a specific level, thus they are never written to. | ||
Only the names of save points, not levels, are stored in this file (and they are all named uniformly as "Save Point ''n''" even though they could say anything). The | The save points of the game's 14 levels follow, but because the level's internal number, not its Chapter number, is used as the index into persist.dat's level slots, the save-game slots span the first 20 level slots – with 0 being unused, as well as slots 5, 7, 15, 16, and 17 because of the gaps in the numbering of the level''N''_Final.dat files. This leaves 20 unused level slots at the end of the save-game file, besides the 1 + 5 unused slots before that point. | ||
Only the names of save points, not levels, are stored in this file (and they are all named uniformly as "Save Point ''n''" even though they could say anything). The level names shown in Oni's Load Game screen come from the ONLD resources in level0_Final, except for Chapter 1's name, "Syndicate Warehouse", which was hard-coded into the engine for a reason explained on the [[ONLD]] page. | |||
==Unlocking more levels== | ==Unlocking more levels== | ||
To unlock all possible levels, fill the range 0x08 to 0x28 with "FF". So far this has caused no problems, and allows you to add more levels to the game. Levels will not be visible unless there is a corresponding | To unlock all possible levels, fill the range 0x08 to 0x28 with "FF". So far this has caused no problems, and allows you to add more levels to the game. Levels will not be visible unless there is a corresponding level''N''_Final.dat in the GameDataFolder and an ONLD which matches this level number is found in level0_Final.dat. Levels above 39 are not unlockable due to the 40-level save point limit in the persist.dat. | ||
==Header data== | ==Header data== | ||
Line 31: | Line 33: | ||
{{OBDtr| 0x04 | int32 |FF0000| 0E 0B D0 D0 | 0xD0D00B0E | signature }} | {{OBDtr| 0x04 | int32 |FF0000| 0E 0B D0 D0 | 0xD0D00B0E | signature }} | ||
{{OBDtr| 0x08 | int32 |FF0000| 5C 7F 0C 00 | 0x000C7F5C | level unlock flags for levels 0-31; each level has a corresponding bit: | {{OBDtr| 0x08 | int32 |FF0000| 5C 7F 0C 00 | 0x000C7F5C | level unlock flags for levels 0-31; each level has a corresponding bit: | ||
:0x'''01''' 00 00 00 - level 0 (always unlocked | :0x'''01''' 00 00 00 - level 0 (ignored; always unlocked) | ||
:0x'''02''' 00 00 00 - level 1 (always unlocked | :0x'''02''' 00 00 00 - level 1 (ignored; always unlocked) | ||
:0x'''04''' 00 00 00 - level 2 | :0x'''04''' 00 00 00 - level 2 | ||
:... | :... | ||
Line 44: | Line 46: | ||
{{OBDtr| 0x24 | int32 |FF0000| 00 00 00 00 | | level unlock flags for levels 224-255 }} | {{OBDtr| 0x24 | int32 |FF0000| 00 00 00 00 | | level unlock flags for levels 224-255 }} | ||
{{OBDtr| 0x28 | int32 |FFFF00| 01 00 00 00 | 1 | killed Griffin (0 <nowiki>=</nowiki> no, 1 <nowiki>=</nowiki> yes) }} | {{OBDtr| 0x28 | int32 |FFFF00| 01 00 00 00 | 1 | killed Griffin (0 <nowiki>=</nowiki> no, 1 <nowiki>=</nowiki> yes) }} | ||
{{OBDtr| 0x2C | |00FF00| FE 1B 00 00 | 7166 | unlocked | {{OBDtr| 0x2C | |00FF00| FE 1B 00 00 | 7166 | unlocked diary weapon pages, one bit for each weapon; these bits match the skill index values in the primary firing mode block of each [[ONWC]] (see 0x13E in ONWC for the weapon table) }} | ||
{{OBDtr| 0x30 | |00FFFF| 1F 00 00 00 | 31 | unlocked | {{OBDtr| 0x30 | |00FFFF| 1F 00 00 00 | 31 | unlocked diary item pages; one bit for each item type: | ||
:0x'''01''' 00 00 00 - ballistic ammo | |||
:0x'''02''' 00 00 00 - energy ammo | |||
:0x'''04''' 00 00 00 - hypo | |||
:0x'''08''' 00 00 00 - force shield | |||
:0x'''10''' 00 00 00 - phase cloak | |||
:0x'''20''' 00 00 00 - LSI (unused because LSIs are level-specific and the diary page for an LSI can only be read while it's in your inventory) }} | |||
{{OBDtr| 0x34 | |FF00FF| 13 00 00 00 | 19 | last read diary page (level) }} | {{OBDtr| 0x34 | |FF00FF| 13 00 00 00 | 19 | last read diary page (level) }} | ||
{{OBDtr| 0x38 | |FFC8C8| 01 00 00 00 | 1 | last read diary page (page) }} | {{OBDtr| 0x38 | |FFC8C8| 01 00 00 00 | 1 | last read diary page (page) }} | ||
Line 68: | Line 76: | ||
{{OBDtr| 0x52 | |C800C8| 00 00 | | padding }} | {{OBDtr| 0x52 | |C800C8| 00 00 | | padding }} | ||
{{OBDtr| 0x54 | float |C87C64| 00 00 00 3F | 0.5 | gamma correction; from 0.0 to 1.0, 0.5 means no correction }} | {{OBDtr| 0x54 | float |C87C64| 00 00 00 3F | 0.5 | gamma correction; from 0.0 to 1.0, 0.5 means no correction }} | ||
{{OBDtr| 0x58 | int32 |B0C3D4| 03 00 00 00 | 3 | last saved level }} | {{OBDtr| 0x58 | int32 |B0C3D4| 03 00 00 00 | 3 | last saved level number (as found in ONLD, i.e., last level of the game is 19 not 14) }} | ||
{{OBDtr| 0x5C | int32 |E7CEA5| 02 00 00 00 | 3 | last saved save point }} | {{OBDtr| 0x5C | int32 |E7CEA5| 02 00 00 00 | 3 | last saved save point }} | ||
|} | |} | ||
;Last saved level/SP | |||
:This is the last savepoint that the player triggered while playing the game, which is not necessarily the farthest they've gotten in the game. A player who's beaten Oni and started it over could have a last saved level/SP of 1/1. As shown earlier, it's the level unlock bits at 0x08 which reflect one's total progress in the game. The "last saved" fields are used by Oni to highlight the most recent savepoint in the Load Game screen when the player resumes playing Oni. | |||
;Killed Griffin | ;Killed Griffin | ||
: | :Accessed in Chapters 13 and 14: the flag is set in Ch. 13 with [[killed_griffen]], and it's read in Ch. 14 with [[did_kill_griffen]]. | ||
==Save point data== | |||
After the header is an array of 400 save points (40 levels, 10 save points per level). The size of a save point is 516 bytes so the array size is 206,400 bytes. Below is a sample save point. | |||
[[Image:Persist dat.gif]] | [[Image:Persist dat.gif]] | ||
Line 85: | Line 95: | ||
{{Table}} | {{Table}} | ||
{{OBDth}} | {{OBDth}} | ||
{{OBDtr2|0x00 | char[64] |FF0000| "Save Point 2" | name of the save point in Load Game dialog }} | {{OBDtr2| 0x00 | char[64] |FF0000| "Save Point 2" | name of the save point in Load Game dialog }} | ||
{{OBDtr| 0x40 | int32 |FFFF00| 01 00 00 00 | 1 | valid (was saved previously), i.e. "Should we display this in Load Game?" (0 <nowiki>=</nowiki> no, 1 <nowiki>=</nowiki> yes) }} | {{OBDtr | 0x40 | int32 |FFFF00| 01 00 00 00 | 1 | valid (was saved previously), i.e. "Should we display this in Load Game?" (0 <nowiki>=</nowiki> no, 1 <nowiki>=</nowiki> yes) }} | ||
{{OBDtr| 0x44 | int32 |00FF00| BE 00 00 00 | 190 | current player health (HP) }} | {{OBDtr | 0x44 | int32 |00FF00| BE 00 00 00 | 190 | current player health (HP) }} | ||
{{OBDtr| 0x48 | int32 |00FFFF| C8 00 00 00 | 200 | max player health (HP) }} | {{OBDtr | 0x48 | int32 |00FFFF| C8 00 00 00 | 200 | max player health (HP) }} | ||
{{OBDtr| 0x4C | float |FF00FF| AE 20 FB 43 | 502.255310 | x position of the player }} | {{OBDtr | 0x4C | float |FF00FF| AE 20 FB 43 | 502.255310 | x position of the player }} | ||
{{OBDtr| 0x50 | float |FF00FF| 03 32 4B 42 | 50.798839 | y position of the player }} | {{OBDtr | 0x50 | float |FF00FF| 03 32 4B 42 | 50.798839 | y position of the player }} | ||
{{OBDtr| 0x54 | float |FF00FF| 55 12 25 C4 | -660.286437| z position of the player }} | {{OBDtr | 0x54 | float |FF00FF| 55 12 25 C4 | -660.286437| z position of the player }} | ||
{{OBDtr| 0x58 | float |FFC8C8| 80 06 C1 3F | 1.508010 | player facing direction (radians) }} | {{OBDtr | 0x58 | float |FFC8C8| 80 06 C1 3F | 1.508010 | player facing direction (radians) }} | ||
{{OBDtr| 0x5C | int32 |FFFFC8| 00 00 00 00 | 0 | number of ballistic ammo clips }} | {{OBDtr | 0x5C | int32 |FFFFC8| 00 00 00 00 | 0 | number of ballistic ammo clips }} | ||
{{OBDtr| 0x60 | int32 |C8FFC8| 01 00 00 00 | 1 | number of energy cells }} | {{OBDtr | 0x60 | int32 |C8FFC8| 01 00 00 00 | 1 | number of energy cells }} | ||
{{OBDtr| 0x64 | int32 |C8FFFF| 00 00 00 00 | 0 | shield (percent) }} | {{OBDtr | 0x64 | int32 |C8FFFF| 00 00 00 00 | 0 | shield (percent) }} | ||
{{OBDtr| 0x68 | int32 |FFC8FF| 00 00 00 00 | 0 | invisibility (1/60 seconds) }} | {{OBDtr | 0x68 | int32 |FFC8FF| 00 00 00 00 | 0 | invisibility (1/60 seconds) }} | ||
{{OBDtr| 0x6C | int32 |FFC800| 01 00 00 00 | 1 | number of hypos }} | {{OBDtr | 0x6C | int32 |FFC800| 01 00 00 00 | 1 | number of hypos }} | ||
{{OBDtr| 0x70 | int32 |C800C8| 00 00 00 00 | 0 | door keys}} | {{OBDtr | 0x70 | int32 |C800C8| 00 00 00 00 | 0 | door keys}} | ||
{{OBDtr| 0x74 | int32 |C87C64| 01 00 00 00 | 1 | whether player has [[LSI]] (0 <nowiki>=</nowiki> no, 1 <nowiki>=</nowiki> yes) }} | {{OBDtr | 0x74 | int32 |C87C64| 01 00 00 00 | 1 | whether player has [[LSI]] (0 <nowiki>=</nowiki> no, 1 <nowiki>=</nowiki> yes) }} | ||
{{OBDtr2| 0x78 | char[128]|B0C3D4| "" | weapon name (unused) }} | {{OBDtr2| 0x78 | char[128]|B0C3D4| "" | weapon name (unused) }} | ||
{{OBDtr | 0xF8 | int32 |FFDDDD| 00 00 00 00 | 0 | weapon ammo (unused) }} | {{OBDtr | 0xF8 | int32 |FFDDDD| 00 00 00 00 | 0 | weapon ammo (unused) }} |