Game data terminology

From OniGalore
Revision as of 21:58, 4 January 2017 by Iritscen (talk | contribs) (/cat)
Jump to navigation Jump to search
Click to return to the main OBD page.
Binary data

A collective term for the game data that Oni runs on. It is mostly distributed into the level data files; though some additional data is found in persist.dat, the term "binary data" tends to refer only to the level data files.

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 file type ending in ".sep" is also used. These two/three files are collectively called binary data, or level data files.

Instance file

Any .dat file in GameDataFolder. Instance files are the main type of level 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 other types of level data files.

.dat file

".dat" is a generic suffix originally used by Oni for all kinds of data, with file names such as level0_Final.dat, persist.dat, and developer-related files such as saved_film*.dat, level_*_corpse.dat, etc. The proper, specific name for the .dat files containing level data is "instance file". That being said, ".dat" has only been used by the community historically to refer to instance files, so you can reasonably assume that's what is meant when you see the suffix by itself. On occasion, ".dat" also refers to the complete set of level data files, .dat/.raw[/.sep].

Instance, resource, file

The use of these terms 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 sometimes called files because they are distinct 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 basically synonymous. The format of instance files is documented HERE.

Raw file, .raw / Separate file, .sep

During development, these types of level data files were eventually created as companions to instance files. The kinds of resources stored in these files are generally those with larger amounts of data, like textures and sounds.

Raw files are found in both Windows and Mac Oni, whereas separate files only occur on Macs and in the Windows demo. When separate files are present, raw files are much smaller because several resource types have their data stored in the separate file instead.

They have no file header, since the instance file serves as the table of contents for them. The only structural rules about raw/separate files are that all data parts are stored 32 byte-aligned, and the first 32 bytes of the file are always zero (reserved to represent null pointers). At load-time, the offsets given in the instance file are converted to pointers to the data in the raw/separate files. You can learn the format of raw/separate files HERE.

Template, file type

A template represents a type of resource. Templates are identified with four-character codes, such as "SUBT" for subtitle files; this kind of identifier is often called a "tag" in other communities. Just as instances are often called files on the wiki, templates are often called file types. All templates are listed on the File types page.

.oni

Generated by OniSplit, these files are Windows-format .dat files which basically contain a single instance extracted from an instance file, with any of the instance's data that might have been contained by the .raw/.sep files appended at the end.