ENGINE PLUGIN: AGSteam v3.4 (Windows; Linux; Mac OS X)

Started by monkey0506, Thu 27/10/2011 05:05:47

Previous topic - Next topic

Calin Leafshade

This is what is commonly known as "putting the cart before the horse"

C.T.C.B

Quote from: Calin Leafshade on Thu 09/05/2013 22:04:33
This is what is commonly known as "putting the cart before the horse"
Yes, so then I can add all the needed Steam Features (achievements, leaderboard things, etc.) before Greenlight. Meaning that if it is greenlighted, it can be on steam instantaneously.

monkey0506

MORE THAN 120 DAYS LATER, I finally updated the link. By popular demand, in fact. It seems quite a few people are getting their games accepted now through the Greenlight process.

Functions of the current version of the plugin:
Code: ags
  ///AGSteam: Returns the requested Steam stat, or 0.0 on failure.
  float AGSteam.GetAverageRateStat(const string steamStatName);
  ///AGSteam: Returns the requested Steam stat, or 0.0 on failure.
  float AGSteam.GetFloatStat(const string steamStatName);
  ///AGSteam: Returns the requested Steam stat, or 0 on failure.
  int AGSteam.GetIntStat(const string steamStatName);
  ///AGSteam: Returns whether or not the Steam client is running and initialized.
  bool AGSteam.Initialized;
  ///AGSteam: Returns whether the specified Steam achievement has been achieved yet.
  bool AGSteam.IsAchievementAchieved(const string steamAchievementID);
  ///AGSteam: Resets a specific Steam achievement. Returns false upon error.
  bool AGSteam.ResetAchievement(const string steamAchievementID);
  ///AGSteam: Resets all Steam stats.
  void AGSteam.ResetStats();
  ///AGSteam: Resets all Steam stats and achievements.
  void AGSteam.ResetStatsAndAchievements();
  ///AGSteam: Marks the specified Steam achievement as achieved.
  bool AGSteam.SetAchievementAchieved(const string steamAchievementID);
  ///AGSteam: Sets the specified Steam stat to the given value.
  bool AGSteam.SetFloatStat(const string steamStatName, float value);
  ///AGSteam: Sets the specified Steam stat to the given value.
  bool AGSteam.SetIntStat(const string steamStatName, int value);
  ///AGSteam: Sets the specified Steam stat using the given values.
  bool AGSteam.UpdateAverageRateStat(const string steamStatName, float numerator, float denominator);

monkey0506

Quote from: C.T.C.B on Thu 09/05/2013 22:10:10
Quote from: Calin Leafshade on Thu 09/05/2013 22:04:33
This is what is commonly known as "putting the cart before the horse"
Yes, so then I can add all the needed Steam Features (achievements, leaderboard things, etc.) before Greenlight. Meaning that if it is greenlighted, it can be on steam instantaneously.

Sorry I never replied to this before, but Calin was actually quite right on this one. You could come up with the ID names you want to use for your achievements, but every single function call you make through the plugin would fail until you have an entry in the Steam store (which, obviously, occurs prior to release on Steam). Granted, you've probably figured this much out by now, but I'm writing mostly to anyone coming along with the same ideas. Until your game has already been Greenlit, this plugin will do nothing for you. Literally all it does is place a few calls to Steam's servers, so if your game isn't there, if your achievements aren't there, then the request will fail.

Monsieur OUXX

Is there a #macro defined in the plugin so that it's possible to simply enable or disable it in AGS' script?
 

monkey0506

Yeah, forgot to mention it, but it's AGSteam_VERSION. Defined if the game is compiled with the plugin, otherwise it's not.

monkey0506

I'm bumping this for the latest version. In addition to the methods I mentioned previously, this version includes the following:

Code: ags
enum AGSteamScoresRequestType
{
  eAGSteamScoresRequestGlobal, // used to request global leaderboard scores
  eAGSteamScoresRequestAroundUser, // used to request leaderboard scores around the player's best score
  eAGSteamScoresRequestFriends // used to request leaderboard scores for the player's Steam friends
};

///AGSteam: Returns the value of a global Steam INT stat
static int AGSteam.GetGlobalIntStat(const string steamStatName);
///AGSteam: Returns the value of a global Steam FLOAT stat
static float AGSteam.GetGlobalFloatStat(const string steamStatName);
///AGSteam: Returns the name of the current leaderboard (call FindLeadboard first)
readonly static String AGSteam.CurrentLeaderboardName;
///AGSteam: Requests to load the specified Steam leaderboard. This call is asynchronous and does not return the data immediately, check for results in repeatedly_execute.
static void AGSteam.FindLeaderboard(const string leaderboardName);
///AGSteam: Uploads the score to the current Steam leaderboard. Returns false if an error occurred.
static int AGSteam.UploadScore(int score);
///AGSteam: Downloads a list of ten scores from the current Steam leaderboard.
static int AGSteam.DownloadScores(AGSteamScoresRequestType);
///AGSteam: Returns the name associated with a downloaded score. Call DownloadScores first.
readonly static String AGSteam.LeaderboardNames[];
///AGSteam: Returns a downloaded score. Call DownloadScores first.
readonly static int AGSteam.LeaderboardScores[];
///AGSteam: Returns the number of downloaded scores (if any). Call DownloadScores first. Max is 10 scores.
readonly static int AGSteam.LeaderboardCount;
///AGSteam: Returns the current game language as registered by the Steam client.
static String AGSteam.GetCurrentGameLanguage();
///AGSteam: Returns the Steam user's username.
static String AGSteam.GetUserName();


