Steam API Guide


#1

Hello!
Today, I want to share with the community a guide I wrote that explains how to integrate the steam API into a GDevelop Game.
DON’T QUIT this topic thinking “I’m going to wait for an extension to come out”. There will probably never be an extension for this as it would require to rewrite major parts of GDevelop to support that. This guide is and will be the only way for a long time at least.
Warning: This guide is also complicated. Do not expect it to be easy.
Link: https://1drv.ms/w/s!Ah5q32nu2JG-ri9zU2eVbJ7DbWhQ?e=zRwKWX

Linked Topics

Steam API and Gamejolt API?
Steam achievements
API for native games (Steam, GameJolt, GooglePlayGames)


#2

While I probably won’t do this until a few years later (therefore won’t read it much yet), great job! I’m especially amazed since what I know so far, GDevelop 5 is a web browser running javascript extensions to make the game engine happen, and thought Steam API is only possible on “native” games (something like OpenGL, DirectX, or Vulkan), rather than HTML5.
Thanks for proving me wrong.


#3

Yes, the steam API also only works on local PC games, as they use electron who itself uses NodeJS to execute the Js (well actually the GDevelop code is executed by the chrome V8 process (Renderer) but the flag to hook node functions into it was enabled for extensionq like the Filesystem extension so we don’t need to do it in the node (Main) process), and node supports native modules. Those are c/cpp code compiled with Js bindings into an importable module. I explain in my guide how to use greenworks, bindings for the steam API (wich is in cpp) in a GDevelop game.


#4

Congrats!

Even if it’s a bit experimental, i think this documentation and the extension you developped might be present on the wiki. Few years ago, with GD4, i’ve probably spent more than 2 weeks trying to get steam api to work, and failed. A tutorial would have been priceless :slight_smile:


#5

One of my “Nice to have” goals is once I’ve got all the mechanics in the game I’m working on, to dig into how difficult it would be to implement this API to allow for Steam Achievements. Steam Cards aren’t API based (And are just based off game played time) so those are easy. Achievements require this (or I suppose maybe a network call?)


#6

I looked at the web API already. The problem is it won’t work on local games. You need to set up each API key for only one specific adress. To make it work on local games you need this method.


#7

Hi arthuro,

Again, thanks for this contribution.

I’m trying to understand all the steps on this tutorial, but it’s been a bit hard. If I’m not mistaken, this requires you to build your game manually after, for exemple, you added your game’s achievements to the code, right?

In that case, If I want to publish my game on a mac and windows, I would need both a mac and a windows PC to build the game for those OS, is that right? If it is, this is what really frustrates me, because I only have a macbook :(.

It’s sad because it became clear that Steam Achievements plays a HUGE role on sales. I know you said earlier that this may not ever become an extension, but do you still think so?

Anyway, thank you for your guide. If I get a windows pc, I’m surely gonna try to use it.


#8

As a heads up, you can build electron apps for Windows on a mac: https://www.electron.build/multi-platform-build

Hope this helps.


#9

Hey! You can try setting up a CI that automatically builds on each platform for you. They are a bit hard to set up, but that’s the price of steam achivements. I will look in the future to make i easier to integrate.