Skip to content

Namespace Apogee.Export

Classes

ExportException

An export could not be done; the message says what is wrong and, when there is something to do about it, what.

ExportLayout

Where the parts of an export go in the output folder. Windows and Linux: everything in the output folder (the executable, its libraries, game.xml and data/). macOS: a bundle, Name.app, with the program and its libraries in Contents/MacOS (the runtime's folder) and the game's own files in Contents/Resources.

ExportOptions

What exports and how.

ExportResult

What made.

GameExporter

Exports a game: a folder that runs on its own. It holds the runtime of the target platform renamed to the game's executable name, the runtime's native libraries and compiled shaders, the game's files in data/game.pack (encrypted when there is a key, which is then also written into the executable, see ), and the game's game.xml. See for where each goes. The game folder is only read: it is copied before it is imported.

IcnsWriter

Writes the macOS icon file format, icns: the characters icns, the length of the whole file (4 bytes, big-endian), and the images, each as its type (four characters), its length including these 8 bytes (big-endian) and a PNG file. The images are the sizes Finder and the Dock use, from 16 to 1024 pixels; a size above the game's icon is left out, so nothing in the file is an enlarged copy, and macOS scales the biggest image that is there.

IconImages

A game's icon (game.xml's Icon: a square PNG) at the sizes the platforms want: Windows icon resources, the macOS icns, the Linux icon. Sizes below the image are made by averaging the pixels each new pixel covers (a box filter, with transparent pixels counting for nothing in the colors); a size above it is made the same way, which only repeats pixels, and is warned about.

PackKeySlot

A reserved place in the engine's executable for the key of the game's packs, so that an exported game opens its packs without the environment variable. The executable holds (68 bytes in its read-only data: a 16 byte magic, a format byte, a "used" byte, 2 reserved bytes, a 16 byte salt, and 32 bytes for the key); an export finds every copy of the template in the copy of the executable it makes, and writes the key into each, masked: key XOR SHA-256(salt + magic) (the same salt and bytes in all). The running game reads it back with .

There is normally one copy, but a compiler may emit the data twice (the NativeAOT compiler does in the arm64 macOS executable), and the game reads whichever copy its code refers to: so every copy is patched.

This is obfuscation, not protection. The key is in the file, one XOR from anyone who reads this code or finds the magic; and a running game has the key in memory. It keeps the key out of strings, out of a quick look in a hex editor, and out of the packs' reach, nothing more. It stops nobody who wants the game's files.

PlatformPackagingContext

What a platform's last step of an export needs to know and can change.

RuntimeFolder

The published runtime that an export is made from: a folder with the NativeAOT Apogee.Runtime (./build.sh aot, or the CI artifact apogee-<rid>), its native libraries and its compiled shaders. The runtime is a native program of one platform, so the folder has to be published for the target; this class finds it and checks, by reading the executable's header.

Structs

ExportTarget

A platform an export is made for: an operating system and a processor, named as the .NET runtime identifier (linux-x64).

Interfaces

IPlatformPackaging

The last step of an export, which is different on every operating system: the icon, the version information, the bundle. It runs after the key is written into the executable.