Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Showcase / Steam API Plugin

Author
Message
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 1st Nov 2017 22:59 Edited at: 20th Dec 2017 06:55
Hello,

I've developed a Steam API plugin that allows AppGameKit Tier 1 apps to have achievements and user stats.
https://github.com/adambiser/agk-steam-plugin
The wiki contains information and a command reference.

There's a sample project in there demonstrating everything this plugin can do right now using Steam's Spacewar test app (480).

Note that if you use this from the IDE, use the latest steam_api.dll and set it and the steam_appid.txt files to be "read only" so the IDE doesn't remove them.

Feed back is appreciated.
This is free for the community to use.

(Since I have been asked, I do have a paypal.me.)

Feel free to check out what I've developed using AGK:
https://fascimania.itch.io/
http://store.steampowered.com/search/?term=fascimania
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 1st Nov 2017 23:51
oh my! thanks adambiser I'll be checking this out as soon as I can tomorrow. And I'll report back.
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 2nd Nov 2017 13:45 Edited at: 12th Nov 2017 21:56
I didn't have a command reference when I initially posted, but there's one on the wiki at github now.

Supertino, most of the explanations in your code snippets are not quite correct. I hope the wiki clarifies the commands better.

Here's a bare minimum, stripped-down example for using the plugin. It initializes the Steam api, loads the user stats, increments the win count (and number of games), and gives the user the 1 win achievement if they didn't already have it.
Blendman
4
Years of Service
User Offline
Joined: 17th Feb 2014
Location: Arkeos
Posted: 2nd Nov 2017 16:06
Hi, its great thanks

I will try it as soon as possible
AGK2 tier1 - http://www.dracaena-studio.com
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 2nd Nov 2017 16:14
@adambiser thanks I've corrected my post, I did have questions about the wording on Steam.Init() and Steam.Initialised() turns out I just misunderstood your example. I have already added all my achievements into my game on Steam & will be testing it in a few hours. Woo!
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 2nd Nov 2017 16:30 Edited at: 2nd Nov 2017 16:55
@Supertino:
I hope it goes well. I haven't had the chance to add achievements to my game, Toxic Terror, yet. I see it working on my profile with the Spacewar test game, so it should be fine. Let me know how things go.

A few more minor corrections:
RunCallbacks() also allows StatsInitialized() to report, which puts it in your "steam\client connection" category rather than "debug".
GetAppID() is a debug command since the game should already have its appid in the steam_appid.txt file and doesn't really need it otherwise.
LoggedOn() returns an int not string.

@Blendman:
Let me know how it goes.

Future plans:
I hope to add leaderboards to this soon. I have a game coming to Steam next week called Boot Hill Blaster that I think could benefit from them since it's an arcade game.
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 2nd Nov 2017 17:36
This is really cool, thanks for sharing I will try it out when I have time!

Another thing you should consider adding is cloud save. Steam thinks this is a good thing to have and it's another one of those things that just looks good on your store page.
PSY
Valued Member
2
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 2nd Nov 2017 18:41 Edited at: 2nd Nov 2017 18:49
Awesome

Thanks alot!

I'll check it out as soon as soon as my game has made enough progress to implement achievements !

I wish my C++ skills would suffice to code such a plugin.
How long did it take you to code this wrapper?
How many lines approx.?
PSY LABS Games
Coders don't die, they just gosub without return
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 2nd Nov 2017 18:43
@Digital Awakening: The auto-cloud feature works for any game, including existing AppGameKit games. (I have it enabled for both of my games on Steam). I don't know what benefits implementing the ISteamRemoteStorage interface would bring.
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 2nd Nov 2017 18:47 Edited at: 2nd Nov 2017 18:49
Digital Awakening
AGK Developer
16
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 2nd Nov 2017 20:00
adambiser:
Thanks for the link to Auto-Cloud, that covers my needs for cloud saves!
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 2nd Nov 2017 20:53
A quick play with this in one of my projects and all seems well, working with on/off achievements and stats/progression achievements.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 2nd Nov 2017 22:30
@Digital Awakening: No problem. Glad they are what you wanted.

@Supertino: Great! This is good to hear.

Also, speaking of progression achievements, I've added another command to the plugin: IndicateAchievementProgress.
It's important to note that this call does not actually set the stat value but just raises a progress notification. The value still needs to be set with a SetStat command. It's also shown in the example program on github.
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 3rd Nov 2017 08:38 Edited at: 3rd Nov 2017 08:38
Keeps getting better thanks for providing this to the community. One thing I cannot test until Sunday is MAC, is this cross platform or just PC?

