Steam learnings

Hi!

I got a bit longwinded. Feel free to just skip to the questions at the bottom if you don’t care for the background :slightly_smiling_face:.

I plan to release a game on steam which clearly will involve some effort to make that happen. From a java perspective that is a topic that isn’t well documented but clearly many people have done successfully, so I thought I would ask for other peoples experiences and maybe learns from from that (before I ragequit and throw my game in the bin…)

Maybe a bit of background. I developed a libgdx game for mobile, but towards the horrible last 10% got a bit burnt out and took a little timeout. Coming back I decided that I should release it on Steam first, since the game has been developed and tested on Mac all the time and is quite fun that way, so why not?

I have now tested out different approaches where non really worked well.

The things that I think is clear:

  • To reach a lot of eyeballs for PC, Mac and Linux, Steam is really the way to go if you can stomach the initial cost $.
  • Steam setup is not pain-free, but has plenty documentation and is not java specific, so no urgent help is needed there.
  • For java steamwork integration, steamworks4j is the way to go, and is quite clear how that is done except for possibly debugging.
  • For deploying java games to Steam, you bundle (platform specific) jre with the game.

Now for the questions:

  1. Is there any current instructions/guide for the rest of the work to get a java game onto steam, or are you willing to share your findings and gothchas? Only thing I could find was outdated and limited in scope: https://www.gamasutra.com/blogs/ChrisMoeller/20160531/273771/Releasing_The_Hinterlands_on_Steam_LibGDX_Java_game.php

  2. What is the current best tool for packaging a game? Different for different platforms? packr and jpackage looked most promising, but I got non to really work well…

  3. Should one package the game into a platform specific application (.exe, .app, .bin or similar)? Is it possible or even a better solution to just launch the game with “java -jar MyGame.jar” and only package jre and .jar?

  4. Independent 32 and 64 bit versions? Or just one?

  5. How do you persist user-configurations? I used Gdx.files.local(“configs/user-configs.properties”); which works fine for most things (at least PC, Android, iOS) except when packaged into .app using certain packagers…

  6. Lwjgl2 or lwjgl3 (especially for mac)? (I want to be able to set game to fullscreen as well)

  7. What jre version would you suggest to bundle? Different for different platforms? Specifically regarding size, performance, legal aspects and compatibility for lwjgl3, mac and linux and compatibility with packager and lwjgl launch on Mac.

  8. Should one care about compressing the jre and obfuscating my jar?

  9. I will launch my game later for Android and iOS, and Mac version is running in development. Is it worth the extra pain (setup, support and so on) to release for Mac and Linux do you think?

Feel free to answer only some question or just give your input in general. Everything of interest. You gradle script “push to steam” would be much appreciated :smiley:

Greets
Joakim

2 Likes

Good questions that i’m also interested to know.
Off the top of my head, princec and noblemaster have distributed on steam:

Princec is a regular on the forum and noblemaster occasionally drops in. But i imagine that the libgdx forums might have more devs who know about this topic.

About obfuscation, ‘Slay the spire’ was a big success that used java and libgdx. It was modded and extended by the community which helped it become popular so I assume that it was not obfuscated.

1 Like

There’s really nothing to it. Deploy the entire private JRE. Use the latest JRE you can get to work on it (I recommend Azul JDK 15). Use 64-bit. Use LWJGL3. Don’t obfuscate your jars (and indeed, leave the debugging info in there too).

For Linux and Mac you create a bash shellscript to launch the game. For Windows, we made a tiny little JNI launcher in C++.

We have our own Steamworks integration written in JNI (called Steampuppy). We only use a small fraction of the Steam functionality though.

There’s a strong chance you already own one of our games on Steam so just go and look at the deployment… though it has to be said the MacOS ones are probably broken by now, because we use 32-bit and LWJGL2.

2 Likes

Thanks for your feedback. Really valuable. I will go ahead and try that.

@princec What are the reasons for Azul? Not what I am using right now, but I am happy to change if there are some compelling reasons to do so.

Yes I do, and yes I did (just for Mac so far).

I attempted to use jpackage, because there was a gradle plugin to automate it and I don’t have any knowledge on how to do proper packaging for Mac on my own. Did you use a tool for the packaging? I have some horrible problems with double-click on the app for mac just makes the game crash without much hint on why. Trying to debug by executing java -jar using packaged java and my jar lets the game run fine, same as navigating in to the .app and doubleclick the executable that was created by jpackage. So while debugging everything works fine, but not when running normally… It seems to be that Gdx.files.local() or some file access just kills it. Your .sh script look nice in that it also pipes the console output to a logfile. I have no idea how to do that for the jpackage version.

You didn’t mention to package the game for mac. Is that needed or could one just set the bin/java -jar mygame.jar as the execution for Steam?

For me those two sentences do not combine, but I guess it might be time to figure out how to do that…

I will probably attempt jpackage with Azul and try to isolate the file access problem, and maybe that can give something working. Maybe that will save me from writing my own JNI launcher.

1 Like

There was a thing called jsmooth a while back but ISTR it’s restricted to 32-bit so not much use perhaps.

The Mac deployment is literally a .zip of a .app structure, with execute permissions carefully set on the binaries, but Apple keep breaking things and I’ve given up trying to keep up as I don’t have a Mac. I don’t use gradle or maven or any other fragile internetty stuff like that, I ensure I’ve got everything I need to build in the repository after an apocalypse, and use plain Ant to just laboriously put it all together.

We use Azul because of all the OpenJDK implementations it’s the most professionally maintained and easy to get hold of.

2 Likes

Hi, I think I managed to get both Win and Mac versions to Steam. As a bit of a thanks and a way to get it tested, I have sent you both beta-test steam keys. Hope they work and you enjoy the game. Any problem, do let me know.

1 Like