Skip to content

GamePackage

namespace Griff.Runtime;
public static class GamePackage

A game’s content (project.griff, Assets and compiled scripts) zipped onto the end of the player executable, so an exported game is a single file. The exe ends with the zip, then its length (8 bytes) and a magic tag (8 bytes).

The player unpacks the content to a cache folder the first time it runs, and plays from there: sounds and fonts are played from real files.

public static void Append(string executable, string gameFolder)

Zips gameFolder onto the end of executable.

public static string? Extract(string executable, string cacheRoot, string name)

Unpacks the game carried by executable into a folder under cacheRoot (once per version of the game) and returns that folder, or null if the executable carries no game.

public static bool IsPackaged(string executable)

True if executable carries a game.