Desktop platforms: Linux and macOS
MotaEngine games run on Windows, and on Linux x64 and macOS (Apple Silicon) desktops from the same project: the same scenes, Lua scripts and C++ game module. Linux and Mac games are built from the engine source on that platform: you need a checkout from the motaengine.com portal. The prebuilt Linux SDK tarball is the dedicated-server build (no window, no audio) and cannot make desktop clients.
| Linux | macOS | |
|---|---|---|
| Players need | x64, glibc 2.38 or later (Ubuntu 24.04+, Debian 13, Fedora 39+, Arch, ...), a Vulkan 1.3 driver (Mesa RADV / ANV, NVIDIA 535+), X11 or Wayland | a Mac with Apple silicon (M1 or later), macOS 13 Ventura or later |
| Graphics | Vulkan | Vulkan through MoltenVK (Metal), built into the game |
| Build host | Ubuntu 24.04 (a PC, a VM, or WSL2 on Windows) | a Mac with Xcode |
| Package | dist/<Game>-<version>-linux-x64.tar.gz - unpack and run, no installer | <Game>.app in a signed, notarized dist/<Game>-<version>-macos-arm64.dmg |
| Saves | ~/.local/share/<Game>/Saved ($XDG_DATA_HOME when set) | ~/Library/Application Support/<Game>/Saved |
Sections 1-5 cover Linux, section 6 macOS.
Linux test status: tested on an NVIDIA RTX 4060 (driver 580, Ubuntu 24.04,
X11): the render harness matches the Windows baselines (153 of 153) and the
samples run without errors. On Intel Arrow Lake graphics (Mesa) the samples
run, but one path-tracing scenario (pathtrace_envis) hangs the GPU. Not yet
tested: AMD GPUs, Mesa's NVK driver for NVIDIA, and Wayland sessions.
tools/linux_gpu_test.sh runs the harness and packaged games on each hardware
driver it finds; reports are welcome.
1. One-time setup (Ubuntu 24.04)
sudo apt install clang lld llvm cmake ninja-build git git-lfs glslc pkg-config \
libvulkan-dev libx11-dev libxext-dev libxrandr-dev libxi-dev libxfixes-dev \
libxcursor-dev libxss-dev libxtst-dev libxkbcommon-dev libwayland-dev \
libdecor-0-dev libegl-dev libibus-1.0-dev libudev-dev libdbus-1-dev \
libpulse-dev libasound2-dev
git clone https://github.com/microsoft/vcpkg ~/vcpkg && ~/vcpkg/bootstrap-vcpkg.sh
echo 'export VCPKG_ROOT=$HOME/vcpkg' >> ~/.bashrc
Unpack the engine source somewhere on a Linux filesystem (under WSL2: inside
the distro, e.g. ~/MotaEngine, not on /mnt/c - builds there are many
times slower). Build trees go to ~/mota-build-<Game>-client.
WSL2 works for building and trying games: WSLg shows the window and plays sound, but Vulkan is Mesa's software rasterizer (llvmpipe), so expect 10-20 fps. Judge performance on a real Linux install with a GPU.
2. Build and run
tools/mota is the Linux counterpart of tools\mota.bat:
~/MotaEngine/tools/mota new MyGame --bundle-id com.yourstudio.mygame
cd MyGame
~/MotaEngine/tools/mota build # first build compiles the engine + deps (slow once)
~/MotaEngine/tools/mota run # windowed (--game is added for you)
~/MotaEngine/tools/mota run --headless --frames=120
~/MotaEngine/tools/mota run --config Development
Projects made on Windows need the linux-client presets in their
CMakePresets.json (new projects have them; copy them from
tools/templates/game-project/CMakePresets.json.in otherwise). Run
mota from the folder holding the .motaproj.
Without the CLI: cmake --preset linux-client, then
cmake --build --preset linux-client-debug (or -development, -shipping).
The engine's own samples build at the engine root the same way
(build/.../MotaEngine --project=projects/EmberRun/EmberRun.motaproj --game
with binary dir ~/mota-build-linux-client).
3. Package
cd MyGame
~/MotaEngine/tools/mota package
# -> dist/MyGame/linux/ the game folder
# dist/MyGame-1.0.0-linux-x64.tar.gz what you hand out
package makes a Shipping build and runs --package. Inside the archive
(MyGame-1.0.0/):
| File | |
|---|---|
MyGame | the game executable - links only system libraries (Vulkan loader, glibc, libstdc++); SDL3, audio and everything else are built in |
MyGame.pak | signed, compressed game data (textures cooked to BC7) |
run.sh | starts the game from the pak; extra arguments pass through (./run.sh --windowed) |
install-desktop-entry.sh | adds the game to the desktop's application menu with its icon (this user only); --remove takes it away; run it again after moving the folder |
MyGame.png | the icon (settings.appIcon) |
LICENSE.txt, README.txt | your EULA and player readme, if the project has them |
THIRD_PARTY_NOTICES.md, MOTAENGINE_LICENSE.md | required legal texts - keep them in the archive |
Players unpack the archive anywhere and run ./run.sh (or the menu entry).
Textures are cooked to BC7 (and ASTC) on Linux too; the encoder runs single-threaded there, so projects with many large textures package slower than on Windows.
version and displayName come from the .motaproj settings, as on
mobile (see docs/mobile.md section 1).
4. How games behave on Linux
- Window: X11 or Wayland (SDL picks Wayland when available;
SDL_VIDEODRIVER=x11forces X11). Fullscreen works as on Windows; HiDPI has not been tested on Linux. - GPU: the discrete GPU is preferred, then integrated; a software Vulkan driver (llvmpipe) is used only when nothing else exists, with a warning in the log.
- Audio: PulseAudio / PipeWire, falling back to ALSA (loaded at run
time - nothing to install beyond the desktop's own sound stack).
If a game is silent, check that the desktop's own sounds play: on a machine
with several outputs the default can be the wrong one (a powered-off headset,
or a digital
iec958profile). Pick the output in Settings > Sound. - Gamepads: through SDL, which supports the common controllers; not yet tested on a Linux or Mac desktop.
- Saves and logs:
~/.local/share/<Game>/Saved(Logs/Engine.log,Crashes/, settings, save slots). - Online play: identical to Windows; Linux and Windows players share servers.
5. Testing without a GPU
tools/software_render_ci.sh <path/to/MotaEngine> runs the render harness and
an Ember Run boot on Mesa's software Vulkan driver with SDL's offscreen video
driver - no display or GPU needed (mesa-vulkan-drivers only). Scenarios a
software rasterizer cannot reproduce are listed in
tests/render/software_skip.txt.
Never commit the .spv files a Linux build writes into
engine/rhi/private/vulkan/shaders (Ubuntu's glslc emits different bytes):
git checkout -- engine/rhi/private/vulkan/shaders before committing.
6. macOS
One-time setup (on the Mac)
- Xcode from the App Store (command-line tools alone are not enough),
then
xcode-select -s /Applications/Xcode.app. - CMake, Ninja and glslc, e.g. with Homebrew:
brew install cmake ninja shaderc. - vcpkg:
git clone https://github.com/microsoft/vcpkg ~/vcpkg && ~/vcpkg/bootstrap-vcpkg.sh, thenexport VCPKG_ROOT=~/vcpkg. - MoltenVK (Vulkan over Metal, linked into the game - players install
nothing):
tools/macos/build_moltenvk.shbuilds it (10-20 minutes once) into~/MoltenVK-macos; thenexport MOLTENVK_ROOT=~/MoltenVK-macos.
Put the two export lines in ~/.zshrc.
Build, run, package
tools/mota is the same command on macOS:
~/MotaEngine/tools/mota new MyGame --bundle-id com.yourstudio.mygame
cd MyGame
~/MotaEngine/tools/mota build
~/MotaEngine/tools/mota run
~/MotaEngine/tools/mota package
# -> dist/MyGame/macos/MyGame.app
# dist/MyGame-1.0.0-macos-arm64.zip (the .app, unsigned)
Projects made elsewhere need the macos-client presets in their
CMakePresets.json (new projects have them). The engine itself builds with
cmake --preset macos-client + cmake --build --preset macos-client-debug
(binary dir ~/mota-build-macos).
<Game>.app holds the game (Contents/MacOS), its pak, icon (an .icns
made from settings.appIcon) and the legal texts (Contents/Resources), and
an Info.plist with settings.bundleId, displayName and version.
Double-clicked, it boots the pak inside it. Extra engine arguments:
open MyGame.app --args --windowed.
Signing and notarization
A Mac downloads apps with a quarantine flag, and Gatekeeper only opens them
without a warning when they are signed with a Developer ID certificate and
notarized by Apple. tools/macos/sign_notarize.sh does both:
tools/macos/sign_notarize.sh dist/MyGame/macos/MyGame.app
# -> dist/MyGame/MyGame-1.0.0-macos-arm64.dmg (signed, notarized, stapled)
It signs with the hardened runtime (plus the JIT entitlement LuaJIT needs), builds a DMG with an Applications shortcut, submits it to Apple's notary service, waits (usually minutes, but a team's first submission can take an hour or more) and staples the ticket. One-time setup:
- A Developer ID Application certificate (Apple Developer account, Account Holder role): Xcode > Settings > Accounts > Manage Certificates > +, or developer.apple.com > Certificates with a CSR from the Mac.
- Notarization credentials: create an app-specific password at
account.apple.com, then
xcrun notarytool store-credentials mota-notary --apple-id <you> --team-id <TEAMID>.
Over ssh the login keychain is locked; the script then uses a dedicated
signing keychain if one exists (MOTA_SIGN_KEYCHAIN, unlocked with the
password in MOTA_SIGN_KEYCHAIN_PASS_FILE; defaults
~/Library/Keychains/mota-signing.keychain-db and
~/.mota-signing/keychain-pass).
How games behave on macOS
- GPU: Apple GPUs through MoltenVK. Mesh shaders, hardware ray tracing
and sparse virtual textures are off (as on iOS); everything else, Lumen
included, matches Windows.
--apple-capsmakes a Windows or Linux GPU render with the same feature set, to check a scene without a Mac. - Retina: games render at the display's real pixels. To check this on a
1080p monitor,
tools/macos/hidpi_run.swiftruns a game with the display temporarily in a 2x mode (it restores itself on exit). - Quit: Cmd+Q and the menu's Quit work;
GameContext::canQuitis true. - Saves and logs:
~/Library/Application Support/<Game>/Saved. - Texture cooking (BC7 / ASTC) is not available on a Mac yet: a Mac package ships source textures (same look, more GPU memory).
