Oni (folder)/persist.dat: Difference between revisions

m
wording, minor corrections
m (+retitle to preserve actual file name)
m (wording, minor corrections)
Line 2: Line 2:
As players of Oni are well aware, the game does not allow arbitrary saving ("save anywhere"), but relies on the use of fixed savepoints activated through level scripting by reaching certain places in each level. This means that by setting a maximum number of levels and savepoints for Oni, the developer could store the total state of the player's progress in a single, fixed-size file -- a 206,496 byte file, to be exact. In addition to savepoint data, persist.dat has a header which stores Oni's player settings (besides [[Oni (folder)/key_config.txt|key bindings]]). It also records whether the cheats are enabled (i.e. whether you have beaten the game), and whether you killed Griffin in {{C|13}}.
As players of Oni are well aware, the game does not allow arbitrary saving ("save anywhere"), but relies on the use of fixed savepoints activated through level scripting by reaching certain places in each level. This means that by setting a maximum number of levels and savepoints for Oni, the developer could store the total state of the player's progress in a single, fixed-size file -- a 206,496 byte file, to be exact. In addition to savepoint data, persist.dat has a header which stores Oni's player settings (besides [[Oni (folder)/key_config.txt|key bindings]]). It also records whether the cheats are enabled (i.e. whether you have beaten the game), and whether you killed Griffin in {{C|13}}.


The persist.dat file has nothing to do with Oni's [[Dat|instance 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, ####_corpse.dat, etc., then later on added .raw and then .sep as unique suffixes when they needed to break out the level data .dats).
The persist.dat file has nothing to do with Oni's [[Dat|instance 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., then later on added .raw and then .sep as unique suffixes when they needed to break out the level data .dats).


The original Mac game application and the Omni Group build were for PPC Macs, thus numbers were written big-endian (e.g., the 0x08 field in the header would be 00 0C 7F 5C). This meant that the saved-game files were not interchangeable between PC and Mac versions of Oni. However, with modern Macs running a [[AE:FERAL|native Intel build]], the files are now all in little-endian format.
The original Mac game application and the Omni Group build were for PPC Macs, thus numbers were written big-endian (e.g., the 0x08 field in the header would be 00 0C 7F 5C). This meant that the saved-game files were not interchangeable between PC and Mac versions of Oni. However, with modern Macs running a [[AE:FERAL|native Intel build]], the files are now all in little-endian format, as in Windows.


The header of the file is 0x60=96 bytes long. It is followed by an array of 400 savepoints, 0x204=516 bytes each, grouped implicitly into 40 levels, 10 savepoints per level. The first 10 savepoints belong to level 0 and are never written to. The savepoints of the original 14 levels follow. This leaves 25 unused levels at the end of the saved-game file.
The header of the file is 0x60=96 bytes long. It is followed by an array of 400 savepoints, 0x204=516 bytes each, grouped implicitly into 40 levels, 10 savepoints per level. The first 10 savepoints belong to level 0 and are never written to. The savepoints of the original 14 levels follow. This leaves 25 unused levels at the end of the saved-game file.


Only savepoint names are stored in this file (and they are all named uniformly as "Save Point x" even though they could say anything). The actual level names are taken from the [[ONLD]] files of level 0, except for Chapters 0 and 1: "TCTF Training" (level 1, savepoint 0) and "Syndicate Warehouse" (level 1 savepoint 1) are hard-coded into the engine.  
Only savepoint names are stored in this file (and they are all named uniformly as "Save Point ''x''" even though they could say anything). The actual level names are taken from the [[ONLD]] files of level 0, except for Chapters 0 and 1: "TCTF Training" and "Syndicate Warehouse" are hard-coded into the engine.  


