Glossary
|
1. What is it?
APA (asset package archive) packer is an asset manager for all computational
projects with distinct needs for media distribution. It can pack assets akin to a stack
which omits having to distribute raw media files thus protecting intellectual
property. It may be used in many scenarios. Its key objective is to ease the issue of
managing assets in game development projects. With access to an API, one can
easily access the raw binary to import and manipulate hundreds of assets
seamlessly.
|
1.1. Why?
What often happens with a large project is that it soon acquires a large number of assets. Things such as icons,
bitmaps, audio and video media each have their own file, size and add needless
bulk to installation scripting, compiling and distribution efforts.
If all these can be packed into a readable format and distributed as a single file and
then efficiently unpacked and read at runtime then evidently the benefits become
clear.
|
2. File Format
Nullox has a library denoted as NSL, this is the Nullox standard library which is a
large library governing all computation that takes place within Nullox Software and
Nullox Game developments.
|
2.1 Header
The header within an APA file comprises of eight parts, these are:
|
2.1.1 Signature
The signature comprises of six bytes aka magic numbers. The bytes correspond to
the decimal vector [78, 83, 76, 65, 80, 65]. These bytes are always present in a
legitimate NSL::APA file.
|
2.1.2 Endian Byte
The next byte after the signature (the seventh byte) indicates whether the encoding used little or big endian. If the value is equal to zero then the encoding used little endian. For any other value (one in a correct implementation), the encoding would alternatively have been big endian. |
2.1.3 Version ID
The next two bytes (an unsigned short integer) informs the decoder the version number of the original encoder. |
2.1.4 Encryption Flag
The next byte signals the receiver whether the package has been encrypted. If set to zero, the package has not been encrypted with a 2048-bit key |
2.1.5 Compression Flag (wip)
The eleven byte is currently reserved to signal compression. As of version 2, it is always set to zero. Decoders should refer to 2.1.3 to verify the version of the encoder. It is likely pending research efforts that this byte will be utilised in version 3 of NSL::APA. |
2.1.6 Asset Count
The next four bytes (a long integer) indicates the number of assets packed within the archive. |
2.1.7 Filename Length and Text
Next follows an arbitrary number of bytes encompassing filename lengths and
filename text. The order of each filename .length() and filename .c_str() are equal to
the order of the binary dump further on within the archive.
|
2.1.8 Asset Sizes
Next follows a linear collection of asset sizes. Each size uses four bytes (a long integer). These asset sizes can be used to offset within the main binary data to differentiate between the number of assets. |
2.2 Asset Data
Immediately following the header is the raw binary data for all packed assets, one asset after another. Each asset is ordered thus aligned with the filenames and sizes within the header. |
2.3 Footer
The footer within an APA file comprises of one part in version 2, and is of the form:
|