1
\$\begingroup\$

My team and I released our game on Steam last year for Windows, Mac, and Linux. The game is written in C++ and uses SDL2, including SDL2_image, SDL2_ttf, and OpenGL for graphics. Around the middle of this year, a couple of bugs started affecting the Linux version (and only the Linux version) of the game.

Two different problems have appeared:

  1. All of the text (but none of the other textures) is garbled. Here's a picture:

    Garbled text example

    We're using SDL2_ttf for the text, drawing it to an SDL_Surface, and turning that surface into an OpenGL texture. That last step is what we do for all the images in the game, including the ones unaffected by this bug.

  2. The music is intermittently garbled, with sort of a high-pitched buzzing noise appearing underneath it. We are not using SDL_mixer, just SDL2's built-in sound tools.

I think both bugs are due to a change in the Steam Linux Runtime rather than anything we did, since the Linux release was working fine until some time in early-mid 2022. Probably relatedly, when I run the game with the versions of libSDL2-2.0.so.0 and libSDL2_ttf-2.0.so.0 that come with my distribution's package manager, the bugs go away; it's only the versions that come with the Steam Linux Runtime that cause the problem.

I am compiling the Linux version of the game inside the "Scout" Docker container (https://gitlab.steamos.cloud/steamrt/scout/sdk/-/blob/steamrt/scout/README.md), so I don't think I'm linking against the wrong versions of the static parts of these libraries.

It would be great to have a fix for these bugs. But, since the problems are fixed with one version of both of these libraries, it would also be fine if I understood how to package them properly. They have more dependencies than the Steam Linux Runtime versions, so they're not really suitable for packaging with the game as is. Does anyone know how I could compile them to have as few dependencies as the SLR versions, or have any suggestions in general for what I should do about this?

Thanks so much, and let me know if I can provide any more information.

\$\endgroup\$
3
  • \$\begingroup\$ Perhaps you rely on SDL_ttf outputting surfaces in a certain format (when feeding them to GL), but don't check the format? \$\endgroup\$ Dec 17, 2022 at 21:55
  • \$\begingroup\$ We actually just last night ended up solving the text issue! (I'm happy to edit the question to reflect this, although I don't know if that's the way things are done around here.) It was basically what you said, with the added wrinkle that SDL_TTF 2.0.15 returns the surface in a different format from all other versions, which is why we didn't notice until Valve swapped their library out. The sound problem is still mysterious. \$\endgroup\$ Dec 18, 2022 at 16:40
  • \$\begingroup\$ The canonical thing to do is to post an "answer" below, and edit any details into it. Then pressing a checkmark next to an answer once you figure out the final solution. \$\endgroup\$ Dec 18, 2022 at 16:44

0

You must log in to answer this question.

Browse other questions tagged .