Publish to the Steam Deck with Construct's new Linux exporter

19
Official Construct Post
Ashley's avatar
Ashley
  • 27 Nov, 2024
  • 1,435 words
  • ~6-10 mins
  • 1,945 visits
  • 1 favourites

We're excited to announce that the latest Construct release r416 introduces a brand-new Linux exporter! This can run on both Linux-based desktop systems like Ubuntu, as well as Raspberry Pi, and most notably the Steam Deck, as that is also a Linux-based device.

Construct previously had some support for Linux with NW.js exports, but this is a new export option we've built ourselves based on the Chromium Embedded Framework (CEF). This has allowed us to improve support for Steam integration, enhance file system integration, support wrapper extensions like Windows WebView2 does, and also support ARM-based Linux devices like Raspberry Pi. Read on to learn more.

Why a new export option?

We originally intended to use Microsoft WebView2 on macOS and Linux: we already use it for Windows with great results, and Microsoft said macOS and Linux support was planned. However earlier this year Microsoft abruptly announced that macOS and Linux support would not be released after all. That meant we had to change plans and come up with a new solution for macOS and Linux. You'll be hearing about our macOS plans in the near future, but for Linux we decided to build a new export option using the Chromium Embedded Framework (CEF). Using the Chromium browser engine on Linux ensures great compatibility with Windows content, as it's the same browser engine used by Chrome, Edge, and WebView2. It also means we maintain in-house support for Linux with our own code, rather than relying on NW.js, ensuring we can improve integration and provide better support.

Steam Deck support

The Steam Deck is a handheld console by Valve, the makers of the popular Steam PC gaming platform. The device system software is essentially a standard Linux x64 desktop system, but customized for a console-like experience. The Steam Deck has good support for emulating Windows games, helping ensure you can play a wide selection of your Steam PC game library on the Linux-based Steam Deck. However its emulation was not good enough to support Microsoft WebView2, so it could not run Construct's Windows WebView2 exports. Therefore we built the new Linux exporter with the specific aim of providing great support for the Steam Deck.

And it works great! Here it is running our Kiwi Story demo game as a Linux export on the Steam Deck.

Kiwi Story running on the Steam Deck as a Linux exportKiwi Story running on the Steam Deck as a Linux export

You can also see a video of this in action at 1m24 in the r416 release video on YouTube.

As it's a real Linux executable, it's not needing to go through Windows emulation, which could improve performance and reliability versus using a Windows export.

Steam integration

We then built the same kind of support for wrapper extensions on Linux as we use for Windows WebView2. This blog describes wrapper extensions in more detail, but in short, they are small bits of native code that provide better integration with the platform. It works a lot like Cordova, with the content running in a webview, but communicating with native code to perform additional tasks that aren't normally accessible from JavaScript in a browser. We used this approach to integrate the Steamworks SDK with the Linux exporter, ensuring you can integrate your game with the Steam Deck. Our Steamworks plugin now supports both Windows WebView2 and the new Linux exporter, and in the near future will support macOS too.

A major advantage of the new exporter is this plugin will be long-term compatible with new CEF versions. A long-standing problem with NW.js is its use of node.js complicates support for integrating native code, and every update to NW.js requires rebuilding Steamworks integration - a constant maintenance headache. With our own Steamworks plugin it will remain long-term compatible and only need updating when we actually change something.

File system integration

Construct's File System plugin allows accessing files and folders on disk from the browser. We recently extended this to support directly accessing special folders like the user's documents folder without needing any picker dialogs or permission prompts in the Windows WebView2 exporter, by using special picker tags like "<documents>". We've also brought this support to the new Linux exporter, so you can also have direct access to files and folders on disk. This is useful for being able to do things like write savegame data directly to disk, as well as integrating with Steam Auto-Cloud to automatically synchronize a folder between devices.

Linux desktop support

Naturally our Linux export also works on Linux desktop systems like Ubuntu. Here it is running Kiwi Story on Ubuntu 22 LTS.

Kiwi Story running on Ubuntu 22 LTS as a Linux exportKiwi Story running on Ubuntu 22 LTS as a Linux export