Last night I finished adding and testing all 15 achievements and it all looks good.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 3rd Nov 2017 12:16
It's only a 32-bit Windows build. I have no Mac on which to develop and I've never compiled anything on Linux before (I have some Linux VMs).
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 6th Nov 2017 09:26
ah well, depending on who you ask MACOS constitutes 3-5% of all steam users, value themselves revealed it was 5% in 2010, most MAC uses bootcamp into Windows if they want to play games.
IBOL
Moderator
14
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 8th Nov 2017 14:29
omg thank you ... if i can get this to work...
DARKHALO2K
15
Years of Service
User Offline
Joined: 4th Sep 2003
Location: UK
Posted: 8th Nov 2017 20:32
Thank you so much for this, adambiser. Excellent work!
AK
1
Years of Service
User Offline
Joined: 13th Feb 2017
Location: NZ
Posted: 8th Nov 2017 23:28
Even though I don't plan to put any games on Steam for a while yet, this is awesome news to hear. Thank you for making this, and for making it free for all of us to use!
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 9th Nov 2017 02:48
@all: You're welcome. I hope it works out for everyone.

I have an update in the works that adds leaderboard support to it. Once that is done, I think I will have added all the functionality to it that I would like to see in the plugin. Hopefully it provides a good start for anyone who feels like expanding it.
IBOL
Moderator
14
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 9th Nov 2017 04:04
Hey, man, thanks a lot for this.

when i compile, it automatically deletes the "commands" text file.

so i set that to "read only", and now it won't compile , saying "failed to delete file " with path and "commands.txt".

like, my editor tries to automatically delete that, so it can't be done.

What's up with that, has anyone else seen this?
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 9th Nov 2017 04:53
@IBOL: You placed this folder inside your App Game Kit 2\Tier 1\Compiler\Plugins folder?

It sounds like you've copied it into your project's folder. The AppGameKit IDE will copy the Plugin DLL into your project folder for you when you #import_plugin.
The IDE only uses the Commands.txt file while compiling. It won't appear in your project's Plugins folder.
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 9th Nov 2017 10:04
@adambiser - yes Leader board would be nice, would open up many idea's I have.
IBOL
Moderator
14
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 9th Nov 2017 13:26 Edited at: 9th Nov 2017 15:10
@adambiser : yes that was it, i misunderstood. (i know you said right there in the document, but i just figured i should put it where i put everything else. i was wrong , but OMG , i just took a step towards completing something i thought was out of reach)

UPDATE:

YES THIS WORKS.

and yes it deserves all caps.

OMG THANK YOU.

adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 9th Nov 2017 15:18 Edited at: 9th Nov 2017 15:19
@IBOL: Glad that fixed things.

@Supertino: Leaderboards are in a development branch and I've implemented a high score table for Boot Hill Blaster.

I need to rework the example AppGameKit project to show a better way of handling the Steam callbacks because a timeout loop is not very efficient.
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 9th Nov 2017 15:54
Woot! I was just looking at Boot Hill Blaster this morning, I am sucker for retro games, had no idea you made it.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 11th Nov 2017 19:48 Edited at: 11th Nov 2017 19:48
Leaderboard support has been moved into the master branch now. You'll need to manually move this folder into App Game Kit 2\Tier 1\Compiler\Plugins.

Please check the wiki for all of the new commands and on how this version reports callback states.

I don't recommend using a timeout loop for callbacks as I had originally suggested. Instead the callback states allow you to handle Steam stuff asynchronously as they should be.

The example has been overhauled and hopefully gives a good idea on how callbacks can be handled (it tries to be verbose, so not everything in the example will actually be needed in your game).

@Supertino: Thanks.
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 14th Nov 2017 16:14 Edited at: 14th Nov 2017 16:14
MikeHart
15
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 20th Nov 2017 06:14 Edited at: 6th Dec 2017 21:50
Adam, this is awesome. Do you have a paypal.me adress so i can buy you a pizza in december?

Thank you for sharing this and more so supporting it.
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 20th Nov 2017 15:43
@MikeHart: Thanks. I'm glad you like it and find it useful.

I do have a paypal.me. Thank you! It is appreciated.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 6th Dec 2017 06:49 Edited at: 6th Dec 2017 06:50
This plugin has been updated.

New commands:
* GetAvatar
* LoadImageFromHandle (2 forms)
* GetAchievementDisplayName
* GetAchievementDisplayDesc
* GetAchievementDisplayHidden
* GetAchievementIcon
* GetAchievementUnlockTime
* GetLeaderboardName
* GetLeaderboardEntryCount
* GetLeaderboardDisplayType
* GetLeaderboardSortMethod
* GetDownloadedLeaderboardEntryAvatar

Renamed commands
* GetNumLeaderboardEntries -> GetDownloadedLeaderboardEntryCount
* GetLeaderboardEntryGlobalRank -> GetDownloadedLeaderboardEntryGlobalRank
* GetLeaderboardEntryScore -> GetDownloadedLeaderboardEntryScore
* GetLeaderboardEntryPersonaName -> GetDownloadedLeaderboardEntryPersonaName

