Platform-Specific Code (Steam, Itch, Switch, etc)

I’ve built several small games and extensions, however I’m nearing completion of the first project I’d like to publish with a pricetag. Looking at Steamworks SDK, there’s a ton of stuff to consider like achievements, leaderboards, analytics, trading cards, etc. Steam also offers their own databases for in-game stuff, game servers, and other network-based solutions to common gamedev challenges.

The problem with using all of the features Steam offers is that they will not be generalizable across platforms. For example, I can’t use Steam databases or achievements if I also publish on Itch.

For those of you who have released a game on Steam or Itch or someplace else, what are you thoughts on this? Do you simply detect which platform the game is running on and disable all functionality that is platform-specific? Do you avoid Steam backend technology because it is not generalizable? Do you keep separate branches for each platform on which you release your game?

The only Steam specific thing I implemented was achievements and it was not a lot of work. Whilst Steam recommend you do this, you don’t have to to pass submission.

My main headache was navigating Steamworks itself.

And yes, I made a separate branch for the Steam build.

7 Likes

I too keep it simple and only use achievements. Publishing on Steam/GOG/Switch and most of the code just lives in the master branch with conditionals to handle the different platforms.

I have separate bob scripts for each platform which almost fully automate the builds (I do a tiny manual intervention for GOG).

Used to build for itch in the past but now find it too small to be worthwhile. :frowning:

5 Likes