All the same Steam integration and file system features we mentioned previously are also supported on Linux desktop systems. Linux may not have been a focus for publishing games in the past, but that may be changing with Valve's support for Steam on Linux and SteamOS. It's always nice to have support for more platforms anyway, and so if you are a Linux enthusiast or specifically want to support Linux, then this is a great option. Construct's Linux support supports Ubuntu 22+ and compatible Linux systems. Linux has historically been tricky to support due to the variety of systems out there, but as Google have done the hard work porting the Chromium browser engine to Linux, we think it should work pretty consistently - if it works in the Chromium browser on the system, then Construct's Linux export should work too, as it uses the same browser engine.

Raspberry Pi support

The Raspberry Pi is a small, cheap and flexible single-board computer. It's popular in education and with tinkerers and hobbyists. Recently we got our hands on the latest Raspberry Pi 5 which has been fun to play with!

Our Raspberry Pi 5, with bumper case and active cooler.Our Raspberry Pi 5, with bumper case and active cooler.

The latest Raspberry Pi devices are surprisingly powerful for the form factor and price, and run a Linux-based OS (Raspberry Pi OS). These devices have ARM-based chips - a different chip architecture to most desktop systems - which means software has to be specifically compiled for ARM to support them. Previously NW.js did not provide any ARM support at all, so your only option to run a Construct project on Raspberry Pi was with a web export in the browser. However we've been able to bring support for both 32-bit and 64-bit ARM chips with our Linux exporter. This means for the first time, you can export a Construct project and run it directly on the Raspberry Pi! Here is Kiwi Story running on Raspberry Pi OS 64-bit on the Raspberry Pi 5.

Kiwi Story on Raspberry Pi OSKiwi Story on Raspberry Pi OS

This might be a useful option for making further use of Raspberry Pi in education. Perhaps there are other interesting projects this makes possible too - how about building a Raspberry Pi powered arcade cabinet running a Construct game?

Conclusion

We're excited to now have upgraded support for Linux, and provide better support for publishing to the Steam Deck complete with Steam integration! The support for Linux desktops and Raspberry Pi that come with this are valuable improvements too.

This is part of a longer-term project to move to using our own in-house technologies for Construct desktop exports. As described in our previous blog A new architecture for publishing web content to desktop, this approach brings a range of benefits; however the main change since that blog is with Microsoft no longer planning WebView2 support for macOS and Linux, we have to reach for other solutions like CEF. Ultimately, our aim is to retire support for NW.js and use only our own exporters, as we can provide better support and features for them and avoid a few long-standing pitfalls of NW.js. However we will only take that step when we're confident that having consulted the community the new exporters are up to scratch, and then we will use an LTS release to extend support for NW.js for a while longer.

As mentioned earlier we are also actively working on similar improvements for macOS. We'll also be blogging about that when it's out, so stay tuned! Meanwhile we're excited to see what you build with our new Linux and Steam Deck support - so do let us know what you're building as we'd love to see it! To learn more, you can see our guide on Exporting to Linux and the Steam Deck. And as ever if you want to get started with Construct, try our interactive guided tour and jump in, and maybe one day you will be publishing to the Steam Deck too!

Subscribe

Get emailed when there are new posts!

  • 10 Comments

  • Order by
Want to leave a comment? Login or Register an account!
  • I also updated the Steamworks Plus Addon to work with the Steamworks Addon on Linux:

    construct.net/en/make-games/addons/1124/steamworks-plus

  • This is excellent! Thank you!

  • As soon as the Construct3 update notification appeared, I tested my game on Steam for Linux with CEF, congratulations team for this excellent addition. The King Cat Clicker is officially on Linux🎉

  • Any reason not to migrate to electron if nw.js is deprecated?

  • c'est génial !!!

  • Would be great to resume supporting of the apple mobile services

  • Nice to see better support for Steam deck, this is great! Although have to admit, a little worried to see the stuff about NW.js support, hopefully the alternative export options will have all their issues resolved before NW.js support is dropped

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

      Are there any issues in particular you are concerned about?

      • To think of an example, we're yet to find a way to prevent browser prompts (e.g. "Press ESC to show mouse cursor" on cursor lock) showing, which aren't shown on NW.js.

        Another example, in WebView, pressing ESC while your pointer is locked does not register as a key press (one press unlocks, second press registers). This makes opening a pause menu seem broken. This isn't an issue for NW.js.

        We've also had videos not work as expected on Windows 10 with WebView that work fine with NW.js.

        I think these issues and others I've forgotten to mention are why Construct devs making large/paid games still tend to go with NW.js over the other options. You get the security of knowing a game will behave consistently cross-platform, which you seem to loose when choosing platform specific wrappers. If you could shed some light on all this we would massively appreciate!