Exporting to Linux and the Steam Deck

21

Stats

818 visits, 1,261 views

Tools

Translations

This tutorial hasn't been translated.

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Published on 1 Oct, 2024. Last updated 19 Nov, 2024

Construct can export your project as a Linux desktop app based on the Chromium Embedded Framework. This is basically a copy of the Chrome browser engine (Chromium) that runs your project. In other words it's very much like having your project run in Chrome, but without the user needing to have a specific browser installed on their computer, and without the browser parts showing like the address bar so it looks like a traditional desktop app. This export option also supports the Steam Deck, since it runs a Linux-based operating system (OS).

See also:

Platform support

Construct's Linux export option supports three chip architectures: x64 (i.e. 64-bit Intel-compatible chips typical in desktop computers), ARM (32-bit) and ARM64. The Steam Deck uses the x64 platform, as do most Linux desktop distributions like Ubuntu. Currently the Linux export supports Ubuntu 22.04 LTS and newer, as well as other compatible distributions. The ARM and ARM64 platforms can also run on the Raspberry Pi, since that uses an ARM chip with a Linux-based OS. Newer Raspberry Pi hardware supports 64-bit instructions with ARM64, and we recommend using that with the 64-bit operating system where possible.

Linux export features

Construct is based on browser technology, but the Linux export option does not work exactly the same as a browser. Some of the differences of most interest are:

  • Permission requests, e.g. for the camera, are automatically approved without prompting the user.
  • Some actions which are only allowed after a user input event, such as audio playback and entering fullscreen, can be used unrestricted
  • Navigating to a URL, or opening a URL in a new window, will open the system default browser. This could be a different browser entirely, e.g. Firefox.
  • Accessing the browser developer tools can be disabled
  • You can use the File System plugin to directly access certain folders on disk - such as to read and write files directly to the user's Documents folder with the picker tag "<documents>". See the File System plugin manual entry for more details on that.

Media codec support

Note that as both Chromium (as opposed to the Chrome browser) and Linux are based on open-source projects, proprietary video and audio codecs like H.264 and AAC audio may not be supported. Construct uses the open WebM Opus format for audio by default which is universally supported, so typically the only problem will be with video support. It may be necessary to use an open video codec like VP9 or AV1 to support video playback on Linux.

Exporting

The Linux exporter requires that your project has a valid app ID set. Make sure the ID in Project Properties is filled out before exporting. Typically this is in reverse-domain format, e.g.: net.construct.kiwistory

Downloading versions

Construct automatically downloads the chosen Linux Chromium Embedded Framework (CEF) version when you export. Each version is based off an equivalent Chrome release - for example v129 corresponds to Chrome 129. By default Construct will always use the latest version available.

Linux CEF downloads are also saved locally so each version only needs to be downloaded once. Since the downloads can be large, you may wish to download a version in the background ahead of time. You can do this by clicking the Manage versions... link in the options dialog to open the Linux CEF version manager. You can also download platforms individually skipping the ones you're not interested in, as well as delete old downloads to free up space.

Publishing

When publishing to Linux, it's important to preserve the file permissions. File permissions work slightly differently across operating systems. For example Windows generally recognizes any file ending in .exe as something that can be run. On Linux, executable files have no special file extension, and instead require an "executable" file permission to be set. Windows is not usually aware of this, so if you copy files from Windows to a Linux system, the files may not have execute permission and therefore fail to run. There are a number of other cases where file permissions can be lost depending on the way files are transferred and the source and destination operating system.

To mitigate this, Construct sets all the right permissions for files inside the zip file. Upon extracting the zip file, the permissions are all preserved correctly. This means:

  • It is safe to transfer the exported zip file by any means.
  • Once the zip file is extracted, the files should not be transferred to another system, because the permissions might be lost.

In short, this means you should only extract the exported zip file on the target operating system. (The Steam Deck is an exception - see below.) For example if you export for Linux using a Windows system, you should transfer the exported zip file to the Linux system, and then extract it on the Linux system. This ensures the file permissions are preserved. If you extracted the zip on Windows and then transferred the extracted files to Linux, it could break the app.

Once you've extracted the files on to a Linux system, you can start the app by double-clicking a file with the name of your project. (Remember Linux executable files don't use an extension.)

Fixing file permissions

