[SURVEY RESULTS] The 2024 edition of State of Software Modernization market report is published!
GET IT here

Getting started with developing apps on Steam Deck

readtime
Last updated on
September 5, 2024

A QUICK SUMMARY – FOR THE BUSY ONES

TABLE OF CONTENTS

Getting started with developing apps on Steam Deck

Getting started with developing apps on Steam Deck

With Steam Deck becoming increasingly popular, software engineers may be tasked with creating an application that will run on the console. The process, however, has some requirements that must be met so that the application can be recognized as compatible with the console. Some of them may not be obvious and pose challenges: even if the documentation is maintained and evolves with time to cater to developers, the console is still relatively new, and not a whole lot of information is available on the internet, especially when compared to development for other consoles that have been on the market for way longer (and are more popular).

Recently, we’ve been tasked with adjusting our product to run on Steam Deck and meet its requirements. Our product is an Electron-based game launcher designed for desktop users. For those of you who are not familiar with the subject, launchers are used to download game files and updates, manage additional content like DLC (downloadable content) or mods, and manage game settings before launch. They also serve as a platform for advertisements.

Okay, but what will you learn from this piece?

  1. First things first - what is a Steam Deck,
  2. How Proton can become handy for Windows users,
  3. How the verification process for Steam Deck applications works,
  4. The list of requirements for Steam Deck applications.

All of that will contain our observations and challenges encountered while adjusting our project to work on the console. Are you ready? Let’s run with it, then.

What is a Steam Deck?

Steam Deck is a handheld console released by Valve in February 2022. The console uses SteamOS 3, an operating system developed by Valve and based on the Arch Linux distribution. It has 2 modes: gaming mode, which is the default one with its primary purpose of playing games, and desktop mode, acting as a regular computer. You can also connect a mouse, keyboard, and external monitor to it.

One of the most significant advantages of this console is that any game you own on the Steam platform can also be played on your Steam Deck. This is specifically advantageous for PC users because if you use the same account, you can enjoy most of the games on both devices.

Proton

Since SteamOS is based on Linux, any game built for Linux can be run on it natively. However, this is not the case for all games on the market, as many of them have only Windows executables. The good news is that these can also be run using the Proton compatibility layer. Valve develops this software as well and allows Windows games to be run on Linux-based operating systems.

When games are run under the Proton compatibility layer, a Windows-like file structure is created for each game that you use Proton for. It can be found under /home/deck/.local/share/Steam/steamapps/compatdata/<SteamAppId>/pfx/drive_c. What you may also need at some point is that there is a file that stores the version of Proton used for the given game and is available under /home/deck/.local/share/Steam/steamapps/compatdata/<SteamAppId>/version.

When developing our game launcher, we encountered a problem where we needed to access files from the Linux filesystem while being under Proton. They can be accessed as Proton is not an isolated environment. The trick is to use Z:\\drive (all game files are located on C:\\drive) which is symlinked to the Linux root directory. So for example, the normal path on Linux:

/home/deck/.local/share/Steam

is equivalent to this under Proton:

Z:\\home\\deck\\.local\\share\\Steam

Compatibility verification process

Games for Steam Deck are reviewed and rated by Valve. Thanks to that, the users can know which games will work perfectly on their console, which will work just fine, and which are probably best to let go. There are 4 different ratings for games:

  • Verified
  • Playable
  • Unsupported
  • Unknown

A description of all ratings can be found in the documentation. With our product, we went through the verification process 3 times, and it took a couple of days to get a response from the verification team - it lasted from 2 days to a week.

Requirements

If you want to get Verified  rating, your application needs to meet certain requirements:

Controller support

To support Steam Deck’s physical controls, you have different options for handling them.

  • Steamworks SDK - although this is the recommended approach, it has two drawbacks we found problematic. First, it makes us dependent on Steam while our application is not always used in the Steam environment. Second, it is in C++, which is not the language we use every day, and we would need Node.js bindings to use it in Electron.
  • SDL (Simple DirectMedia Layer) - this would be a cross-platform solution that won’t make us dependent on Steam. Still, it has the same drawback as the previous solution with being written in C++.
  • Gamepad API - our application uses Electron. Electron uses Chromium. Effectively, you can use features that are available in Chromium. As simple as that! In our case, this was the easiest solution, so we decided to go for it. You can check how well it interacts with your gamepad by visiting some Gamepad Tester websites like this one.

Text input

Initially, we only cared about running our application under Proton, and after setting focus to text inputs, the on-screen keyboard was showing up out of the box. However, this didn’t work after the new Proton releases and when the application was running natively on Linux. This made us use Steamworks bindings for Node.js and show the on-screen keyboard programmatically whenever a text input is focused.

Resolution support

By default, our application launches with a different resolution than Steam Deck’s native 1280 x 800px. To fill the whole screen, we had to change the resolution for a time when the application was run in gaming mode. However, we’ve encountered a problem with the window size setting “leaking” from desktop mode to gaming mode - when the application that can be run natively on Linux was first launched in desktop mode, it used a smaller resolution by default, and since we saved this setting, it was also used in gaming mode. There was a solution - we needed to disable saving this setting on Steam Deck. Remember that games with native Linux builds use the same files in both desktop and gaming modes.

Text legibility

We struggled a bit with this one because it is not the font size that should never fall below 9px, but the smallest character should not be smaller than 9px. We are almost sure it was not in the documentation when we were implementing changes to our application.

An interesting fact might be that Valve uses some kind of OCR (optical character recognition) to verify whether the requirement is met. It highlights every single visible character, measures its height, and assigns one of three classes: too small (below 9px), acceptable (between 9 and 12px), or good (12px and more).

Proton

Our application must have both Linux and Windows builds; therefore, we had to ensure it worked under Proton. Thankfully, it worked for us except for a library that calculates file sizes. If you’re working on the same thing, remember to check things revolving around the filesystem.

Final thoughts

Steam Deck is still relatively new on the market, which poses some specific challenges. There are only a few resources available, and sometimes, you are the first to experience some sort of problem. This makes resolving it take more time than it takes for well-established technologies.

What is more, as a new equipment, it evolves rather quickly (especially Proton). You need to constantly check if a new version appears and verify whether your application still works under it.

However, what makes things easier is that applications natively use Linux or, when under Proton, mimic being on Windows. This means that if your application works on one of those, it should also work on Steam Deck.

Frequently Asked Questions

No items found.

Our promise

Every year, Brainhub helps 750,000+ founders, leaders and software engineers make smart tech decisions. We earn that trust by openly sharing our insights based on practical software engineering experience.

Authors

Grzegorz Stokłosa
github
JavaScript Software Engineer

A full stack software engineer with 7 years of professional experience. He always strives to make the code as simple and readable as possible while ensuring its maintainability over time.

Grzegorz Stokłosa
github
JavaScript Software Engineer

A full stack software engineer with 7 years of professional experience. He always strives to make the code as simple and readable as possible while ensuring its maintainability over time.

previous article in this collection

No items found.

It's the first one.

next article in this collection

It's the last one.