The biggest difference here is support for Steam leaderboards. Again, feel free to ask if further explanation is required for usage.

Crimson Wizard

There seem to be a custom made version for linux.
https://github.com/onitake/agsteamstub
Don't know which functionality it replicates, but apparently it makes it possible to run steam version of Heroine Quest.
In theory this will also make possible to run any other game that requires AGSteam plugin.

monkey0506

#28
Seeing as any games distributed via Steam for Linux will likely have achievements and so forth, it's better to use the official shared libraries for Linux, now that I've made them available. I was working on it back in December but lost track of the files, and in the meantime forgot how rpath works. Now that I got that all sorted out, everything appears to be working (tested on Linux Mint 15). You can thank Mark Lovegrove for breathing down my neck on that one. (nod)




5 April 2014 - Recent changes to the plugin made it possible to crash the game if the Steam client wasn't loaded, which was a major regression from previous versions. That is fixed in both the Windows and Linux versions.

onitake

Quote from: Crimson Wizard on Fri 28/03/2014 07:56:48
There seem to be a custom made version for linux.
https://github.com/onitake/agsteamstub
Don't know which functionality it replicates, but apparently it makes it possible to run steam version of Heroine Quest.
In theory this will also make possible to run any other game that requires AGSteam plugin.
Hi, I'm the author of that plugin.

I apologize for not discussing my intention to write a replacement to the "real" AGSteam beforehand, I wasn't sure how far I would get and if it would actually work out.
It probably would have been better to ask the developers of Heroine's Quest for a Steam-free version instead, but well, I also wanted to learn a bit about programming for AGS myself, so I just went ahead and started replicating the functionality of your plugin.

Since I got everything working quite quickly, I decided to just stuff the code on my github and post a note on the Steam forums. There doesn't seem to be much interest so far, I guess I'm filling a bit of a niche here.
I also posted an update today that stores the statistics and achievements to disk and loads them on startup.

I'm a bit unsure of how to proceed now. Do you think I should rather take the repository down? Or maybe release a binary-only plugin that will only work with Heroine's Quest? Maybe I should ask the developers to make a Linux version lacking Steam integration available on their website... Or is it ok for you if I keep the code publicly available?

monkey0506

You authored that code yourself, and it doesn't reference the Steamworks API, so I have no issues with you leaving the code public. Bear in mind that the Steam for Linux version of AGS games uses the original Windows EXE (meaning, no DRM) and there are official versions of the AGSteam plugin available for Linux. If you want to include other features in your stub then feel free -- I can't tell you what to do with your own code. By comparison, if the Steam client isn't running then the official AGSteam plugin functions should all be no-ops.

huhn_m

hi monkey,

the Link in the fist post of the thread is down, and I would really like to play "The Cat Lady" with achivements. Can you upload the libagsteam (I specifically need the Linux version) plugin with SteamWorks integration again please?
Thanks for your help and support!

Edit: Ok. I took the library from The Samaritan Paradox for now. This one works!

monkey0506

Yes, unfortunately I think I lost my hosting I was using. Haven't really decided what I'm going to do about it yet. May be time to start using my agser.me account...

In any case, I can put up a temporary link if anyone needs it.

Dualnames

Not to be the dick, but please do so, otherwise, I'm going to lock this, same thing happened to the lua topic. If you have the files and send them over to me, I can host them both on my agser.me account and my personal hosting at primordia-game.com which i've paid for a couple of time.
Worked on Strangeland, Primordia, Hob's Barrow, The Cat Lady, Mage's Initiation, Until I Have You, Downfall, Hunie Pop, and every game in the Wadjet Eye Games catalogue (porting)

monkey0506

Dunno why it didn't occur to me before, but since this has an official (non-functioning) open-source stub, I have now uploaded the binaries for the FULL (functional) AGSteam via the stub's downloads page. The DLL is for Windows, of course, and the two SO files are for Linux (the ".32" version being the 32-bit variant, the other being the 64-bit variant).

Dave Gilbert

Hi all. Does this plugin work in 3.3? I've imported it into Technobabylon but when I try to run the game it gives me an illegal exception error.

Crimson Wizard

Quote from: Dave Gilbert on Tue 05/05/2015 21:33:38
Hi all. Does this plugin work in 3.3? I've imported it into Technobabylon but when I try to run the game it gives me an illegal exception error.
It should, "Heroine Quest" was made using 3.3, and it uses this plugin.
What OS do you have this error at? What version of AGS precisely?

monkey0506

Not sure when Dave posted this, but I was chatting with him yesterday and the error seemed to be that he had the wrong version of the Steam API DLL (steam_api.dll) from what the plugin was built against. When I have time I will be sure to download the latest Steamworks and do fresh builds.

He also mentioned that once he sorted that out there were some achievement issues, but as CW said, other games have been released on AGS 3.3 with this plugin, so that could also be related to out-of-date builds. Will update ASAP.

WillG

Has this been tested to work with ags 3.2.1?

proximity

Quote from: monkey_05_06 on Wed 06/05/2015 21:26:55
Not sure when Dave posted this, but I was chatting with him yesterday and the error seemed to be that he had the wrong version of the Steam API DLL (steam_api.dll) from what the plugin was built against. When I have time I will be sure to download the latest Steamworks and do fresh builds.

He also mentioned that once he sorted that out there were some achievement issues, but as CW said, other games have been released on AGS 3.3 with this plugin, so that could also be related to out-of-date builds. Will update ASAP.

Is it going to be suitable for AGS 3.4.0.x ? I mean after you update your Steam builds.
Proximity Entertainment

SMF spam blocked by CleanTalk