Jump to content

OBD:Instance file format: Difference between revisions

moved Terminology to its own page
(wording; I may be keeping the intro here after all, so I removed the unneeded definitions; merged the tiny content from OBD:File types/Empty so I can delete /Empty)
(moved Terminology to its own page)
Line 1: Line 1:
:''For other files ending in ".dat", see [[Oni (folder)]].''
:''For other files ending in ".dat", see [[Oni (folder)]].''
:''You should read the [[OBD:Terminology]] page before this one.''
Files in GameDataFolder/ named "level[0-19]_Final.dat", together with ".raw" and sometimes ".sep" counterparts, contain the game data for Oni. The [[Raw|documentation for raw and separate files]] can be read after this page.
Files in GameDataFolder/ named "level[0-19]_Final.dat", together with ".raw" and sometimes ".sep" counterparts, contain the game data for Oni. The [[Raw|documentation for raw and separate files]] can be read after this page.


Line 5: Line 6:


The level 0 files do not actually contain a level, but instances (resources) shared across all levels. Level 0 is loaded when the game starts, and never unloaded. All other level files are only loaded when the corresponding level starts and unloaded when it ends.
The level 0 files do not actually contain a level, but instances (resources) shared across all levels. Level 0 is loaded when the game starts, and never unloaded. All other level files are only loaded when the corresponding level starts and unloaded when it ends.
==Terminology==
;Level data files
The data for each level is found in two files in Windows retail Oni, ending in ".dat" and ".raw". On Macs and in the Windows demo, a third file type ending in ".sep" is used. These two/three files are collectively called level data files.
;Instance file
Any file ending in ".dat" found in GameDataFolder/. Instance files are the main type of data file in the sense that, when loading a level, Oni reads the instance file first, and this file serves as an index that allows it to find resources which are packed into the level data files.
;Instance, resource, file
This one can be confusing. An instance is often called a file on this wiki, but an instance is not the same as an "instance file". An instance is an individual resource, such as a texture. They are called files because they are individual pieces of data stored and cataloged in a "file system" composed of a set of .dat/.raw[/.sep] files. In at least some cases they were indeed actual, separate files on the developer's computer before being packed into the level data files.
When OniSplit is used to split level data files into individual files for each resource, in effect it is creating thousands of "single-instance instance files", at which point "instance", "file", and "instance file" become fully synonymous.
;Template, file type
A template represents a type of resource. Templates are identified with four-letter codes, often called tags, such as "SUBT" for subtitle files. Just as instances are often called files on the wiki, templates are often called file types.
;.oni
Generated by [[OniSplit]], these files are Windows-format .dat files which basically contain a single instance extracted from an instance file, with all the instance data that was contained by the .raw/.sep files appended at the end.


==Backwards and garbage data==
==Backwards and garbage data==