

A collection of objects are exported as single bundle file, with common sprites
included only once.

Export bundle files are saved into the exports folder

Export bundle file are named like:

exportName_2_e791c7.oxp
exportName_2_e791c7.oxz

The "2" is the count of objects in the export, and the hash is a signature based
on the list of object IDs.  Exports containing exactly the same object IDs will
have the same signatures.  Collisions in this 6-character hash space are still
possible, which means you can't rely on this hash to guarantee which objects
will be added or replaced if the bundle is from an untrusted source.  But for
trusted sources, the hash serves as a useful sanity check.

For example, if you're expecting to receive a bundle that will replace three
specific objects, export a bundle yourself with those same three objects.  The
hash of the incoming bundle should match the hash of your own exported test
bundle.

.oxz files are .oxp files with zlib-compatible compression applied.  Compressed
files are exported by default, unless settings/compressExports.ini is set to 0.

Disabling compression can be useful if you need to debug/study the contents
of the exported bundle file.

.oxp files are also created as intermediary files as part of the export process,
even if a compressed .oxz file is the end goal.


.oxz files contain a size header followed by raw zlib compression output.
The header is in the following format:

total_block_count decompressed_size_in_bytes#

total_block_count is the total number of blocks in the export, which is the sum
of sprites + sounds + objects + animations

The # sign is followed immediately by the compressed data.

Example:

15 23493#






This file describes the structure of the .oxp file format.


File contents is a combination of text interleaved with raw binary data.




Sprite block:

Each unique sprite used by the object collection is included first in the file.

Each sprite has a header formatted as follows:

sprite id tag multiplicativeBlend centerAnchorXOffset centerAnchorYOffset tgaFileSize#

Example:

sprite 143 BerryBush 0 3 19 65554#


The # sign is followed by raw TGA file data of length tgaFileSize

Note that sprite tags cannot contain spaces (this is enforced by the Editor
already, and by the format of .txt files in the sprites folder).

Each additional unique sprite in the object collection is concatonated, with no
space or other separation between them.





Sounds block:

Each unique sound used by the object collection (for both the objects themselves
and the object's animations) is included next in the file.

Each sound has a header formatted as follows:

sound id format soundFileSize#

Where format is either AIFF or OGG

Examples:

sound 621 AIFF 79164#
sound 1940 OGG 493399

The # sign is followed by raw AIFF or OGG file data of length soundFileSize

Each additional unique sound used by the object collection is concatonated,
with no space or other separation between them.






Objects block:

Next, the objects themselves are included, each with the following header
format:

object id textFileSize#

Example:

object 30 1900#


The # sign is followed by raw TXT file data for the object.  Note that newlines
are represented by LF and *NOT* CRLF.  This may differ from how these files
are checked out by git on Windows (though it matches the way the files are
stored in the git repository).

Each additional object in the object collection is concatonated, with no
space or other separation between them.





Animations block:

The objects are followed by concatonated animations.  Each animation
has a header in the following format:

anim object_id slot_number textFileSize#

slot_number is one of 0, 1, 2, 4, or 5 (never 3)
OR 7x0, 7x1, etc for extra animations.

Examples:

anim 19 5 20243#

anim 19 7x2 19695#


The # sign is followed by raw TXT file data for the animation.
Note that newlines are represented by LF and not CRLF.  This may differ from
how these files are checked out by git on Windows (though it matches the way
the files are stored in the repository).

After the final animation's text data, the file ends.