Steamworks SDK - New extension

We’re creating a new Steamworks SDK extension to replace the old auto-generated extension. The new extension is using manually created bindings to ensure a reasonable and easy to use API (which wasn’t the case with the old one).

The new extension is still a work in progress. Current state of the API can be seen here:

And the extension itself can be found here:

We will gradually add more API functions based on requests from the community. If you are using the old extension then please let us know which API functions you are using so that we can prioritize them in the new extension.

23 Likes

I’ve already sent this to @britzl privately but just to avoid duplication, here’s what I use and need:

  • Achievements (user_stats_set_achievement, user_stats_get_achievement, user_stats_store_stats, user_stats_reset_all_stats, user_stats_request_current_stats, user_stats_get_num_achievements, user_stats_get_achievement_name - possible there are more but these are the ones I have used so far!)
  • The ability to check whether we are on Steam Deck or not (ISteamUtils Interface (Steamworks Documentation)).
  • A listener for the overlay:
steamworks.set_listener(function(self, event, data)
    if event == "GameOverlayActivated_t" then
        --pause game
    end
end)
6 Likes

These are implemented in the new extension.

Here we go; steam.utils_is_steam_running_on_steam_deck()

Here’s steam.set_listener()

6 Likes

Fantastic! Will test as soon as possible. As a heads up, do you expect the transition from the old extension to be seamless, or is there anything particular to look out for?

2 Likes

Yes, hopefully. It should mostly be a matter of changing from steamworks.* to steam.* for function calls. I would specifically look out for naming of constants and the event callback names.

3 Likes

Great, the lackluster Steam support was one of my biggest gripes with Defold! It’s a must-have. Working with the old extension was painful to say the least.

As far as I can tell, the new extension seems to be working perfectly. The game pauses when the overlay triggers, and I’m unlocking achievements as expected. Thank you very much, @britzl.

3 Likes

does steam.init() return if it succeeded or not?
how do you handle if the game is a non-steam release?

Works for the most part for me but can anyone confirm if steam.apps_is_dlc_installed(app_id) work on mac builds?

It will throw an error if it fails:

Perhaps it’s better if it returns false?

yeah, i think a bool return value would be better (and more consistent with other engine functions), i think forcing the use of a pcall should be the last resort option.

Good point. I’ve changed this now.

I’ve fixed the two issues you reported on GitHub!

2 Likes

Has anybody tested the new extension on Linux / Steam Deck? I raised issue Unused variable in steam_userstats.cpp generating warning · Issue #6 · defold/extension-steam · GitHub but not sure if that’s a big deal (it’s just a warning?) so wanted to see if others are getting it to work.

Edit: I’ve at least confirmed the issue is to do with the extension, because a Linux bundle without it runs fine on my Steam Deck.