How To Publish A Linux SDL2 Game To Valve's Steam Game Client?

Hi,

Can someone with experience explain the best method to
publish a Linux SDL2 game to Valve’s Steam game client?

Game requires:

  • SDL2
  • SDL2_Image
  • SDL2_Mixer
  • SDL2_TTF

Game is about ready to be released next month, but supporting Linux seems difficult.

You can grab the entire project on GitHub below:
https://github.com/SLNTHERO/TetriCrisis_4_110Percent_A.I._Turbo

Let us know, thanks!

Jesse

Okay, here’s the super-fast rundown:

  • On a Linux machine, install the Steam Runtime SDK. What this gets you is a build environment that is isolated from whatever’s on the actual Linux box. Whatever you build in here will work on basically any reasonable Linux distribution produced in the last decade. “Unreasonable” Linux distributions are hard to quantify exactly, but we can just summarize them as Not Your Problem.
  • Using the Steam Runtime SDK is no different than using any other Linux command line interface, which is to say: if you already do that, you can just drop in and use it. If you don’t already do that, it’s just as much of a learning curve as Unix is in general. But you can probably just write a Makefile/CMake project and limit your time in this environment to a couple of simple commands, or automate the build process in various ways, including just having a GitHub Action handle all this for you. Someone’s going to have to port, test and debug the Linux version if this hasn’t already been done, and honestly that means someone is going to have to get their hands dirty running Linux at some point, though. Plan accordingly.
  • The Steam Runtime SDK provides several popular libraries, including SDL2 and all the SDL2_* libraries you mentioned, so you can just link against them and it’s fine.
  • On Linux (and only on Linux! Not Windows or macOS), the Steam Client provides “the Steam Runtime,” which is basically all these libraries you had in the Steam Runtime SDK. Which is to say it promises a reasonable set of functionality is available to your Linux game running on Steam. Which is to say: unlike Windows and macOS, you do not ship any of these libraries with the game on Steam. Users can override the Steam Runtime with their own copies of libraries, but (my attitude is) when that breaks, that’s also Not Your Problem.
  • You upload your Linux game to Steam the same way you upload the Windows version (through steamcmd or whatnot). The Linux version exists in a separate depot within the same game ID. Ideally you have one depot with the game data, one with just Windows-specific stuff (the .exe file, etc), and one with just Linux-specific stuff (the game binary, etc), but some games have been known to just have a separate copy of the whole thing in each depot. If you set it up to be a common depot and a platform-specific one, Steam will know to grab the appropriate files from both. There’s a lot of little things you need to tweak on the Steam partner website to get this right, both on the store page and the depot configs, and it’s way beyond the scope of this post, but go over everything twice once you get in there.

Hi,

Thanks for the information…

If I build the SDL2 game on my Linux(Manjaro KDE 64Bit),
will that executable run on ALL Linux distributions?

Thanks!

Jesse

If you build it in the Steam Runtime SDK environment on that Manjaro installation, yes. If you don’t, it’ll require whatever version of libraries are currently on your Manjaro install, which may or may not work on a given Linux system.

Ok, got it…
We have some time to do this…
Game will release on Steam sometime next month…

Thanks for your help!

Jesse

Hi,

Need some help…

I managed to download the Steam Runtime SDK for Linux.
I am using “Manjaro KDE” Linux in a VirtualBox VM.

I downloaded the current build of the game on GitHub and loaded the project into Linux Code::Blocks.
I don’t know how to proceed…

I need to “#include” the Steam Runtime in game’s source but don’t know what to type.
Any help would be appreciated, thanks!

Jesse

Sorry for all these ridiculously stupid questions…
…I’ve been using Linux for over 10 years and don’t know anything about it…