# Exporting Games with AeThex This guide covers exporting your AeThex game to all supported platforms: Windows, Linux, macOS, Web (HTML5), and Android. > [!TIP] > Start with web exports for quick testing and distribution. Windows and Linux exports are easiest for desktop games. --- ## Overview AeThex supports exporting to: - **Desktop:** Windows, Linux, macOS - **Web:** HTML5 (WebAssembly + WebGL) - **Mobile:** Android (iOS planned) Each platform has specific requirements and optimization considerations. ```mermaid graph TD Game[🎮 Your Game] --> Export{Export Target} Export -->|Desktop| Windows[🖥️ Windows] Export -->|Desktop| Linux[🐧 Linux] Export -->|Desktop| Mac[🍎 macOS] Export -->|Web| HTML5[🌐 HTML5] Export -->|Mobile| Android[📱 Android] Windows --> Steam[Steam] Windows --> Itch[itch.io] Linux --> Steam Linux --> Itch Mac --> AppStore[App Store] HTML5 --> Web[Web Hosting] Android --> PlayStore[Google Play] style Game fill:#00ffff22,stroke:#00ffff style Windows fill:#ff00ff22,stroke:#ff00ff style Linux fill:#00ffff22,stroke:#00ffff style Mac fill:#ff00ff22,stroke:#ff00ff style HTML5 fill:#00ffff22,stroke:#00ffff style Android fill:#ff00ff22,stroke:#ff00ff ``` > [!NOTE] > Each platform requires specific export templates. Download them from the editor or the AeThex website. --- ## Before Exporting > [!WARNING] > Always test your game in release mode before exporting. Some bugs only appear in release builds due to optimizations and different code paths. ### 1. Test Your Game Always test thoroughly before exporting: ```bash # Run in editor aethex --editor --path ./my-project # Test in release mode aethex --path ./my-project ``` ### 2. Configure Project Settings **Project → Project Settings → Application:** ``` Name: Your Game Name Description: Game description Icon: res://icon.png Version: 1.0.0 ``` **Display Settings:** ``` Window Width: 1920 Window Height: 1080 Fullscreen: false Resizable: true ``` ### 3. Export Templates Download export templates for your target platform: ```bash # Via Studio IDE: Editor → Export Templates → Download # Or manually: wget https://aethex.dev/downloads/export-templates-[version].zip unzip export-templates-[version].zip -d ~/.local/share/aethex/templates/ ``` --- ## Windows Export ### Requirements - **Build Machine:** Windows, Linux, or macOS - **Target:** Windows 7+ (64-bit) - **Export Template:** Windows Desktop template ### Export Steps **1. Add Export Preset:** ``` Project → Export Click "Add..." → Windows Desktop ``` **2. Configure Options:** ``` Export Path: builds/windows/YourGame.exe Architecture: x86_64 Runnable: ✓ (for executable) Embed PCK: ✓ (single file) Code Signing: - Identity: (optional) Your signing certificate - Password: Your certificate password ``` **3. Export:** ``` Click "Export PCK/ZIP" for package only Click "Export Project" for executable ``` ### Windows-Specific Options **Application:** ``` Company Name: Your Company Product Name: Your Game File Version: 1.0.0.0 Product Version: 1.0.0.0 File Description: Your game description Copyright: © 2024 Your Company Trademarks: Your trademarks ``` **Executable:** ``` Console Wrapper: ✗ (disable for release) Icon: res://icon.ico (Windows icon format) ``` **Code Signing:** ```gdscript # Sign your executable (optional but recommended) signtool sign /f certificate.pfx /p password YourGame.exe ``` ### Windows Distribution **Standalone:** - Single `.exe` file - Portable, no installation required - Share via download link or USB **Installer (Optional):** ```bash # Use NSIS, Inno Setup, or WiX # Example with NSIS: makensis installer.nsi ``` **Steam:** ```bash # Use Steamworks SDK # Follow Steam's integration guide # Configure depot builds ``` --- ## Linux Export ### Requirements - **Target:** Ubuntu 20.04+, most modern distros - **Architecture:** x86_64, ARM64 - **Export Template:** Linux/X11 template ### Export Steps **1. Add Export Preset:** ``` Project → Export Click "Add..." → Linux/X11 ``` **2. Configure Options:** ``` Export Path: builds/linux/YourGame.x86_64 Architecture: x86_64 (or arm64) Runnable: ✓ Embed PCK: ✓ ``` **3. Export:** ``` Click "Export Project" ``` ### Linux-Specific Options **Binary:** ``` Strip Debug Symbols: ✓ (reduces size) Make Executable: ✓ ``` **Dependencies:** ```bash # Your game requires these libraries on user's system: # - libGL.so.1 # - libX11.so.6 # - libXcursor.so.1 # - libXrandr.so.2 # - libXi.so.6 # Most modern distros include these ``` ### Linux Distribution **AppImage (Recommended):** ```bash # Create portable AppImage wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage chmod +x appimagetool-x86_64.AppImage # Structure: # YourGame.AppDir/ # ├── AppRun (symlink to your binary) # ├── YourGame.x86_64 # ├── YourGame.desktop # └── icon.png ./appimagetool-x86_64.AppImage YourGame.AppDir ``` **Flatpak:** ```bash # Create Flatpak manifest # Follow Flathub guidelines flatpak-builder build-dir com.yourcompany.yourgame.yml ``` **Snap:** ```bash # Create snapcraft.yaml snapcraft ``` **.tar.gz Archive:** ```bash # Simple distribution tar -czf YourGame-linux.tar.gz YourGame.x86_64 ``` --- ## macOS Export ### Requirements - **Build Machine:** macOS (for signing/notarization) - **Target:** macOS 10.13+ - **Export Template:** macOS template - **Apple Developer Account:** For signing (required for distribution) ### Export Steps **1. Add Export Preset:** ``` Project → Export Click "Add..." → macOS ``` **2. Configure Options:** ``` Export Path: builds/macos/YourGame.zip Architecture: universal (Intel + Apple Silicon) or separate: x86_64, arm64 ``` **3. Code Signing:** ``` Codesign: Identity: "Developer ID Application: Your Name (TEAM_ID)" Certificate Path: /path/to/certificate.p12 Certificate Password: your_password Entitlements: res://entitlements.plist (optional) ``` **4. Export:** ``` Click "Export Project" ``` ### macOS-Specific Options **Application Bundle:** ``` Bundle ID: com.yourcompany.yourgame Display Name: Your Game Version: 1.0.0 Copyright: © 2024 Your Company Icon: res://icon.icns (macOS icon format) ``` **Hardened Runtime:** ``` Enable Hardened Runtime: ✓ Disable Library Validation: ✗ Allow JIT Code: ✗ (unless needed) Allow Unsigned Executable Memory: ✗ Allow DYLD Environment Variables: ✗ Disable Executable Memory Protection: ✗ ``` ### Notarization (Required for macOS 10.15+) ```bash # Sign the app codesign --deep --force --verify --verbose \ --sign "Developer ID Application: Your Name (TEAM_ID)" \ --options runtime \ YourGame.app # Create ZIP for notarization ditto -c -k --keepParent YourGame.app YourGame.zip # Submit for notarization xcrun notarytool submit YourGame.zip \ --apple-id your@email.com \ --team-id TEAM_ID \ --password app-specific-password \ --wait # Staple notarization ticket xcrun stapler staple YourGame.app # Verify spctl -a -vv YourGame.app ``` ### macOS Distribution **Direct Download:** - Distribute `.dmg` or `.zip` - Users drag to Applications folder **Mac App Store:** - Use App Store Connect - Follow Apple's submission guidelines - Use "Mac App Store" export preset **Create DMG:** ```bash # Create disk image hdiutil create -volname "Your Game" -srcfolder YourGame.app -ov -format UDZO YourGame.dmg ``` --- ## Web (HTML5) Export ### Requirements - **Target:** Modern browsers (Chrome, Firefox, Safari, Edge) - **Export Template:** Web template - **Web Server:** For hosting ### Export Steps **1. Add Export Preset:** ``` Project → Export Click "Add..." → Web (HTML5) ``` **2. Configure Options:** ``` Export Path: builds/web/index.html Head Include: res://web/head.html (custom HTML) ``` **3. Export:** ``` Click "Export Project" ``` ### Web-Specific Options **Performance:** ``` WebGL Version: 2.0 (WebGL 2) Enable Run: ✓ (for testing) Full Window Size: ✓ Memory Settings: Initial Memory: 33554432 (32MB) Max Memory: 2147483648 (2GB) Stack Size: 5242880 (5MB) ``` **Progressive Web App:** ``` PWA: ✓ Icon 144x144: res://icons/icon-144.png Icon 180x180: res://icons/icon-180.png Icon 512x512: res://icons/icon-512.png Background Color: #000000 Orientation: landscape ``` **Compression:** ``` Export Type: Regular Gzip Compression: ✓ ``` ### Testing Locally ```bash # Serve with Python cd builds/web python3 -m http.server 8000 # Or with Node npx http-server builds/web -p 8000 ``` Open `http://localhost:8000` ### Web Deployment **Static Hosting (Recommended):** ```bash # Netlify netlify deploy --dir=builds/web --prod # Vercel vercel --prod builds/web # GitHub Pages git subtree push --prefix builds/web origin gh-pages # Firebase Hosting firebase deploy --only hosting ``` **itch.io:** ``` 1. Zip the web folder 2. Upload to itch.io 3. Set "This file will be played in the browser" ``` **Your Own Server:** ```nginx # Nginx configuration server { listen 80; server_name yourgame.com; root /var/www/yourgame; location / { try_files $uri $uri/ /index.html; } # Enable CORS if needed location ~* \.(wasm|pck)$ { add_header Access-Control-Allow-Origin *; } # Gzip compression gzip on; gzip_types application/wasm application/octet-stream; } ``` ### Web Best Practices **Loading Screen:** ```html