==Unlocking more levels==
==Unlocking more levels==
Line 20: Line 20:
{{OBDtr| 0x00 | int32 |FF0000| 0F 00 00 00 | 15        | version }}
{{OBDtr| 0x00 | int32 |FF0000| 0F 00 00 00 | 15        | version }}
{{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 flag 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, ignored)
:0x'''01''' 00 00 00 - level 0 (always unlocked, ignored)
:0x'''02''' 00 00 00 - level 1 (always unlocked, ignored)
:0x'''02''' 00 00 00 - level 1 (always unlocked, ignored)
Line 26: Line 26:
:...
:...
:0x00 00 '''08''' 00 - level 19 }}
:0x00 00 '''08''' 00 - level 19 }}
{{OBDtr| 0x0C | int32 |FF0000| 00 00 00 00 |      | level unlock flag for levels 32-63 }}
{{OBDtr| 0x0C | int32 |FF0000| 00 00 00 00 |      | level unlock flags for levels 32-63 }}
{{OBDtr| 0x10 | int32 |FF0000| 00 00 00 00 |      | level unlock flag for levels 64-95 }}
{{OBDtr| 0x10 | int32 |FF0000| 00 00 00 00 |      | level unlock flags for levels 64-95 }}
{{OBDtr| 0x14 | int32 |FF0000| 00 00 00 00 |      | level unlock flag for levels 96-127 }}
{{OBDtr| 0x14 | int32 |FF0000| 00 00 00 00 |      | level unlock flags for levels 96-127 }}
{{OBDtr| 0x18 | int32 |FF0000| 00 00 00 00 |      | level unlock flag for levels 128-159 }}
{{OBDtr| 0x18 | int32 |FF0000| 00 00 00 00 |      | level unlock flags for levels 128-159 }}
{{OBDtr| 0x1C | int32 |FF0000| 00 00 00 00 |      | level unlock flag for levels 160-191 }}
{{OBDtr| 0x1C | int32 |FF0000| 00 00 00 00 |      | level unlock flags for levels 160-191 }}
{{OBDtr| 0x20 | int32 |FF0000| 00 00 00 00 |      | level unlock flag for levels 192-223 }}
{{OBDtr| 0x20 | int32 |FF0000| 00 00 00 00 |      | level unlock flags for levels 192-223 }}
{{OBDtr| 0x24 | int32 |FF0000| 00 00 00 00 |      | level unlock flag 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 weapons; one bit for each weapon; the number of corresponding bit is given by the skill index value in the primary firing mode block of each [[ONWC]] }}
{{OBDtr| 0x2C |      |00FF00| FE 1B 00 00 | 7166 | unlocked weapons; one bit for each weapon; the number of corresponding bit is given by the skill index value in the primary firing mode block of each [[ONWC]] }}
Line 54: Line 54:
:2 - hard }}
:2 - hard }}
{{OBDtr| 0x4C | int16 |FFC800| 20 03      | 800 | resolution: width }}
{{OBDtr| 0x4C | int16 |FFC800| 20 03      | 800 | resolution: width }}
{{OBDtr| 0x4E | int16 |FFC800| 02 58      | 800 | resolution: height }}
{{OBDtr| 0x4E | int16 |FFC800| 02 58      | 600 | resolution: height }}
{{OBDtr| 0x50 | int16 |C800C8| 20 00      | 32  | color depth }}
{{OBDtr| 0x50 | int16 |C800C8| 20 00      | 32  | color depth }}
{{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 loaded (saved?) level }}
{{OBDtr| 0x58 | int32 |B0C3D4| 03 00 00 00 | 3  | last saved level }}
{{OBDtr| 0x5C | int32 |E7CEA5| 02 00 00 00 | 3  | last saved savepoint }}
{{OBDtr| 0x5C | int32 |E7CEA5| 02 00 00 00 | 3  | last saved savepoint }}
|}
|}
Line 101: Line 101:


;Weapon slots
;Weapon slots
:Yes, Oni does seem to support saved data for three weapons, even though the player can only carry one in the final game. Perhaps the three weapon slots were planned to allow for, say, [[:Image:Oni_box_art-front.jpg|dual-wielded guns and a holstered weapon]]....
:Yes, Virginia, Oni does seem to support saved data for three weapons, even though the player can only carry one in the final game. Perhaps the three weapon slots were planned to allow for, say, [[:Image:Oni_box_art-front.jpg|dual-wielded guns and a holstered weapon]]....


[[Category:Oni binary data docs]]
[[Category:Oni binary data docs]]