If you do accidentally lose the executable file permissions for a Linux export, or for some reason you have to transfer files in a way that loses file permissions, you can add executable file permission back by running this command in the terminal:

chmod +x filename

To help make this easier, Construct exports a script named set-permissions.sh which has a list of these commands to set executable permission for every file that needs it. However the script itself must also be made executable. So the easiest way to add the necessary executable file permissions is to run the following commands in a terminal:

chmod +x set-permissions.sh
./set-permissions.sh

Of course, it's easier to extract the zip on the Linux system - this is just a potentially useful tool for advanced uses.

Running on the Steam Deck

The Steam Deck is a Linux-based device using the x64 architecture. Therefore x64 Linux exports from Construct can run on the Steam Deck. Note that this does not require any emulation or compatibility support - it runs directly on the device's own operating system.

When exporting to the Steam Deck, be sure to export for the x64 platform, and check the Start up fullscreen option to ensure the game uses the device's full display.

To test your game on a Steam Deck, see the Steamworks documentation on How to load and run games on Steam Deck. In short you'll need the SteamOS Devkit Client on your PC, and to enable Developer Mode on the Steam Deck. Export your project from Construct and extract the zip to an empty folder on your PC. Then in the Devkit Client on your PC, use the "Title Upload" tool to upload the contents of the folder to the Steam Deck. Note that you must:

  • Enter a name for the title
  • Choose the local folder where you've extracted a Construct Linux export
  • The Start Command must be the main executable file, which is the name of your project
  • Construct Linux exports do not require Steam Play, so leave that option unchecked

Click Upload and then the project will be loaded on to the Steam Deck. You should then be able to find your project name in the library, where you can run it and try it out.

Note that it appears the title upload tool automatically applies executable permissions. This means you can follow this process using a Windows PC, and the file executable permissions are in fact preserved - which makes it a lot easier to test your project on the Steam Deck!

Steam integration

To integrate Steam features in a game running on the Steam Deck, use the Steamworks plugin. See the documentation of that plugin for more details.

Using DevTools

Due to the architecture of the Chromium Embedded Framework, accessing developer tools in Linux exports works slightly differently to other platforms. Typically the F12 keyboard shortcut opens dev tools, but this does not work in Linux exports. Instead you need to instead have Chromium installed on the same device, visit chrome://inspect while your app is running, and then it should appear in the list where you can click Inspect to open dev tools for your app. Remember you must have checked Enable DevTools when exporting, otherwise the app will not appear in the list.

Note that this process uses remote debugging. When DevTools is enabled, the Linux app allows remote debugging on port 9222, which is one of the default ports Chromium looks for on the "inspect" page, so it should appear by default. Note that if you have changed the default configuration it may not appear.

Conclusion

Construct's Linux export option provides support for desktop Linux systems like Ubuntu, the Linux-based Steam Deck, and even Raspberry Pi. Remember to take care with file permissions when moving files between devices, and that the system graphics drivers are important to the reliability, performance and quality of games on Linux, including with Construct. If you have any problems, try making sure your system or device is fully up-to-date. Otherwise, if it works in Chromium on the device, it should work with Construct's Linux exporter too!

  • 7 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • Thanks! There's also a far easier way to make playable on Deck:

    1 - Unzip

    2 - Right click game file "add to steam"

    ______________

    Or when publishing to Steam store:

    1 - Upload the zip file on depots page

    • Also, if your game is normally 16:9, I'd recommend doing "scale inner" as the fullscreen setting.

      This way the game is larger and without black bars, as the Deck uses a 16:10 resolution.

  • Where does Linux (CEF) export the save game files for Local Storage so I can set up Steam Cloud for Linux & Steam Deck? - Thanks

      • [-] [+]
      • 1
      • Ashley's avatar
      • Ashley
      • Construct Team Founder
      • 1 points
      • (0 children)

      The Local Storage plugin saves to a database in the app data folder. You shouldn't sync the whole app data folder on Steam Cloud though - usually you just want a small amount of specifically chosen data per user. You can do that with the File System plugin and Steam Auto-cloud - see this documentation for more details.

  • Thanks I am working on small light gun games using the Sinden light gun and it is totally thought to be play on a Steam Deck docked to a TV.

  • Thank you so much! Can’t wait for it to be put in a stable release! I’ve been waiting for this for a long time (:

  • Thank you, useful information here, especially for beginners with Unity like me!