The wiki contains information on the commands. The example AppGameKit project demonstrates the new commands.
PSY
Valued Member
2
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 6th Dec 2017 20:31
What?

This is outstanding...

Excellent work man!


PSY LABS Games
Coders don't die, they just gosub without return
IBOL
Moderator
14
Years of Service
User Offline
Joined: 30th Mar 2004
Location: @IBOL17
Posted: 6th Dec 2017 21:18
wooooooooooooooooo

(this is not spam)
MikeHart
15
Years of Service
User Offline
Joined: 9th Jun 2003
Location:
Posted: 6th Dec 2017 21:50
Hey all, I encourage you to send him a little donation. This plugin helps you out a lot when you target Steam and is well worth the small change you can spare!
Running Windows 7 Home, 64 bit, 8 GB ram, Athlon II X2 255, ATI Radeon HD 4200. Using AGK2 Tier 1.
Wilf
Valued Member
12
Years of Service
User Offline
Joined: 1st Jun 2006
Location: Doha, Qatar
Posted: 10th Dec 2017 09:28 Edited at: 10th Dec 2017 09:29
Absolutely agree MikeHart, this is a very useful plug-in!
PSY
Valued Member
2
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 16th Dec 2017 07:22
Totally agree.

@Adam
I can still use this paypal address of yours, right?


PSY LABS Games
Coders don't die, they just gosub without return
PSY
Valued Member
2
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 19th Dec 2017 06:54
Send you some cash. Enjoy the pizza


PSY LABS Games
Coders don't die, they just gosub without return
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 19th Dec 2017 07:49
Thanks, everyone!

@PSY: Sorry I didn't answer your recent post. My forum subscription email notifications have stopped for some reason.
PSY
Valued Member
2
Years of Service
User Offline
Joined: 3rd Jul 2016
Location: Laniakea Supercluster
Posted: 20th Dec 2017 06:31
No prob, all good ;P


PSY LABS Games
Coders don't die, they just gosub without return
DavidAGK
4
Years of Service
User Offline
Joined: 1st Jan 2014
Location:
Posted: 29th Dec 2017 17:29
So glad you've made this! I'm nowhere near completing my game but fully intend to add to Steam and definitely want to use achievements and perhaps leaderboard etc... Hope you continue to support and develop! When I use it, I will definitely contribute.

Looks like a top job!
Using Tier 1 AppGameKit V2
Started coding with AMOS (Thanks Francois Lionet)
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 31st Dec 2017 16:53
Thanks! There is an update in the works, I'm just not sure when I will be able to finalize it and post to github. Should be soon though.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 2nd Jan 2018 02:36 Edited at: 9th Jan 2018 02:49
Another update. This one focuses on the overlay plus friend lists, groups, and information.

Added:
GetAppName (restricted, see wiki)
IsGameOverlayActive, ActivateGameOverlay, ActivateGameOverlayInviteDialog, ActivateGameOverlayToStore, ActivateGameOverlayToUser, ActivateGameOverlayToWebPage
GetSteamID, GetSteamID64
HasPersonaStateChanged, GetPersonaStateChangedUser, GetPersonaStateChangedFlags
RequestUserInformation
HasAvatarImageLoaded, GetAvatarImageLoadedUser, GetFriendAvatar
GetFriendCount, GetFriendByIndex, GetFriendListJSON, GetFriendGamePlayedJSON, GetFriendPersonaName, GetFriendPersonaState, GetFriendRelationship, GetFriendSteamLevel, GetPlayerNickname, HasFriend
GetFriendsGroupCount, GetFriendsGroupIDByIndex, GetFriendsGroupMembersCount, GetFriendsGroupMembersListJSON, GetFriendsGroupName

Removed:
GetAvatar -> Use GetFriendAvatar(GetSteamID(), size) instead
GetDownloadedLeaderboardEntryPersonaName -> Use GetFriendPersonaName(GetDownloadedLeaderboardEntryUser(index)) instead
GetDownloadedLeaderboardEntryAvatar -> Use GetFriendAvatar(GetDownloadedLeaderboardEntryUser(index), size) instead

Also split the large example into smaller, more specific examples.

There's also a "steam_constants.agc" file that can be added to projects so one doesn't have to track down the constants.

I've started returning JSON strings from some functions and might switch some existing commands to use it instead of using multiple commands for getting the information (GetDownloadedLeaderboardEntry stuff looks like a good contender for example).
GetFriendGamePlayed is a good example and there's a Type definition in steam_constants.agc that can be used for parsing the JSON string.

Next stop: lobbies.
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 8th Jan 2018 05:19 Edited at: 9th Jan 2018 02:48
Another update that adds some lobby commands and an example on how to use some of them.
All examples now also use a new scrollabletextarea.agc file for, well, scrollable text areas.
Again, the wiki has more information on the commands.

