Skip to content

Shipping ​

Permissions ​

By default a project can do anything. List Permissions in Gamma.json and it can only reach outside the game in those ways:

json
{ "Permissions": ["Http", "Files"] }
PermissionGuards
HttpHttp:GetAsync, Http:DownloadAsync, Http:CreateWebStreamClient, and setting an asset to a URL (Image.Source, MeshPart.MeshId, MeshPart.TextureId)
FilesEvery Files method
ProcessProcess:RunAsync, Process:GetEnvironmentVariable
SerialSerial:GetPorts, Serial:Open
LocationLocation:GetLocationAsync
NetworkNetwork:StartServer, Network:Connect

Other members of those services still work. A guarded call without its permission errors with what to add:

Files.ReadFile needs the Files permission; add "Files" to Permissions in Gamma.json

"Permissions": [] allows none. Leaving it out allows all, so older projects keep working.

Running code you don't trust. Put --sandbox before the path: Gamma run --sandbox <Folder> or Gamma play --sandbox <Folder>. Then a project gets only what it declares, and a project that declares nothing, a single script or a place file gets nothing.

Place files are checked too: a place that sets an asset to a URL without Http fails to load. Paths inside the project need no permission. An exported game keeps its project's permissions, and its update check needs none.

Exporting ​

sh
Gamma export MyGame dist/MyGame

Writes one executable that holds the engine and the project. It copies the Gamma you run it with, so on Windows export with the static build (build/static/Gamma) to get a single file; other Windows builds need their DLLs next to it.

  • The folder needs a main file.
  • Hidden files and folders (.git, .env), build, node_modules and earlier exports are left out. .luaurc files are kept for their aliases.
  • On first start the game unpacks itself into a folder of its own and reuses it after that.
  • No console window on Windows. Keeps the execute bit on Linux and macOS.
  • An exported game takes play's flags, like --frames and --window (see the CLI).

Not done yet:

  • Cross-platform export. You get the platform your Gamma was built for. Export once per platform, for example with the builds the release workflow attaches.
  • A window from a headless build. A game exported from headless runs without one, and export warns you.
  • Icons and version info. None on Windows, and no macOS app bundle.
  • Hiding the source. Luau and Gama files are packed as-is and compiled at run time, so players can read them.
  • Compression. Big assets make a big executable.
  • Code signing. SmartScreen and Gatekeeper may warn.

Updates ​

An exported game can update itself. Set UpdateManifest in Gamma.json to a URL, and the game fetches it on every start, in the background:

json
{"Sha256": "<the executable's SHA-256>", "Url": "https://example.com/MyGame.exe", "Version": "1.1"}

Write the manifest with:

sh
Gamma manifest dist/MyGame 1.1 https://example.com/MyGame.exe dist/manifest.json

If the digest isn't the running executable's, the game downloads the new build, checks the digest, and asks the player whether to update and restart. Yes: it swaps in the new executable, closes normally (so Run:BindToClose runs) and starts the new one. No: it asks again next start. Failures are printed and otherwise ignored.

  • Both URLs must be https, file, or http to localhost, since the only check is the digest.
  • Saved data is keyed by the game's name, so it carries over.
  • Windows can't overwrite a running executable, so the old one becomes <Game>.old and is deleted next start.
  • The game's folder must be writable. A game in Program Files can't update itself.
  • Runs with --screenshot or --frames never check.
  • New builds aren't signed, so SmartScreen may warn about each one.

Apache License 2.0