Added commands:
GetCommandLineArgsJSON
IsSteamIDValid
GetHandleFromSteamID64

AddRequestLobbyListDistanceFilter, AddRequestLobbyListFilterSlotsAvailable, AddRequestLobbyListNearValueFilter, AddRequestLobbyListNumericalFilter, AddRequestLobbyListResultCountFilter, AddRequestLobbyListStringFilter
RequestLobbyList
GetLobbyMatchListCallbackState, GetLobbyMatchListCount, GetLobbyByIndex
CreateLobby, GetLobbyCreateCallbackState, GetLobbyCreatedID, GetLobbyCreatedResult, JoinLobby, GetLobbyEnterCallbackState, GetLobbyEnterID, GetLobbyEnterBlocked, GetLobbyEnterResponse, LeaveLobby
GetLobbyData, GetLobbyDataCount, GetLobbyDataByIndex, GetLobbyDataJSON, SetLobbyData, DeleteLobbyData, RequestLobbyData, HasLobbyDataUpdated, GetLobbyDataUpdatedLobby, GetLobbyDataUpdatedID, GetLobbyMemberData, SetLobbyMemberData
GetLobbyOwner, GetLobbyMemberLimit, GetNumLobbyMembers, GetLobbyMemberByIndex, HasLobbyChatUpdate, GetLobbyChatUpdateUserChanged, GetLobbyChatUpdateUserState, GetLobbyChatUpdateUserMakingChange
HasLobbyChatMessage, GetLobbyChatMessageUser, GetLobbyChatMessageText, SendLobbyChatMessage
AddFavoriteGame, GetFavoriteGameCount, GetFavoriteGameJSON, RemoveFavoriteGame

Still some more lobby commands to add.
Supertino
1
Years of Service
User Offline
Joined: 22nd Jun 2017
Location: Behind you!
Posted: 8th Jan 2018 10:35
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 9th Jan 2018 02:47 Edited at: 9th Jan 2018 03:34
@Supertino: You're welcome.

Added some more commands and an example for the new music player commands.

The Lobby example now shows a simple "game server" connection through a lobby using AGK's Host/JoinNetwork and related commands I was able to successfully connect to another instance running on a VM, but I think this will run into issues about needing to find the public IP address instead of the device IP.

Added Commands
Lobby:
SetLobbyJoinable, SetLobbyType, SetLobbyOwner, SetLobbyMemberLimit
InviteUserToLobby

GameServer:
GetLobbyGameServerJSON, SetLobbyGameServer, HasLobbyGameCreated, GetLobbyGameCreatedJSON

Music Player:
IsMusicEnabled, IsMusicPlaying, GetMusicPlaybackStatus, GetMusicVolume, PauseMusic, PlayMusic, PlayNextSong, PlayPreviousSong, SetMusicVolume, HasMusicPlaybackStatusChanged, HasMusicVolumeChanged
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 9th Jan 2018 03:33
OK, last update for awhile.

Added Commands
HasGameLobbyJoinRequest
GetGameLobbyJoinRequestedLobby

The lobby example project now shows how to handle game lobby invitations both when in-game and when the game starts as a result of an accepted invitation.
smallg
Valued Member
12
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 9th Jan 2018 18:31 Edited at: 9th Jan 2018 18:42
does this mean it supports steam multiplayer or is this using the AppGameKit networking code?

also step 2 on the "how to install" page says
Copy the steam_api.dll file from here into your project folder.
but there is no steam_api.dll in the download and the link is broken, do i get this from my steam folder somewhere?
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu
adambiser
AGK Developer
3
Years of Service
User Offline
Joined: 16th Sep 2015
Location: US
Posted: 9th Jan 2018 19:04
@smallg: Steam Lobby support is complete from what I can tell. There is no Steam Game Server support at the moment though.
The Lobby example is using AGK's network commands once SetLobbyGameServer is called. It is just a simple test where a network is hosted and joined and members announce their Steam ID persona names to each other.
I have only been able to test this against a VM on my machine logged in as my developer account. I believe the public IP would be needed in order to use this outside of a LAN. I am looking into the Game Server stuff, but it's a pretty big step to take.

I fixed the link for step 2. I separated a large all-encompassing example into smaller specialized examples and forgot to change the link.
smallg
Valued Member
12
Years of Service
User Offline
Joined: 8th Dec 2005
Location: steam
Posted: 10th Jan 2018 09:51
Yh I thought it would be but was just checking as you're talking about steam lobby, good luck if you do try to add full steam multiplayer support though, it would be great addition to agk.
Thanks for fixing the link
life's one big game
spec= 4ghz, 16gb ram, AMD R9 2700 gpu

Login to post a reply

Server time is: 2018-11-13 06:27:56
Your offset time is: 2018-11-13 06:27:56