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

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

Previous topic - Next topic

monkey0506

The AGSteam plugin serves as an intermediary step between the Steamworks API and the AGS runtime engine. In short, what that means for you is that if you're working on integrating a game into Steam, you can now place Steam-related function calls directly in your AGS code!

Currently the plugin supports Steam achievements, int, float, average rate stats, global int and float stats, and leaderboards. If you need any other Steam features, let me know and I can explore options to get them working properly for you.

Update: I've determined that the usage of the Steamworks API does not violate the non-disclosure agreement with Valve. AGSteam is now open-source!

Note: This plugin will not make Valve accept your game for Steam integration. They still hold the sole hand in that decision. This plugin will not do you any good if your game has not already been accepted for the integration process.

-monkey

Download links

Dualnames

This is fantastic, monkey, also USELESS to me. But we'll see.  ;)
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)

Wonkyth

"But with a ninja on your face, you live longer!"

abstauber

Terrific news indeed!

Now if steam would only accept more freeware games :D

monkey0506

Well Dual and abstauber, if you would take adventure game creation seriously then maybe Steam would accept your games. :D

As I said, this probably won't be the most wildly useful thing ever, but hopefully it will save people time (and perhaps even money) down the road... 8)

Calin Leafshade


tzachs

I wish I would have a need for this plugin one day...  :)


monkey0506

@Calin: Maybe you missed it in my first post, but Valve has a pretty strict license on the Steamworks API. Without access to that the source for this plugin would be pretty useless. It wouldn't compile, and would be barely anything more than the existing AGS Run-time Plugin API. That's why I chose to just make the whole thing closed-source. That and it prevents any issues arising from inappropriate use of my source code in relation to the Steamworks API.

Perhaps I'm being a bit overdramatic or overprotective, but the reason I'm not releasing any part of the source for this is to protect myself. I hope everyone can understand that. If any serious programmers would be willing to (physically) sign a(n) NDA with Valve, then I (acting as MonkeyMoto Productions, Inc.) would be willing to provide access (with you as an "employee" of MonkeyMoto), provided that a Valve contact could confirm that such a business relationship would be allowed.

@tzachs, I'm sure that if you really set your heart to it you could make something that Valve would accept without second thought. :)

And glad to hear the general cry of approval even though (at the moment, at least) the true viable usefulness of this is abysmally low. :D

Calin Leafshade

I dont see why we cant see how the plugin has been implemented.

Sure it wont build but for educational purposes, I cant see how it would hurt.

Just dont release the steam headers and any closed code.


Kweepa

Geez, Calin, are you trying to get monkey into trouble?
His first post says that Valve want to keep the API proprietary.
Even if monkey technically doesn't break the NDA, Valve might decide he's not acting in good faith and you can imagine the consequences. Gemini Rue taken off Steam for example.

Congrats on getting this done by the way monkey!
Still waiting for Purity of the Surf II

Calin Leafshade

I find that *incredibly* unlikely.

And releasing *your own* code for educational purposes cannot break any license.

I specifically said that he shouldnt release Valve's code but releasing his own is neither here nor there.

monkey0506

If you're that interested Calin, just check out whatever documentation Valve offers publicly regarding the Steamworks API. The plugin uses a lot of copypasta in that regard. :P

Actually it's a bit more complicated than that, but you'd get the basic idea. I used the AGSE_FINALSCREENDRAW event in place of a proper main game loop. It polls often enough for my purposes.

suicidal pencil

If I use this plugin, does it mean I have to close the source to games I (attempt to) release on Steam?

and I wonder if this means that we might see a few multiplayer games made in AGS...

monkey0506

1) The plugin is closed-source, that does not mean games made with it have to be. The AGSteam API is publicly available. ;)

2) This plugin does not provide any immediate support for multiplayer functionality, although if you ping and set int/float stats...I suppose it might be perfectly possible to use it that way.

3) I need to update the first post with the Blackwell games - getting on that now!

suicidal pencil

Not immediately supported but doable...that's exactly what I wanted :D What fun would it be if everything I wanted was already there?

I'll see what I can do with this over the course of tonight, I'll report back when I have results.

monkey0506

For the record, unless you already have had at least one game accepted by Steam, then you wouldn't be able to use the plugin, even for testing purposes, as it specifically uses the Steam API for all of it's connections. This plugin really is quite simple internally, but the reason it was written was to provide a generic intermediary between the C++ Steam API and AGScript in your games. Without such a mechanism it would otherwise be requisite to write a custom plugin or engine build for each game you wanted to integrate with Steam. With this plugin however, Dave Gilbert was able to integrate the Blackwell games without having to write any C++.

Calin Leafshade


C.T.C.B

This would be awesome in my game...  :smiley:

C.T.C.B

Quote from: monkey_05_06 on Thu 27/10/2011 05:05:47
So, for those who haven't heard yet, Gemini Rue is now available on Steam! They're even running a special discounted price in celebration of the fact.

Why am I bringing this up? Because Gemini Rue has been brought to Steam courtesy of the AGSteam plugin for AGS.

What is this AGSteam plugin? I'm glad you asked! := It's certainly not Nimbus if that's what you're thinking!

The AGSteam plugin serves as an intermediary step between the Steam API and the AGS Run-time. In short, what that means for you is that if you're working on integrating a game into Steam, you can now place Steam-related function calls directly in your AGS code!

Currently the plugin supports Steam achievements, and float and int stats. If you need average rate stats (or any other Steam features), let me know and I can explore options to get them working properly for you.

I would have loved to make this thing open-sourced too, but Valve is kind of a stickler for keeping their API proprietary. So, there's a pretty strict license on this thing regarding staying the hell away from the source code, but beyond that you're really free to pretty much do as you see fit with this plugin. 8)

Note: This plugin will not make Valve accept your game for Steam integration. They still hold the sole hand in that decision. This plugin will not do you any good if your game has not already been accepted for the integration process.

I'm not entirely sure how useful this will be for the community at large, but if you do get your game accepted for Steam integration and want to use this plugin, please let me know! I'll even keep a list of games that use it as an additional publicity measure! :D

-monkey


Download


Games that use AGSteam! (Get them on Steam now!)

Gemini Rue (Buy)
The Blackwell Legacy (Buy)
Blackwell Unbound (Buy)
The Blackwell Convergence (Buy)
The Blackwell Deception (Buy)
Resonance (Buy)

Also:

The Blackwell Bundle (Legacy, Unbound, Convergence, and Deception)




NOTE: This also relies on the redistributable "steam_api.dll" (which is publicly available as part of the Steam client installation). I'm not going to get into the logistics of bundling that, even though it's publicly available. Just be aware you will need to place both DLLs in your editor folder, and manually copy the steam_api.dll to your Compiled folder (the AGSteam.dll will be automatically copied on compile).

NOTE: (20 August 2012) The version which is currently uploaded is rather badly bugged, which didn't manifest until some changes in the Steam API. I have put a lot of the leg-work into developing a better version of this plugin, but due to the fact that it wasn't needed, I never fully cleaned it up to the point that I'm going to be uploading it in the near future (basically read as: I didn't type up documentation for the revisions...). I believe that I made the fixed version backwards-compatible with the current version, so you should be able to grab it from any of the Steam games listed above (or ask Dave (or anyone who has the games, geeze!) to send you a copy of the DLL).

The link provided in that post isn't working, is there a mirror somewhere? I'd love to use this in my Adventure Game that I want to put on steam after completion.

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

JSH

Is there a way to detect if the steam overlay is open? I'd like to pause the game when that happens, since right now the game responds to mouse clicks and keyboard input when I chat with a friend using the overlay.

My first idea was just to simply intercept the shift+tab key combination in AGS but apparently the shortcut can be rebound in the steam settings...

*edit Not to mention, the overlay can be disabled altogether in the game options in steam too.

Dave Gilbert

The Steam overlay has been one of our biggest issues so far (third only to save game compatibility on updates and the inability to change resolution from within the game). AGS games react in really unpredictable ways when the overlay is activated. The game freezes, or dialog zooms by really fast, or any number of things. My theory, and it's only a theory, is that you are running the game natively in a very small resolution? The overlay is in a higher resolution, so displaying both at the same time tends to have unpredictable results. I've noticed that the higher resolution I run a game in (using the "max nearest neighbor filter" in the later versions of AGS) the fewer problems there are.

As for pausing the game when the overlay is active, I am unsure! It pauses fine when I use the overlay, but as I said the results tend to be unpredictable.

monkey0506

As far as the Steam overlay goes, the latest version of the Steam plugin uses the following code (released as part of the open-source stub):

AGSteamMain.cpp:162
Code: cpp
int AGS_EngineOnEvent(int event, int data)
{
    if (event == AGSE_FINALSCREENDRAW)
    {
        // use this as main_game_loop
        // the screen is drawn every actual game loop anyway
        AGSteam::Stub::GetAGSteam()->Update();
    }
    else if (event == AGSE_KEYPRESS)
    {
        typedef int (*IsKeyPressed_t)(int);
        IsKeyPressed_t IsKeyPressed = reinterpret_cast<IsKeyPressed_t>(engine->GetScriptFunctionAddress("IsKeyPressed"));
        bool isShift = ((data == 403) || (data == 404)); // is pressed key shift
        bool isTab = (data == 9); // is pressed key tab
        bool isShiftTab = ((data == 0x00001111) || // shift+tab as a single key
            ((isShift) && (IsKeyPressed(9) != 0)) || // key is shift and tab is held
            ((isTab) && ((IsKeyPressed(403) != 0) || (IsKeyPressed(404) != 0)))); // key is tab and shift is held
        return isShiftTab; // Claim (Shift+Tab), ignore other keys
    }
    return 0;
}


I added this when working on Al Emmo. I don't recall if Chris said this definitely fixed everything, but it attempts to force the engine to ignore the Steam overlay being opened and closed. As I recall, that seemed to be enough to stop AGS from going crazy in the background. If not, then I might consider having the plugin keep track of whether the overlay is open, but I was afraid of that somehow getting out of sync and causing worse problems. Just to be sure, you are using the latest version of the plugin linked in the first post?

P.S. As you obviously are a Steam developer, I could give you access to the full source code of the plugin if needed.

FNGames

My adventure game, Absent, was released on Steam recently!
http://store.steampowered.com/app/398450

Any chance you could add that one to the list on the front page?

I've updated the games' credits and put you in there for designing the plugin too. :)

JSH

Quote from: monkey0506 on Tue 15/09/2015 22:56:56
P.S. As you obviously are a Steam developer, I could give you access to the full source code of the plugin if needed.

Thanks a ton for the source code, it has saved so much time on my end! :)

Neo_One

If i understood, i don't have to write nothing in the code of my game only copy and paste the .dll library in the main proyect folder, ¿that's correct?.

m0ds

I am hearing of new issues with our game, in places where it has worked fine previously on Linux - is it possible the .so files are out of date compared to latest versions of Linux? Not knowing how Linux stuff really goes, thats the best I can come up with..

monkey0506

Sorry for the unresponsiveness folks. Latest binaries are up with some significant changes. AGSteam now supports unified builds by default (agsteam.dll). If you want to continue using the Steam-specific struct name of "AGSteam" in your game scripts, feel free to use the "disjoint" plugin (agsteam-disjoint.dll) instead. All this really changes is how you call the Steam functions, but the two versions (unified and disjoint) generally shouldn't be used together (theoretically they won't conflict, but there's just no reason to have both since they do the same thing).

@Neo_One: You don't have to even initialize the Steam API to release a game on Steam. A lot of Steam games don't use Steamworks, have no achievements, etc. You only need to use this plugin if you have achievements, and as such, you do have to tell the plugin when the achievements (etc.) should be set. You do this with some simple function calls, such as:

Code: ags
AGS2Client.SetAchievementAchieved("ACHIEVEMENT_01");


Where "ACHIEVEMENT_01" is the API name of your achievement (as set up on the Steamworks backend website). This is how Steam knows that the achievement has been unlocked. You would call this function whenever the player triggers the action that unlocks the achievement.

@Mark: Not sure, I'll look into it. I know Linux has been an on-going issue for you. I will contact you.

Dualnames

Script link failed: Runtime error: unrersolved import 'ASG2Client::SetAchievementAchieved^1'

Some of my users (others have no problems) get this, being unable to run the game at all. I'm using the AGSSteam Plugin only (Windows), any thoughts? It's driving me crazy.

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)

Dualnames

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)

Dualnames

Forgot to say that, the users having the problem are all on Windows, some even have the same exact Windows I'm using, and the issue happens regardless of whether Steam is up and running, or even installed at all. I run the game perfectly fine with Steam closed.
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

I think it's probably this problem. Unfortunately there's no way for the plugin to know which version(s) of the Visual C++ Runtime any given user may have installed, though the engine itself does currently rely on the VC++2008 32-bit Runtime, so that probably would be the safest bet. I will take a look at recompiling all 6 plugins (AGSteam, AGSteamStub, AGSGalaxy, plus the "disjoint" builds of each) later today (hopefully) with VS2008 instead of VS2015.

proximity

Hi. Are Steam Achievements one time thing or do i need to supply them with extra variables to ensure that they are triggered only once ?

For example :

Code: ags
function repeatedly_execute_always() {
    int doitonce=0;
    if (score == 100) {
        if (doitonce == 0) {
            doitonce=1;
            AGS2Client.SetAchievementAchieved("ACHIEVEMENT_01");
        }
    }
}


or is this just enough ? :

Code: ags
function repeatedly_execute_always() {
    if (score == 100) {
        AGS2Client.SetAchievementAchieved("ACHIEVEMENT_01");
    }
}

Proximity Entertainment

monkey0506

Well a function-local variable would always be reset every time the function is called anyway. :P

However, Steam doesn't have any issues with you "setting" an already set achievement, so there's no harm in calling the function more than once. If you're worried about the unnecessary callbacks, you could try to cache the results in-game, but that could easily get out of sync. A more efficient solution might be to use the engine's built-in scoring system, using game.score and GiveScore. You could then have something like:

Code: ags
function on_event(EventType event, int data)
{
  if (event == eEventGotScore)
  {
    if ((game.score >= 100) && (Game.DoOnceOnly("ACHIEVEMENT_01")))
    {
      AGS2Client.SetAchievementAchieved("ACHIEVEMENT_01");
    }
  }
}


Then whenever you call GiveScore and the score exceeds or equals 100, the achievement is set, without having to poll for it every single game loop.

proximity

Quote from: monkey0506 on Sun 20/03/2016 07:03:47
Well a function-local variable would always be reset every time the function is called anyway. :P

However, Steam doesn't have any issues with you "setting" an already set achievement, so there's no harm in calling the function more than once. If you're worried about the unnecessary callbacks, you could try to cache the results in-game, but that could easily get out of sync. A more efficient solution might be to use the engine's built-in scoring system, using game.score and GiveScore. You could then have something like:

Code: ags
function on_event(EventType event, int data)
{
  if (event == eEventGotScore)
  {
    if ((game.score >= 100) && (Game.DoOnceOnly("ACHIEVEMENT_01")))
    {
      AGS2Client.SetAchievementAchieved("ACHIEVEMENT_01");
    }
  }
}


Then whenever you call GiveScore and the score exceeds or equals 100, the achievement is set, without having to poll for it every single game loop.

:grin::grin::grin: No no no :cheesy: I just gave an example to specify what doitonce is. In fact, I was planning to use global variables for that which are easy to use and recognised by all scripts. Additionally, I'm using a bit different scoring system; floats keep track of characters' stats in percent form. So, if calling an unlocked achievement causes no trouble to game-play, i can easily make this :

Code: ags
function repeatedly_execute_always() {
   if (charstat > 99.99) {
     AGS2Client.SetAchievementAchieved("ACHIEVEMENT_01");
   }
}


Thanks for the help monkey0506. That will save me from creating unnecessary variables. I have already tons of them and i wouldn't want to add any if it isn't absolutely necessary.
Proximity Entertainment

Neo_One

At last i'll use the plugin to insert achievement. But i have a question. Wich plugin of the list i  have to download to use it?.

shaun9991

RESOLVED - I MANAGED TO WORK THIS OUT. I missed a checkbox when setting the game up on Steamworks.

I've just released A Date on the Park on Steam, using this plugin. Quite a lot of users are reporting that the game doesn't run - please see this pic for the error report -



Any help is much appreciated! I've looked through the forum and seen that it could be an issue with DLL conflicts or Visual C++ Redistributable for Visual Studio 2015. Do you know if this is the case?

Many thanks,
Shaun
Support Cloak and Dagger Games on Patreon: https://www.patreon.com/user?u=460039

Crimson Wizard

#57
shaun9991, the error itself means that the AGS2Client plugin was not able to load (hence the game cannot use its script commands).

The question is why it happened. I would try to find out whether this plugin has any dependencies, like particular VisualC redistributable package has to be installed.

EDIT: Well, I could not find such information anywhere in this thread, or AGSClient thread (although maybe I missed it, a lot of text there).
However, since you know which plugin dll you are using, you can use dependency walker utility to find out which libraries it requires. Or tell us where we may download the plugin DLL, so that we could investigate.

Dualnames

From personal tests, it's the redistributables. I had my game installed on various OS and when i managed to replicate the problem, it was solved by installing VC libraries.
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)

shaun9991

Hi guys, thanks for your messages.

When I initally released the game on Steam, I had overlooked the fact that I needed to include VC redistributables. When I fixed this it solved 90% of the problems, however, some people are still reporting the same error, and a couple have reported this error: "The program can't start because api-ms-win-crt-runtime-|1-1-0.dll is missing from your computer. Try Reinstalling the program to fix this Problem"

I've packaged the game to automatically download VC2015 and 2008, as well as the latest .NET framework. Is there some other redistributables I should be including here?

Here's a link to the agssteam.dll file the game uses: https://www.dropbox.com/s/3wfys2vpp4j0e8j/AGSteam.dll?dl=0

I ran it through the Dependency checker but I'm not too sure what I'm doing... any help much appreciated!

Thanks
Shaun
Support Cloak and Dagger Games on Patreon: https://www.patreon.com/user?u=460039

Crimson Wizard

I really think plugin author (monkey0506) must specify those requirements, because he should know better what did he use to compile them with.

Anyway, according to dependency walker, following dlls are required for that plugin to work:
MSVCP140.DLL
VCRUNTIME140.DLL
According to what I find in the web, "140" is a version of Visual C 2015. So they probably need that.
There may also be the problem, though, that there are different "sub-versions" of VC2015. At least that was true for VC2008 which is required for AGS Editor: we found that not very VC2008 matches, but one very precise package version, which we now include into AGS installer.

If you won't be able to find out why people who have VC2015 installed still cannot run the game, you may try following solution: uninstall all the visual C redistributables you have on system and reinstall them again step by step, checking whether your game works.
Of course, it is safer to do things like that on virtual machine, if you can make one.

Radiant

Quote from: monkey0506 on Thu 27/10/2011 05:05:47Download for Linux: (64-bit), (32-bit)

Hello! I'm in the progress of releasing a Linux version of Heroine's Quest, and I'm having some trouble getting achievements to work. I've just downloaded the 64-bit plugin from the link above since that's a newer version, but it turns out the 32-bit link above is a 404. Can someone help please?

(edit) ok, I've found the file.

Radiant

The above files cause the game to fail to load, with the error message:

ERROR: ld.so: object '/export/disk1/home/username/.local/share/Steam/ubuntu12_32/gameoverlayrenderer.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

Script link failed: Runtime error: unresolved import 'AGSteam::SetAchievementAchieved^1'

Dave Gilbert

Sorry to necropost. I'm finding a number of users are complaining about the same issue Radiant reported. I usually have to send them a non-Steam build so they can run the game. Did anyone uncover a fix for this? The old link to MS Visual Studio 2015 seems to be broken now.

Crimson Wizard

#64
Quote from: Dave Gilbert on Wed 14/06/2017 19:44:10
Sorry to necropost. I'm finding a number of users are complaining about the same issue Radiant reported. I usually have to send them a non-Steam build so they can run the game. Did anyone uncover a fix for this? The old link to MS Visual Studio 2015 seems to be broken now.

You do not need Visual Studio, you need Visual C++ 2015 Redistributable libraries. or at least that is what I found last time.

I cannot test myself right now because I do not have any games which use this plugin, but I think it might be it:
https://www.microsoft.com/en-us/download/details.aspx?id=52685

I also found this page for all most latest versions of VC Redistributables, so posting just in case:
https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

Also, do you mean they have problem on Linux or Windows (or Wine under Linux)?

Dave Gilbert

It was windows. Thanks CW! I'll pass this link on and see if it works.

Dave Gilbert

#66
Huh. For some users it worked. For some users it didn't. Is there anything else that could be causing this?

edit: I've given Monkey0506 a poke on facebook about these issues and hopefully he will respond!

Crimson Wizard

Quote from: Dave Gilbert on Thu 15/06/2017 16:22:38
Huh. For some users it worked. For some users it didn't. Is there anything else that could be causing this?

Could you tell what exactly is happening? People were mentioning couple of different errors above (and Radiant you referred to was speaking about Linux port).

Dave Gilbert

It's specifically for Windows, and they receive the error "Script link failed: Runtime error: unresolved import 'AGSteam::SetAchievementAchieved^1'"

Radiant

Quote from: Crimson Wizard on Thu 15/06/2017 17:21:45(and Radiant you referred to was speaking about Linux port).

Yes, I don't recall any reports about this happening on Windows.

Dave Gilbert

It's happened to about 5 of my testers so far, all Windows users. :)

m0ds

Well, I'd be surprised if it's overlooked by you, but is agsteam.dll (and steam_api.dll) in your compiled game folder Dave? Without it windows users will get this error. You can remove either dll from a compiled game folder and you get exactly this error. If they're testing through Steam, have them verify game files (and confirm the dll is in their game folder with the EXE) and make sure you've got the dll's included in your depot!

Having both these files, but getting the error, is pretty much confied to Linux, because it's the "libraries". In some instances you can grab libraries from any of your older Linux game builds and copy them over and they might work. Maybe that necessity of updating the actual libraries has crossed over into windows territory and dll's now, I don't know whether they need to be updated. But you may be able to grab the 2 dll's from an older game of yours that used them and try those (for Windows testers)?

monkey0506

#72
I've updated the Windows DLL downloads for AGSteam to avoid the need for any particular C++ runtime to be installed, which was an oversight on my part in the first place. Will work on updating other download links. Sorry for the confusion.

To be clear, if you're replacing "agsteam.dll" from a game which uses "AGSteam" in the game scripts (e.g., AGSteam.SetAchievementAchieved(...)), then make sure to grab the AGSteam-disjoint.dll and rename it to "agsteam.dll".

Radiant

Quote from: monkey0506 on Sat 17/06/2017 08:25:03To be clear, if you're replacing "agsteam.dll" from a game which uses "AGSteam" in the game scripts (e.g., AGSteam.SetAchievementAchieved(...)), then make sure to grab the AGSteam-disjoint.dll and rename it to "agsteam.dll".

I didn't get this comment. What's the non-disjoint alternative then?

monkey0506

Sorry for the confusion. The AGSteam plugin now uses the AGS2Client interface. To make building for multiple clients (e.g., both Steam and GOG Galaxy) simpler, I replaced the game script struct "AGSteam" with "AGS2Client" in both the AGSteam and AGSGalaxy plugins.

Code: ags
AGSteam.SetAchievementAchieved("ACHIEVEMENT_01");


Would then become:

Code: ags
AGS2Client.SetAchievementAchieved("ACHIEVEMENT_01");


The practical upshot to doing this is that if you are using both AGSteam and AGSGalaxy, then you could avoid nastiness such as:

Code: ags
#ifdef AGSteam_VERSION
AGSteam.SetAchievementAchieved("ACHIEVEMENT_01");
#endif
#ifdef AGSGalaxy_VERSION
AGSGalaxy.SetAchievementAchieved("ACHIEVEMENT_01");
#endif


You would just toggle the active plugin and hit rebuild. Hopefully that makes sense.

The "disjoint" builds preserve the client-specific names ("AGSteam" and "AGSGalaxy") in the scripts, so if your game already depends on those scripts you can use the disjoint build of the plugin.

Dave Gilbert

Quote from: monkey0506 on Sat 17/06/2017 08:25:03
I've updated the Windows DLL downloads for AGSteam to avoid the need for any particular C++ runtime to be installed, which was an oversight on my part in the first place. Will work on updating other download links. Sorry for the confusion.

To be clear, if you're replacing "agsteam.dll" from a game which uses "AGSteam" in the game scripts (e.g., AGSteam.SetAchievementAchieved(...)), then make sure to grab the AGSteam-disjoint.dll and rename it to "agsteam.dll".

The link doesn't work. :(

And m0ds: yep the files are in the compiled game folder. If that weren't the case, then NOBODY would be able to run the game via Steam at all. :)

monkey0506

Quote from: Dave Gilbert on Tue 20/06/2017 16:09:53The link doesn't work. :(

Yup. Renamed the project where the downloads were hosted and forgot to update the links. Editing now.

Dave Gilbert

OK got one confirmation from someone who couldn't get it to work before. It now works for her!

Mandle

Monkey, while you are here...

I happen to know that PschoDev has been trying to contact you for a while about technical issues of converting the game "Chronicle Of Innsmouth" to Mac and Linux versions...

Please PM me if you see this and I can get you in touch with them if you are interested...

proximity

Hello. I would like to get a step-by-step guide about implementing Steam Leaderboards to AGS :smiley:
Proximity Entertainment

Radiant

Hi Monkey,

It turns out that earlier versions of the AGSteam plugin support the function GetCurrentGameLanguage, and the current one does not. Could you check if you can put this back in please?

Radiant

Also, one user reports that the plugin causes a crash when the game starts up, causing AGS to abort with a nullpointer exception. Since this isn't happening to other people (to my knowledge) this is probably due to his system setup. Still, perhaps you have an idea what could cause this, and maybe this can be fixed with clever usage of try/catch blocks?

monkey0506

#82
Latest builds

There was an issue reported by Dave Gilbert that has been patched in this version, but I got distracted before I updated links and such. This is only the "unified" build (use "AGS2Client.Function()" instead of "AGSteam.Function()"), but I can make sure that the "disjoint" build is uploaded as well in case you're using that. The issue Dave reported may have been the same one regarding a null pointer, which would occur if Steam failed to initialize (namely, if Steam wasn't running).

I will make sure that GetCurrentGameLanguage is added back to the plugin(s).

Edit: As of this writing, I am uploading the latest builds, which have GetCurrentGameLanguage added back in.

Radiant

Thank you. I would like to keep using the disjoint build for Heroine's Quest but will use the unified build in upcoming games.

Radiant

Ok, so using the unified build, one particular user gets this error when the game starts: "An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x1000122C ; program pointer is -23, ACI version 3.3.0.1162, gtags (0,0)"  Now it works fine on my system (even when not logged in to Steam), but apparently on his system something is failing to initialize and causing a nullpointer exception. His system doesn't have Steam though. Do you have an idea what may cause this?

monkey0506

From what CW has said in your other thread, "program pointer is -23" would indicate that the plugin has already initialized.

The AGSteam plugin is still closed-source due to the Steamworks API licensing, but I believe you also have an NDA with Valve for Steam publishing, correct? If necessary, I can discuss further details in private, but I will say here that the latest version of the AGSteam plugin uses the same main.cpp from the AGS2Client source:

Code: ags
void AGS_EngineStartup(IAGSEngine *lpEngine)
{
    engine = lpEngine;

    if (engine->version < 17)
    {
        engine->AbortGame("Engine interface is too old, need newer version of AGS.");
    }

    AGS2Client::GetClient()->Startup();
    AGS2Client::GetClient()->RegisterScriptFunctions(engine);

    engine->RequestEventHook(AGSE_FINALSCREENDRAW);
    engine->RequestEventHook(AGSE_KEYPRESS);
}


AGS2Client::GetClient() returns a pointer, but it is a statically allocated object, much the same as AGS2ClientStub's implementation (which, incidentally, I realize the function name I just linked to was not renamed, though that's completely inconsequential). There is no possibility that the plugin's initialization is dereferencing a null pointer (short of physical memory corruption or the ilk). All other plugin functions should be checking that Steam was initialized before they do anything. Otherwise they should all be no-ops, the same as the stub.

Is it possible to test this with a newer AGS engine and see if similar results occur? Even without Steam running (at all), I can't reproduce this.

Crimson Wizard

#86
Radiant, I forgot to ask last time, but can user send you crash dump? The version of AGS used is several years old, it might be some error there that was since fixed.

Also, I wonder if this error may occur if some DLL failed to load again.



Radiant

Yeah, sorry. I've asked the player to re-upload it and now I can download it from that same link.

Crimson Wizard

#90
Quote from: Radiant on Sat 19/08/2017 07:37:08
Yeah, sorry. I've asked the player to re-upload it and now I can download it from that same link.

I would need corresponding exe to be certain, but from the limited info I could get from the dump, the exception occured in AGSSteam.dll. Since I do not have its sources or PDBs, I am unable to diagnose this further myself.

According to the dump, AGSSteam.dll and steam_api.dll were loaded at the time this happened.

Radiant

Thanks. Here's the EXE, http://crystalshard.net/test/Heroine's%20Quest.exe (did you need all datafiles with that?)

The first things the game tries to do are
Code: ags
      if (AGS2Client.Initialized) {
        String n1 = AGS2Client.GetUserName ();
        if (AGS2Client.GetIntStat ("endCount") > 0) { ... }


Crimson Wizard

I could only confirm the location indicated by EIP number: the exception occurs at the time plugin's "engineStartup" function is called, which is before any script is run.

monkey0506

After doing some research into Steamworks.NET, I've determined with reasonable certainty that the AGSteam usage of the Steamworks API does not, in fact, breach the non-disclosure agreement with Valve. Or, in any case, the mere existence of a project like Steamworks.NET has brought the relevant information into public domain through no fault of my own, which is all that I agreed to in the NDA anyway. :=

As such, AGSteam is now open-source. Hopefully this will help track down the problem, because as I said, I can't seem to reproduce it myself.

Radiant

Quote from: monkey0506 on Sun 20/08/2017 08:33:56Hopefully this will help track down the problem, because as I said, I can't seem to reproduce it myself.

Well, so far the issue occurs only on one guy's computer; I cannot reproduce it myself either. We do have the .dmp file but other than that I don't really know where to go from here. Suggestions welcome.

monkey0506

I never really learned how to use these DMP files, so I'm not particularly sure myself. Hopefully CW has the time and ability to look into it or help explain the steps needed to proceed.

Radiant

I believe the .dmp file is essentially a stack trace. Given either the application's source code or a debug build (or a .pdb file that contains line number info) of both the .EXE and the .DLL it should be possible to pinpoint which function (or even which line number) caused this nullpointer exception.

CW's earlier post suggests it's inside the DLL's engineStartup function. I'm going to assume that calls AGSteamPlugin::Startup, which calls AGSteamPlugin_Initialize, which makes three calls to the Steam API, i.e. SteamAPI_Init(), GetListener(), and RequestCurrentStats(). Maybe one of these three functions causes an issue, and adding a try/catch block in SteamAPI_Init could help locate this.

Something else that may be worth checking is whether steam_api.dll is outdated; apparently this is version 3.92.72.58 which has a copyright stamp of 2007. Looking over my Steam library I find numerous versions of this file, but none with a higher version number, and they all have (c) 2007.

monkey0506

Quote from: Radiant on Sun 20/08/2017 10:31:50adding a try/catch block in SteamAPI_Init could help locate this

Dereferencing a null pointer won't actually throw a C++ exception, so a try/catch block wouldn't help. Just over a month ago, Steamworks v1.41 was released, while the steam_api.dll included in the latest build is from v1.40, but there is no reason to suppose that this would cause such a failure (Valve expressly states that there is no requirement to upgrade).

Quote from: Radiant on Sun 20/08/2017 10:31:50Something else that may be worth checking is whether steam_api.dll is outdated; apparently this is version 3.92.72.58 which has a copyright stamp of 2007. Looking over my Steam library I find numerous versions of this file, but none with a higher version number, and they all have (c) 2007.

Keeping a C/C++ assembly's version information up-to-date is actually far less common than you might expect. Valve just hasn't bothered with it. The steam_api.dll I have bundled is from Steamworks v1.40, only one version behind the latest release.

Radiant

Quote from: monkey0506 on Sun 20/08/2017 11:20:15
Dereferencing a null pointer won't actually throw a C++ exception, so a try/catch block wouldn't help.
Ok, other idea: add a short function that opens a logfile, writes a line, and flushes/closes (to ensure it's on disk) then have a debug build of the DLL that calls this between every two lines of SteamAPI_Init(). That's the best I can think of short of borrowing the computer of the guy that has this issue :)

monkey0506

#99
Well I did try loading the dump file he uploaded, but Visual Studio just reports that it can't find AGSteam.dll. I have tried browsing to the file (both the unified DLL and the disjoint DLL, including renaming the DLL), but the "Open" dialog just doesn't do anything, while in the background under "Binary load information" it keeps appending the message "Can't find or open the PDB file.", despite the two files being in the same location. Perhaps it's something to do with the PDB being out of date with the DLL the game EXE was referencing, but I didn't think DLLs worked that way.

I'll make a debug build (with logging, as you requested) and upload the DLL and the PDB file.

Edit: You can try this build (rename "AGSteam-disjoint.dll" to "AGSteam.dll") (deleted, see new link in following post) and see what results you get. I tested this with AGS 3.3.0 Final "Default Game" and got no problems, with and without Steam running (obviously, without Steam running the plugin simply did not initialize). I downloaded the EXE you posted above (understanding, of course, that it's not the full game and won't be playable), and it raised some questions.

* Heroine's Quest is still using the "disjoint" build, isn't it? You referenced using "AGS2Client" above. The EXE you posted definitely is using the disjoint build, in any case.

* Was Heroine's Quest rebuilt against this version of the plugin? The EXE you uploaded is looking for "AGSteam::FindLeaderboard^1" which was replaced almost two years ago. I had to inject it back in as a reference to RequestLeaderboard with defaulted parameters.

* Is this the same version of the game that's on Steam? I am installing the game now to do some more testing, but I wanted to confirm if it is indeed the same version.

Even before I reinjected FindLeaderboard, the Steamworks API was definitely initializing successfully before the game totally crashed out, as evidenced by the log file. I deleted the log file a few times to be sure.

QuoteSteam not initialized, calling SteamAPI_Init()
SteamAPI_Init() succeeded, creating UserStatsReceivedListener
UserStatsReceivedListener created, requesting current stats
User stats requested, AGSteamPlugin_Initialize() complete

monkey0506

The long and short of the reply I was about to post is that upon installing Heroine's Quest, running it in and outside of Steam, running it with and without Steam running, and running it directly via the AGS 3.3.0 "acwin.exe", I cannot reproduce a crash of the game using this build of the plugin. I have reuploaded the build to make the process for the user simpler. Have them extract this file on top of the Heroine's Quest files. They must replace "AGSteam.dll" and "steam_api.dll" with the copies enclosed. Then, when they launch the game, a file "agsteam_debug.log" will be created in the game folder. Please have them report back the contents of that file after the game crash (though, honestly, I really suspect that the game won't crash at all).

Radiant


eMTe

I've replaced the files.

Strange thing is the debug.log HAS NOT been created. The error message I get is very similar thoufg, only with different numbers.

Here's the crash file.

https://bitbucket.org/Maciek_Tr/sosnowy-las/downloads/CrashInfo.3.3.0.1162.dmp

One clue about my problems may be(?) that I am using an old system - XP. Morover, due to registration issues (XP is no longer supported) I have to reinstall the system every 4 months. So, could it be that after last reinstallation I am missing some system files which prevent me from running the game? Yesterday, Ive tried to run another game (not an AGS game) and I got the message that I'm missing d3dx9.dll. Didn't have time to download it yet. The question is, could that be the problem, like an outdated version of DirectX, missing dll files or something?

Also, I'm not the techy guy, but all AGS games are built, like, in the same manner, right? Plugins, system requirements needed, etc. So how come this is the only game giving me headaches? This is my first AGS game (and I've played over a hundred of them) that I can't run at all. What's so specific about Heroine's Quest, is it more advanced in certain technical areas?

Radiant

Quote from: eMTe on Sun 20/08/2017 20:06:21The question is, could that be the problem, like an outdated version of DirectX, missing dll files or something?
Yes, absolutely.

QuoteAlso, I'm not the techy guy, but all AGS games are built, like, in the same manner, right?
Actually no. For example, it depends on what version of AGS they're using. Among numerous other things, older AGS games tend to run in 16-bit color mode under DirectX 5, whereas newer games (such as Heroine's Quest) run in 32-bit color mode under DirectX 9.

eMTe

I have directX installed, NET framework installed, seriously I can't say what may be the source of the problem on my part.

HQ is the only AGS game I have on hd with AGSteam and steam dlls, so I still believe this is the problem.

Btw, as I mentioned to you in pm or in the other topic, I was able to run HQ right after it was released, without any problems. Didnt have time to play it though and later I deleted it. Is there any chance the first version of the game, without plugins (I believe it was without them, right?) like it was released first, is still downloadable from some source? Maybe it'll work?

monkey0506

This plugin is being built with Visual Studio 2017 with static linkage to the C++ runtime, so it shouldn't require anything that AGS or Steam don't already depend on. Even if it did, then it should crash much sooner, during the phase where the engine attempts to load the DLL (the plugin). What's happening is that the engine is succeeding in loading the plugin, but then for some reason it's accessing some memory address incorrectly. Which is weird, because the only two pointers being dereferenced are a pointer to a static object and a pointer to an object that the Steamworks API has guaranteed (by the successful return of SteamAPI_Init()) to be valid.

I am already telling the log to flush after every write, but perhaps I'll try closing it after every write operation. The log should be created, no matter what. ??? Curiouser and curiouser.

monkey0506

Please try this version. This will create "agsteam_debug.log" as soon as the "GetClient" function is called, before the AGSteam::Startup function is invoked. The debug log will now print the address of the AGSteamPlugin object and the ISteamUserStats object, which at the very least should verify if one of the pointers is, in fact, a null pointer. This also opens and closes the log file with every write operation, just to fully ensure that the writes are flushed to disk before any crash.

Crimson Wizard

#107
Just in case, I made a quick try, and launched the game exe Radiant sent me earlier with you plugin. Game did not run, because some data is missing, but your plugin managed to create some log anyway:
Quote
AGSteam::GetClient called, returning address '0x0F9946FC'
Steam not initialized, calling SteamAPI_Init()
SteamAPI_Init() failed. Is Steam running and logged in?

that's to confirm that the log is generally working.

BTW, that's strange that it failed to init, because I had steam running on background. Maybe I miss something else.

EDIT: I just realized I have this game in my steam library, so I could download it...

monkey0506

Quote from: Crimson Wizard on Mon 21/08/2017 00:13:44BTW, that's strange that it failed to init, because I had steam running on background. Maybe I miss something else.

If you just launch the EXE Radiant uploaded above then Steam won't detect it as being a Steam game. You can force this by adding a text file called "steam_appid.txt" with only the text "283880" (no quotes) to the same directory as the EXE and plugin. This alerts the Steam API as to which "app" (game) the EXE is when it's being launched from outside of Steam. Or, as you said, you could just install the game via Steam. 8-)

Thanks for letting me know that it's working up to that point on your end CW.

monkey0506

#109
Quote from: eMTe on Sun 20/08/2017 20:06:21I've replaced the files.

Strange thing is the debug.log HAS NOT been created. The error message I get is very similar thoufg, only with different numbers.

Here's the crash file.

https://bitbucket.org/Maciek_Tr/sosnowy-las/downloads/CrashInfo.3.3.0.1162.dmp

Okay, I actually got this dump to load properly! And, this is totally bizarre, but it says that engine is the NULL pointer.

main.cpp:L117


I have no idea what circumstances might lead AGS_EngineStartup to be invoked with a null pointer. :-X If it's helpful, I can make the debug log start as soon as AGS_EngineStartup is entered, but this seems pretty definitively to indicate where the problem is coming from, which has to do with the engine's invocation of the plugin, and not the actual plugin code itself.

Edit: AGSteam-debug-2.zip will create the log immediately after engine has been assigned in AGS_EngineStartup, and will print the value of engine and lpEngine before continuing.

eMTe

Regarding your first link:

The log has not been created again, but here's the dump.

https://bitbucket.org/Maciek_Tr/sosnowy-las/downloads/CrashInfo.3.3.0.1162.dmp

Regarding your second link:

No log again. Dump:

https://bitbucket.org/Maciek_Tr/sosnowy-las/downloads/CrashInfo.3.3.0.1162a.dmp

General question, could it be that XP as a system is the problem itself? After all, the plugins were created rather recently of what I can read, so they were built specifically for supported OSes. Also, not many players use XP anymore. So maybe they have never been tested for old OS like XP.

Does anybody have actual means of testing any of the AGS games using these plugins, under XP?

Crimson Wizard

#111
Quote from: monkey0506 on Mon 21/08/2017 06:13:07
Okay, I actually got this dump to load properly! And, this is totally bizarre, but it says that engine is the NULL pointer.

Monkey, the problem with these mini-dumps is that they do not have full memory contents. Which means that every variable can be displayed as zero. You'd need to make AGS write a full dump (but it will be many megs large, or even hungreds of megs).


Quote from: eMTe on Mon 21/08/2017 08:49:35
Does anybody have actual means of testing any of the AGS games using these plugins, under XP?

I have a Windows XP on a virtual machine, I'll give it a try.

monkey0506

Quote from: eMTe on Mon 21/08/2017 08:49:35No log again. Dump:

https://bitbucket.org/Maciek_Tr/sosnowy-las/downloads/CrashInfo.3.3.0.1162a.dmp

This latest dump is crashing when the std::ofstream is being constructed, citing engine being NULL, but engine isn't even used in that constructor:

Code: cpp
    static std::ofstream ofstream{ "agsteam_debug.log", std::ios::trunc };


AGSteam-debug-3.zip doesn't even use engine in AGS_EngineStartup. Instead, it operates directly on the parameter lpEngine (which should be the same value, regardless). It attempts to create the debug log as soon as AGS_EngineStartup is entered, before any parameters are inspected or touched.

If this crashes, there is one other approach you could try, which is simply running Heroine's Quest with the AGS 3.4.0 engine. To do that, you would need to install (zip archive or installer) AGS 3.4.0, then copy the "acwin.exe" from the AGS folder into the Heroine's Quest folder. Drag and drop "Heroine's Quest.exe" onto "acwin.exe", and it will launch the game using the AGS 3.4.0 engine. The Steam version of Heroine's Quest does run on Windows 7 with the AGS 3.4.0-P4 engine, but I don't have Windows XP installed to test that environment. I'll see if I can get an XP VM running.

monkey0506

Quote from: Crimson Wizard on Mon 21/08/2017 13:43:02Monkey, the problem with these mini-dumps is that they do not have full memory contents. Which means that every variable can be displayed as zero. You'd need to make AGS write a full dump (but it will be many megs large, or even hungreds of megs).

Well in that case, are the dumps even useful at this point? ???

Crimson Wizard

#114
Quote from: monkey0506 on Mon 21/08/2017 13:49:11
Well in that case, are the dumps even useful at this point? ???

They were mainly useful to know the exact point and callstack of crash, which could help reproducing it (sometimes).
I think Chris Jones did not want to surprise users with 100-300 megs large dump (which would also be difficult to send through the internet in the early years of AGS).

You could make another version of the engine which writes full dump, but first make sure that's okay for eMTe to upload huge files :).

monkey0506

#115
Quote from: Crimson Wizard on Mon 21/08/2017 13:58:36You could make another version of the engine which writes full dump, but first make sure that's okay for eMTe to upload huge files :).

Assuming he'll read this, any hint on how to go about "mak[ing] another version of the engine which writes full dump"? I clearly don't know anything about this, so I don't even have any idea where in the engine code (or solution settings, maybe?) that I would go about doing this. Thanks for the explanation.

Quote from: Crimson Wizard on Mon 21/08/2017 13:58:36They were mainly useful to know the exact point and callstack of crash, which could help reproducing it (sometimes).

Oh, and in this case, the dump from AGSteam-debug-2.zip's plugin indicates that the crash occurred at the point that the log file is supposed to be created by the std::ofstream constructor. If the ofstream constructor is actually failing, then presumably I should be able to catch an std::exception, wouldn't you think? I can try and decouple opening the file from the constructor (just initialize the ofstream as an empty object) then put the ofstream.open() call in a try/catch block. I was working on the assumption that the error must be coming from before the ofstream constructor begins, but maybe that's an asinine assumption?

Crimson Wizard

#116
I just reproduced same crash on Windows XP. Dump is created, but log was not.
So this is system-related actually. I wonder if this may be related to standard library configuration, or something like that.
EDIT: also tested with the most recent engine (3.4.1), similar crash at startup, only EIP is different (because engine code has changed).
EDIT3: I just thought I've already seen standard C++ library functions crashing before. That happened when one component of program was linking to debug version of std library and another to release version.


Regarding crash dump, it is created using "MiniDumpWriteDump" function (you can search for it in the engine). If I remember correctly, it is all about flags you pass in. More info may be found here:
https://msdn.microsoft.com/en-us/library/windows/desktop/ms680360(v=vs.85).aspx
http://ntcoder.com/bab/2014/10/14/how-to-create-full-memory-dumps-using-minidumpwritedump/

EDIT2: I am actually thinking we could add a config option to the engine, switching dump type, to avoid the need of different engine builds.

monkey0506

Quote from: Crimson Wizard on Mon 21/08/2017 14:47:28EDIT3: I just thought I've already seen standard C++ library functions crashing before. That happened when one component of program was linking to debug version of std library and another to release version.

Well there are three assemblies to consider here:  acwin.exe, AGSteam.dll, and steam_api.dll. acwin.exe and AGSteam.dll both have static linkage to the STL, though they are different versions of the STL. steam_api.dll... well, it could have dynamic or static linkage to the STL, I'm not really certain that it's documented anywhere. Given that Steam is meant to work on a wide range of systems, it seems probable that they would have static linkage, and the file size of steam_api.dll seemingly supports this, but none of that is a guarantee. Regardless of whether steam_api uses static or dynamic linkage though, would different assemblies using their own version of the STL be problematic? If that were the case then I would think steam_api.dll would be unusable. AGSteam is a single assembly which links against steam_api, so I don't see how any part of AGSteam could have the wrong linkage to the STL, if that's what you were suggesting.

Crimson Wizard

#118
There is something I did not research fully yet, but when I began using VS2015 I learnt that you may need a specific configuration if you want to target Windows XP. May this be related?
https://msdn.microsoft.com/en-us/library/jj851139.aspx

QuoteThe Windows XP platform toolset that's included in Visual Studio is a version of the Windows 7 SDK that was included in Visual Studio 2010, but it uses the current C++ compiler. It also configures project properties to appropriate default valuesâ€"for example, the specification of a compatible linker for down-level targeting. Only Windows desktop apps that are created by using the Windows XP platform toolset run on Windows XP and Windows Server 2003, but those apps can also run on more recent Windows operating systems.

monkey0506

#119
Interesting find, CW. I had done some high-level skimming of MSDN and hadn't come across that particular article (or the enclosed topic). I'll see if I can get something working with that, now that I also have XP installed in a VM.


Edit: Unfortunately, still no dice. Even with the "v141_xp" toolset selected, I get the exact same crash before the plugin is able to create the debug log.

Edit 2: Just to test that the AGSteam assembly itself is working, I've created an executable version of AGSteam. This is meant to test only whether the AGSteam assembly can run successfully on your system. Extract the zip somewhere you have write permissions (e.g., "Desktop/AGSteam-debug/"), then run "AGSteam.exe" from the Command Prompt. You should get exactly this output (the number after "Caching Steam ID:" may actually differ, this is printed by Steam so I'm not sure) in the console window:

Quotecalling engine startup
ofstream.is_open()? true
writing to debug log...
finished writing to debug log
Calling AGSteam::Startup()
Setting breakpad minidump AppID = 283880
Steam_SetMinidumpSteamID:  Caching Steam ID:  76561198046544449 [API loaded no]
AGSteam::Startup complete, calling AGSteam::Shutdown()
AGSteam::Shutdown complete, exiting AGS_EngineStartup
done!

And you should have the much sought after "agsteam_debug.log":

QuoteAGS_EngineStartup called, engine = '0x00000000' (not yet initialized) and lpEngine = '0x00000000'
AGSteam::GetClient called, returning address '0x005738CC'
Steam not initialized, calling SteamAPI_Init()
SteamAPI_Init() succeeded, creating UserStatsReceivedListener
UserStatsReceivedListener created, requesting current stats. SteamUserStats = '0x00CF07B0'
User stats requested, AGSteamPlugin_Initialize() complete

In this case, the engine and lpEngine pointers are meant to be NULL, as the AGS engine isn't even running.

I've tested this on Windows XP, using the "v141_xp" toolset in Visual Studio, and everything appears to be working exactly as expected here. If this also works for you, then my suspicion falls back to the AGS engine failing to load the plugin properly, despite the fact that the crash dump says the DLLs are both loaded.

monkey0506

I realized there were some issues with the changes I made converting "AGSteamStub" to "AGS2ClientStub", but even after I corrected those and rebuilt the stub with the "v141_xp" toolchain, the stub still crashes with the exact same error. Based on the fact that "AGSteam-debug.exe" is running perfectly on Windows XP while both the AGSteam plugin and the stub plugin are resulting in a crash, I really feel that this is an error in the way that AGS is loading the plugin, possibly related to the fact that the plugins are built against a different VC++ runtime (despite static linkage, which is meant to prevent this kind of failure).

Radiant

Ok, so if I understand you correctly, AGS3 games using any kind of plugins will no longer run under Windows XP. Is that correct? Given that XP is fifteen years old by now, I'm actually ok with telling people to do an upgrade, since we now know what's causing it. Thank you both for looking into this issue.

I don't suppose it would help to build the plugin against the same VC++ runtime as the AGS main executable?

Crimson Wizard

#122
I'd say more investigation may be needed. If no plugins were working on Windows XP we would receive reports earlier. That's not hard to test couple of existing plugins too.

Then maybe use some dummy plugin to debug the issue, like stub plugin (which is open source?).

monkey0506

#123
Quote from: Crimson Wizard on Thu 24/08/2017 02:08:18Then maybe use some dummy plugin to debug the issue, like stub plugin (which is open source?).

You might have misunderstood my most recent comments above, but I did actually test this with the stub. The stub does nothing more than register itself with the engine's plugin API. All of the functions are no-ops. But when built with Visual Studio 2017, using the "v141_xp" toolchain, the AGS engine fails to initialize the stub with the exact same error message.

Quote from: Radiant on Wed 23/08/2017 23:16:12Ok, so if I understand you correctly, AGS3 games using any kind of plugins will no longer run under Windows XP. Is that correct? Given that XP is fifteen years old by now, I'm actually ok with telling people to do an upgrade, since we now know what's causing it. Thank you both for looking into this issue.

I don't think it's "any kind of plugins", but I think it must have something to do with the VC++ runtime and the way the AGS engine is loading the plugins. My suspicion is that the engine is somehow expecting the plugin to have the same VC++ runtime libraries as it uses itself. I don't know if this is a limitation of the engine or the way it invokes the plugin functions, but it has always been my understanding that external libraries should be allowed to link against a different C++ runtime, so long as that linked runtime is available (which is the case, due to static linkage).

Quote from: Radiant on Wed 23/08/2017 23:16:12I don't suppose it would help to build the plugin against the same VC++ runtime as the AGS main executable?

I will have to reinstall VS2008 to test this, but I will see what I can find out. (P.S. As an aside, I noted above that I had mucked some things up with the configuration settings of the stub when renaming the project (namely, when using the stub for "disjoint" builds, which I forgot to test). The stub should be able to build against VS2008, and I will upload relevant binaries and source once I'm sure that everything is working there properly.)

monkey0506

#124
I can confirm that the issue is related to the VC++ runtime. Building the stub with VS2008 makes the game playable on Windows XP without Steam achievements. The AGSteam project itself is not currently compatible with VS2008, but I can see about adding the same compatibility measures used by the stub.

The stub download links have been built with VS2008 and work on Windows XP with AGS 3.3.0 engine. It also loads with the AGS 3.4.0-p4 engine, but the mouse goes absolutely insane and is unusable.

eMTe

Thank you all for the efforts. :)

So, where does it leave me, because the talk got too technical? Is it doable to make HQ working under XP, I mean of course it's doable, but is the workload/time/purpose ratio acceptable, like adding few lines of code or is it an absolute waste of time?

Especially with me being the only user reporting the issue. :(

monkey0506

#126
Okay, so this build of AGSteam (built using VS2008) loads on WinXP without crashing, but I don't seem to be getting the Steam API to initialize. This is a release build, not a debug build, so it doesn't include any debug info about what result is returned by the call to initialize Steam. Effectively, it's functioning the same way as the stub at the moment, which is to say that the game is playable, but you won't get Steam achievements.

Technical discussion: I think there may have been some misunderstanding on my part regarding how C++ assemblies with differing ABIs can communicate. And while the core functions are all implemented as free functions, it's possible that they are being mangled in some unexpected way between the different VS versions, or that there is some other ABI incompatibility (probably the changes in the STL would make the ABIs incompatible, I might think). Based on this thread on Stack Overflow, I have some hope that perhaps forcing the DLL exports to use the C ABI instead could solve the runtime issues, though I'm honestly not sure about this. I'll look into porting the stub to the C ABI and see if I can get it to load that way when compiled from VS2017. If I can't, then I'll probably just call it all a wash and only maintain project files for AGSteam (etc.) that match the current AGS project files' VS version.

Edit: Unfortunately, even with every single free function marked as extern "C", the AGS engine is still crashing when trying to load the VS2017 plugin from WinXP. I even went as far as wrapping every single entire file in an extern "C" block (sans #include lines), to absolutely no avail.

monkey0506

I've managed to track this down to the use of "static" variables inside functions. STL, free, and class functions are all working, until it encounters a static definition inside a function. Using the more traditional approach of static struct/class members with external storage defined in a .cpp file works. It will take a short time to port the code, but it seems that I should be able to get this fully working on XP.

Radiant

Wow, I'm impressed! That's some serious code puzzling there :)

monkey0506

#129
Huh... Actually, I think that the plugin I linked above is initializing the Steam API, it's just not showing the Steam Overlay. Which is also the behavior I'm now getting with the VS2017 plugin. := I'll investigate the overlay issue, but if nothing turns up soon then I'll just push up a new build with the fixed VS2017 code.

Edit: The Steam overlay works with the 3.4.1-b7 engine on Windows XP under D3D9 and OpenGL, but not software renderer. Oh, and it crashes with a segfault when I close the window via the red 'X'. Not sure if that's related to the plugin, nor if it would cause crashes during playing. Oh boy.

Radiant

Quote from: monkey0506 on Thu 17/08/2017 02:55:16
Latest builds

There was an issue reported by Dave Gilbert that has been patched in this version, but I got distracted before I updated links and such. This is only the "unified" build (use "AGS2Client.Function()" instead of "AGSteam.Function()"), but I can make sure that the "disjoint" build is uploaded as well in case you're using that. The issue Dave reported may have been the same one regarding a null pointer, which would occur if Steam failed to initialize (namely, if Steam wasn't running).

I will make sure that GetCurrentGameLanguage is added back to the plugin(s).

Edit: As of this writing, I am uploading the latest builds, which have GetCurrentGameLanguage added back in.

Aside from the above, there appears to be an issue with your latest version of the Steam plugin (the one from the quoted post). Specifically, it prevents the game from accepting keyboard input, when ran from Steam. If I log out from Steam and run the game directly from Windows, it works normally. Earlier versions of the plugin did not have this issue.

Problem

I can confirm this bug - I've updated to the latest version of the plugin, and people are reporting keyboard issues. I can't reproduce it myself though.

Neo_One

#132
What i have to do to use this plugins? There are 4 .dll files.
My game will not have achievements or cards, just i want put in Steam the game. What should do i?

Neo_One



Edit: OK, i have found https://bitbucket.org/monkey0506/ags2client/wiki/Using_the_plugin_interface#markdown-header-setachievementachieved
I forget the answer of other user about :P. I don't have to use the plugin to sell the game in Steam.

Radiant

Quote from: Radiant on Sun 27/08/2017 21:13:40
Aside from the above, there appears to be an issue with your latest version of the Steam plugin (the one from the quoted post). Specifically, it prevents the game from accepting keyboard input, when ran from Steam. If I log out from Steam and run the game directly from Windows, it works normally. Earlier versions of the plugin did not have this issue.

Hi Monkey, I was wondering if you had some time to look into this? I would like to upgrade to the newest version of AGS2client but I'm stuck with the old one because of this keyboard bug. Thank you for your time!

monkey0506

#135
Quote from: Radiant on Sun 15/10/2017 10:41:19
Quote from: Radiant on Sun 27/08/2017 21:13:40
Aside from the above, there appears to be an issue with your latest version of the Steam plugin (the one from the quoted post). Specifically, it prevents the game from accepting keyboard input, when ran from Steam. If I log out from Steam and run the game directly from Windows, it works normally. Earlier versions of the plugin did not have this issue.

Hi Monkey, I was wondering if you had some time to look into this? I would like to upgrade to the newest version of AGS2client but I'm stuck with the old one because of this keyboard bug. Thank you for your time!

Hi, sorry about that. It was a breaking change I introduced due to my own misunderstanding. Dave actually had asked me recently about the same, and I realized what the issue was. I'm doing some refactoring of the code currently, but I'll push up a new build with the fix.

Edit: Fixed build v3.3 should be available via Github. There's no binary for the Linux builds yet (but the Code::Blocks project for Linux is provided; never got around to authoring a Makefile from scratch).

Radiant

Ok, that appears to fix the issue, thank you. I'll be using the disjoint version for now, to keep the game in sync with the Linux build.

Radiant

A windows XP user reports that using the previous version of the plugin fails with an unresolved import error, whereas the current version aborts with "An exception 0xC0000005 occurred in ACWIN.EXE at EIP = 0x100011BC ; program pointer is -23, ACI version 3.3.0.1162, gtags (0,0)"  We can probably get a dump file if you think that helps.

Radiant

Could someone please advice me on how to add the Steam plugin to an OSX game in xcode?

monkey0506

#139
The latest version 3.4 now includes Mac OS X ".dylib" files! OS X support is in beta as I don't (currently/yet) have a means to test it myself with real games. However, I don't foresee issues as it is built using Code::Blocks in a nearly identical way to the Linux ".so" libraries.

The Windows and Linux builds are also now bundled with the appropriate version of the "steam_api".

Edit: Was able to test this over the last couple of days and everything seems to be working. I've also written a Makefile! := I will push up the Makefile to the git repo and update the Mac download link ("libagsteam.dylib", blast it!).

AGD2

Not sure if I'm doing something wrong here, but I'm using v3.4 (Windows) with the "unified" dll. I went through all my game scripts and changed all instances of AGSteam. to AGS2Client. I also changed all the wrapped code from #ifdef AGSteam_VERSION to #ifdef AGS2Client_VERSION.

Previously, it compiled and the game played just fine. But with the new dll and the amended code above, I get the following issues:

1) With the Steam plugin enabled. If I compile the game, I get a compile error (which doesn't happen if I compile with the AGSteam.dll plug-in is disabled):

QuoteHero.asc(1778): Error (line 1778): buffer exceeded: you probably have a missing closing bracket on a previous line

The offending code is:

Code: ags

   #ifdef AGS2Client_VERSION
   AGS2Client.SetIntStat("WAFE_FIRE_POINTS", giWAFE_Points_FIRE");
   AGS2Client.SetIntStat("WAFE_AIR_POINTS", giWAFE_Points_AIR");
   AGS2Client.SetIntStat("WAFE_WATER_POINTS", giWAFE_Points_WATER");
   AGS2Client.SetIntStat("WAFE_EARTH_POINTS", giWAFE_Points_EARTH");
   #endif


It still crashes if I wrap each of the above four lines individually.


2) With the Steam plug-in disabled, entering any game room that contains the code AGS2Client.SetIntStat will crash the game with:
QuoteAn internal error has occurred. Please note down the following information..
(ACI version 3.4.1.15)
Error: Unable to create local script: Runtime error: unresolved import 'AGS2Client::SetIntStat^2'

I updated all script instances of AGSteam. to AGS2Client. and it worked fine when they were AGSSteam. instances.

Am I missing something really obvious here?


Crimson Wizard

Quote from: AGD2 on Thu 04/10/2018 17:04:35
QuoteHero.asc(1778): Error (line 1778): buffer exceeded: you probably have a missing closing bracket on a previous line

The offending code is:

Code: ags

   #ifdef AGS2Client_VERSION
   AGS2Client.SetIntStat("WAFE_FIRE_POINTS", giWAFE_Points_FIRE");
   AGS2Client.SetIntStat("WAFE_AIR_POINTS", giWAFE_Points_AIR");
   AGS2Client.SetIntStat("WAFE_WATER_POINTS", giWAFE_Points_WATER");
   AGS2Client.SetIntStat("WAFE_EARTH_POINTS", giWAFE_Points_EARTH");
   #endif


You have either missing opening quotemark or unnecessary ending quotemark at the second parameter.

AGD2

Quote from: Crimson Wizard on Thu 04/10/2018 17:12:21
You have either missing opening quotemark or unnecessary ending quotemark at the second parameter.

Damn, how the hell did I not notice that? It's one of those days, I guess. Thanks, CW.

Okay, that's solved both issues after I rebuilt all the files.

AGD2

I'm getting a few reports from beta testers that with AGSSteam v3.4, there's an issue with the Steam overlay (Shift + TAB), which I have also observed myself.

While the Steam Overlay is active, if you click anywhere (for example clicking on your friends list or looking up guides etc.) the game reacts as if you had clicked in-game with whatever icon was active at whatever placement it had when you opened the Steam Overlay. For example, if you have the walk icon selected, EGO starts moving to the spot where the cursor was pointing in the game. If you have the eye icon selected, EGO comments on whatever the cursor is pointing at behind the Overlay.

This happens with both the Open GL and Direct3D 9 drivers. (With the Software renderer, the Steam overlay does not appear at all when ALT + TAB is pressed).

AGD2

#144
Has anyone here released a game on Steam with AGSteam v3.4 yet and had it functioning stably?

My beta testers keep getting "Null String Referenced" fatal crashes on seemingly random achievements when SetAchievementAchieved is called. The same code didn't crash the game in previous versions, and I can't see anything in the AGS code or in my Steamworks stats/achievements settings that should cause this crash.

Sometimes I'll recompile the game and tweak some unrelated AGS code (and not edit any of the achievements or stats on the Steamworks side), then push the update to Steam, and suddenly the "Null String Referenced" fatal crash stops occurring for that achievement, but starts happening for other achievements.

Been trying to solve the issue for a few weeks now, but it seems v3.4 is possibly unstable and I may need to return to an older version.

Can you shed any light ton this, Monkey?

Dave Gilbert

The dll files we used for Unavowed are dated May 26th, 2018 and we've had no problems on PC. We've had issues with achievements not being unlocked on Mac, but nothing that crashed the game.

Chicky

AGD2, did you make any progress with this? Manage to find out what was causing the issues?

If anyone has a link to the dll files Dave used (May 26th 2018) I'd appreciate being pointed in the right direction. Github confuses me!

AGD2

#147
Yeah, it turns out that I needed to have all of the achievements referenced in my game code also set up in the Steamworks back-end. From what I could see, the AGSteam documentation mentioned nothing about this, so I was adding the achievements to Steamworks gradually, as time permitted. I had about 34 of 45 achievements added to Steamworks. But when I added them all, the crashes stopped happening.

So, it's not a bug with the plug-in. Just something to be aware of.

Stranga

#148
Hello there,

I know this is an old topic, but I just want to find out if this plugin will work with AGS 3.5.0? I have tried to implement it the same way as in v 3.4.1, but it doesn't seem to unlock anything. I've also tried both AGSteam and AGS2 plugins. My guess is that the plugin is out of date? I could be wrong but just taking a stab in the dark.

P.S sorry if I broke any rules, just really need help with this.


Edit: I forgot to add all the .dll files to my compiled folder. So it does work with 3.5.0. My bad everyone!

HappyCat

Can someone please tell if there's a way to use this plugin with Android AGS builds?

eri0o

There's no Steam for Android, so no.

drlynch

Hi, everyone:

Sorry, a question. Surely it has already been answered.

Does this plugin work to be used when developing under Windows? I ask because the name of the Discussion Thread indicates "Mac Os X".

Thank you and happy holidays.

Crimson Wizard

Quote from: drlynch on Thu 26/12/2019 13:28:48
Does this plugin work to be used when developing under Windows? I ask because the name of the Discussion Thread indicates "Mac Os X".

Yes, and title means that Mac OsX support was added last.

If you check download links you will see ones for Windows, linux and mac.

Khris

I was confused by this at first, too. Maybe a mod could edit the first post's title again, to indicate that it's also for Mac OS X, not just?

drlynch

Quote from: Crimson Wizard on Thu 26/12/2019 13:51:48
Quote from: drlynch on Thu 26/12/2019 13:28:48
Does this plugin work to be used when developing under Windows? I ask because the name of the Discussion Thread indicates "Mac Os X".

Yes, and title means that Mac OsX support was added last.

If you check download links you will see ones for Windows, linux and mac.
You're right ;), in Github it is clear that it exists for Windows, Linux and Mac.

Thank you very much for your contribution. Very useful.


Quote from: Khris on Fri 27/12/2019 11:52:48
I was confused by this at first, too. Maybe a mod could edit the first post's title again, to indicate that it's also for Mac OS X, not just?
You're right. In my opinion, the title creates confusion.

It would be better if the title was changed to another one where the different operating systems were titled.



Happy Holidays.

guga2112

Hi, I need all the help I can get.

I downloaded release 3.4 and followed the instructions. The editor plugin works fine, I can use the calls in the script and so on.

However, it seems like it's totally ignored by the engine. I can even remove the .dll file from the folder, nothing happens. The .Initialized property is always false and all calls return null.

I even tried to compile my own version, adding new calls or changing some returns to fixed values. New calls don't get registered and the game crashes. And my return values aren't there, the calls always return null.

It just seems like the engine is just not calling the .dll. What am I doing wrong? I tried with the unified, the disjoint, release, debug. Nothing. The changes I make on editor's side work, the engine ones disappear.

guga2112

So, I was wondering why my executable was still getting symbols like IsAchievementAchieved^1 even after I removed the plugin.

The code for release 3.5.0 creates stub functions for said plugins.

Can this create conflicts? Is that the reason why the actual calls don't get invoked?

Crimson Wizard

Quote from: guga2112 on Fri 06/03/2020 09:58:32
So, I was wondering why my executable was still getting symbols like IsAchievementAchieved^1 even after I removed the plugin.

The code for release 3.5.0 creates stub functions for said plugins.

Can this create conflicts? Is that the reason why the actual calls don't get invoked?

Hello.
Stubs are supposed to be generated only if the engine cannot find matching plugin. So the first question is whether plugin is found by the engine.
Hmm, no, that's second question, and the first question is, what system are you running on. :)
Try doing following, open acsetup.cfg near your game's exe, and add following under "misc" section:
Quote
[misc]
log=1
When you run next time, a log should appear in the standard savegame location (for example, it is "%USERPROFILE%\Saved Games\.ags\ags.log" on Windows).
Somewhere in this log engine will report what plugins does it look for, whether it found ones, and if not, was it able to find/generate stubs.

guga2112

Thanks for the help. I'm running Windows 10, 64 bit. The editor is version 3.5.0 patch 1.

So, there was indeed an error on my side, I didn't add steam_api.dll to the game folder.

However, it didn't completely solve my problem. I recompiled the plugin on VS2019 against the current Steam SDK, and if I use that one, it works fine.

But if I use both plugin and api dll from the github releases, it still fails.

So I suppose the problem is solved... for me. But I don't have time to look further into this.

guga2112

Nevermind, it works now  :-\ I guess I mixed all the DLLs I had...

CaptainD

I have achievements working fine but I'm unclear on how to tell AGS2Client which leaderboard to upload scores to.

My code is:

Code: ags
            AGS2Client.RequestLeaderboard("Individual_Level_Top_Scores", eAGS2ClientScoresRequestGlobal);  
            AGS2Client.UploadScore(HighScore1);


I have three leaderboards which I reference in code that runs every time I save the high scores, but I have no entries in the Steam leaderboards... I seem to be doing something wrong but not sure what.

 

CaptainD

For anyone else who runs into the issue about, it appears that the only thing I'd messed up with not adding a Wait command after AGS2Client.RequestLeaderboard - I added a "Wait(20)" after it and seems to work fine now.
 

proximity

Hi CaptainD, I'm glad that you solved your problem. Do you have any questions about leaderboards? At first, I thought that it was an exciting feature and put it in my game, then I realized players actually don't care about leaderboards. Only 5% of players have registered themselves into leaderboards in my previous game. I still think it's a cool feature though :)
Proximity Entertainment

CaptainD

Quote from: proximity on Fri 26/06/2020 03:48:19
Hi CaptainD, I'm glad that you solved your problem. Do you have any questions about leaderboards? At first, I thought that it was an exciting feature and put it in my game, then I realized players actually don't care about leaderboards. Only 5% of players have registered themselves into leaderboards in my previous game. I still think it's a cool feature though :)

I haven't released the game on Steam yet (and am likely to only get a handful of players anyway), so I have no idea how much interest there will be, but the particular game I'm working on lends itself to the leaderboard idea - arcade, short gameplay rounds, high customisability so you can make the game easy or much harder (the tougher the setting, the higher the score multipliers etc).  So will have to wait and see...  I'm not aware if the player has to do anything besides have a Steam account for the scores to upload, but will cross that bridge when I come to it!

I did alter the code based on recommendations by Denis (AGS user "Problem") to repeatedly attempt connection to the leaderboard in case it didn't sync properly the first time, I will post the code later in case anyone finds it useful.

Hope your games using the Leaderboard code eventually have more players register to use it!
 

proximity

Quote from: CaptainD on Fri 26/06/2020 11:37:01
Quote from: proximity on Fri 26/06/2020 03:48:19
Hi CaptainD, I'm glad that you solved your problem. Do you have any questions about leaderboards? At first, I thought that it was an exciting feature and put it in my game, then I realized players actually don't care about leaderboards. Only 5% of players have registered themselves into leaderboards in my previous game. I still think it's a cool feature though :)

I haven't released the game on Steam yet (and am likely to only get a handful of players anyway), so I have no idea how much interest there will be, but the particular game I'm working on lends itself to the leaderboard idea - arcade, short gameplay rounds, high customisability so you can make the game easy or much harder (the tougher the setting, the higher the score multipliers etc).  So will have to wait and see...  I'm not aware if the player has to do anything besides have a Steam account for the scores to upload, but will cross that bridge when I come to it!

I did alter the code based on recommendations by Denis (AGS user "Problem") to repeatedly attempt connection to the leaderboard in case it didn't sync properly the first time, I will post the code later in case anyone finds it useful.

Hope your games using the Leaderboard code eventually have more players register to use it!

I did 3 seconds loops of uploads on repeatedly_execute_always while CurrentLeaderboard isn't null. When the game calls UploadScore, it has always uploaded the score for the first time but there is no harm using repeatedly_execute to make sure. The plugin is well optimized and never slows down the engine even if you call it every loop. The only thing bothers me is when Steam Overlay is active, the mouse still controls the game cursor so I can't move the windows cursor over Steam UI.
Proximity Entertainment

pente

Hi, I am experiencing this error: "Runtime error: unresolved import 'Steam::AddAchievement^1'."

This occurs when launching Blackwell: Deception on linux. I have no interest in the steam integration, just in launching the game without crashing.

I am running AGS v.3.5.0.27. I invoked the game with "./ags <path-to-game-directory>/'. The game directory contains several windows exes and dlls, including agsteam, but no linux executables or libraries. I would use "ldd" to check for missing libraries but there is no linux executable for me to run it on.

(When compiling AGS, I had to change the Makefile to compile libdumb and libaldmb dynamically instead of statically as this library is only available dynamically in my distro.)

Let me know if any other information would be helpful, thanks.

(The game runs poorly with wine, using 100% cpu and lagging horribly.)

Crimson Wizard

I thought Wadjet Eye was providing linux builds too...

Quote from: pente on Wed 21/10/2020 02:36:03
Hi, I am experiencing this error: "Runtime error: unresolved import 'Steam::AddAchievement^1'."

I do not know all about steam plugin's history, but it may be that the game was made with older version of steam plugin, and engine does not have any stub registered for this. It has stub for "AGSteam::IsAchievementAchieved^1" for example (these were names suggested by plugin author). Perhaps adding more variants to the list of stubs will resolve the issue.

These could be found in RegisterPluginStubs function (Engine/plugin/global_plugin.cpp).

Also, could you tell, what is the exact name of plugin dll (or .so if any) found with original game?


pente

Quote from: Crimson Wizard on Wed 21/10/2020 05:26:54
I thought Wadjet Eye was providing linux builds too...

[...] Also, could you tell, what is the exact name of plugin dll (or .so if any) found with original game?

Only the first three games had linux builds. Blackwell: Deception ships with agsteam.dll and steam_api.dll, as well as Deception.exe, acsetup.cfg, ags_shell.dll, audio.vox, desktop.ini, prog.bwd, speech.vox, steam_appid.txt, and winsetup.exe.

Are you suggesting I should edit AGS so it has some empty function with the name that is missing?

I've read elsewhere that it was made with an older version of AGS, but I could not figure out any way to determine which version I would need. It was released on 2011 Oct 12.

Crimson Wizard

Quote from: pente on Wed 21/10/2020 19:48:05
Only the first three games had linux builds. Blackwell: Deception ships with agsteam.dll ...

Ah, alright, the stubs are registered for "agsteam" plugin name, so only problem is that function names are different for some reason.

Quote from: pente on Wed 21/10/2020 19:48:05
Are you suggesting I should edit AGS so it has some empty function with the name that is missing?

You could try, if you like, as it may be pretty straightforward: find Engine/plugin/global_plugin.cpp and copy a section of code:
Code: cpp

    if (is_agsteam)
    {
      ccAddExternalStaticFunction("AGSteam::IsAchievementAchieved^1", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::SetAchievementAchieved^1", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::ResetAchievement^1", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::GetIntStat^1", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::GetFloatStat^1", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::GetAverageRateStat^1", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::SetIntStat^2", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::SetFloatStat^2", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::UpdateAverageRateStat^3", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::ResetStatsAndAchievements^0", Sc_PluginStub_Void);
      ccAddExternalStaticFunction("AGSteam::get_Initialized", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::get_CurrentLeaderboardName", Sc_PluginStub_NullStr);
      ccAddExternalStaticFunction("AGSteam::RequestLeaderboard^3", Sc_PluginStub_Void);
      ccAddExternalStaticFunction("AGSteam::UploadScore^1", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::geti_LeaderboardNames", Sc_PluginStub_NullStr);
      ccAddExternalStaticFunction("AGSteam::geti_LeaderboardScores", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::get_LeaderboardCount", Sc_PluginStub_Int0);
      ccAddExternalStaticFunction("AGSteam::GetUserName^0", Sc_PluginStub_NullStr);
      ccAddExternalStaticFunction("AGSteam::GetCurrentGameLanguage^0", Sc_PluginStub_NullStr);
      ccAddExternalStaticFunction("AGSteam::FindLeaderboard^1", Sc_PluginStub_Void);
    }


...and replace all instances of "AGSteam::" with "Steam::".

If that works we may add this to main repository too :).

Or later when I have more spare time I could check out the game myself.


Quote from: pente on Wed 21/10/2020 19:48:05
I've read elsewhere that it was made with an older version of AGS, but I could not figure out any way to determine which version I would need. It was released on 2011 Oct 12.

When you run the game, engine should print something like "Game data version: NNN" and "Compiled with: AGS X.X.X" to console, which may give at least approximate idea.
But, I dont think knowing this will help to solve this problem, as older engines did not have any Steam stubs at all (they were added much later).
There was also a Steam stub plugin, created by AGSSteam author (https://github.com/monkey0506/ags2clientstub), but I've got a suspicion that it may have exactly same problem of having newer function names. I dont know if there's an older version of that.

pente

Thank you for your help, it now works!

In any addition to the changes you suggested, I added

ccAddExternalStaticFunction("Steam::AddAchievement^1", Sc_PluginStub_Void);

I just guessed at "void" but the engine hasn't crashed so maybe that's fine. We'll see what happens if I get an in-game achievement.

I don't know how I missed it before (since I was looking), but on startup it says:

Game data version: 42
Compiled with: 3.2.0

Unfortunately the game no longer automatically progresses through dialog; I have to manually advance the conversation after each dialog clip is played. Maybe there's an option somewhere to change that.

adipson

Hello !
Thank you for this Steam plugin which works at the top!

Have a nice week !
POINT AND CLICK
2023-2024 : Magret & FaceDeBouc : https://store.steampowered.com/app/2661780/Magret__FaceDeBouc/
2019-2022 : Grandma Badass : https://store.steampowered.com/app/1606640/
Official website : https://adipson-studio.com/

Laura Hunt

Quote from: proximity on Fri 26/06/2020 14:10:34The only thing bothers me is when Steam Overlay is active, the mouse still controls the game cursor so I can't move the windows cursor over Steam UI.

I know this is a pretty old post, but I figured this would be useful for anybody who has this issue: this happens if you use the Direct3D graphics driver, but if you switch to OpenGL, it works fine.

eri0o

Laura, can you test if the overlay affects the result of input focus? https://adventuregamestudio.github.io/ags-manual/System.html#systemhasinputfocus

In the issue on GitHub it says it used to affect OpenGL too so it is curious what changed - but at least there's a workaround for now.

Also, monkey0506, if you are still here, can you add a boolean to check if the overlay is active?

Edit: I wonder if the sdl2 version of the engine is affected by this.

CaptainD

Quote from: proximity on Fri 26/06/2020 14:10:34
Quote from: CaptainD on Fri 26/06/2020 11:37:01
Quote from: proximity on Fri 26/06/2020 03:48:19
Hi CaptainD, I'm glad that you solved your problem. Do you have any questions about leaderboards? At first, I thought that it was an exciting feature and put it in my game, then I realized players actually don't care about leaderboards. Only 5% of players have registered themselves into leaderboards in my previous game. I still think it's a cool feature though :)

I haven't released the game on Steam yet (and am likely to only get a handful of players anyway), so I have no idea how much interest there will be, but the particular game I'm working on lends itself to the leaderboard idea - arcade, short gameplay rounds, high customisability so you can make the game easy or much harder (the tougher the setting, the higher the score multipliers etc).  So will have to wait and see...  I'm not aware if the player has to do anything besides have a Steam account for the scores to upload, but will cross that bridge when I come to it!

I did alter the code based on recommendations by Denis (AGS user "Problem") to repeatedly attempt connection to the leaderboard in case it didn't sync properly the first time, I will post the code later in case anyone finds it useful.

Hope your games using the Leaderboard code eventually have more players register to use it!

I did 3 seconds loops of uploads on repeatedly_execute_always while CurrentLeaderboard isn't null. When the game calls UploadScore, it has always uploaded the score for the first time but there is no harm using repeatedly_execute to make sure. The plugin is well optimized and never slows down the engine even if you call it every loop. The only thing bothers me is when Steam Overlay is active, the mouse still controls the game cursor so I can't move the windows cursor over Steam UI.

Going back to this, I don't seem to have solved the problem now that I have a live build up for testing. The solution I had in mind was to upload to leaderboards in a function that's only called when you quit the game. The issue is that I have 3 different leaderboards and what I wanted was for it to check one, wait, connect, upload the score (or retry connecting if failed, up to 5 retries) and then check to the next, and the next. However I tried this and the game crashes because of a Null pointer. This may be partially resolved by increasing the Wait time each loop (it was only set to 6 when I first checked it and got the error) but I'm not confident that will prevent the game from crashing still if the user's connection is bad or the Steam servers are busy.

In line with what you said I could maybe go with this but have a null pointer check before trying to update (the current code only checks if the LeaderBoard Name value matches the leaderboard I'm attempting to access at the time). Or potentially I could have it repeatedly execute and have it swap between which leaderboard name it's looking for every n loops.

The (very simple) code I have so far, which is repeated for each different leaderboard (I know, I know...) is this:

Code: ags
function UpdateHighScoreTables()
{
  connectedtocorrectleaderboard=false;
  connectloop=0;
  
  while ((connectedtocorrectleaderboard == false) && (connectloop < 6)) 
    {
      AGS2Client.RequestLeaderboard("Individual_Level_Top_Scores", eAGS2ClientScoresRequestGlobal);  
      Wait(20);
      if (AGS2Client.CurrentLeaderboardName=="Individual_Level_Top_Scores") connectedtocorrectleaderboard=true;     
      connectloop++;
    }
  if (connectedtocorrectleaderboard==true) 
    {         
      AGS2Client.UploadScore(HighScore1);
      Wait(5);
    }           


Maybe this would work?

Code: ags
if ((AGS2Client.CurrentLeaderboardName != null) && (AGS2Client.CurrentLeaderboardName=="Individual_Level_Top_Scores")) connectedtocorrectleaderboard=true;   


Or am I simply creating problems for myself by running it as a one-off function rather than having it check repeatedly?

Currently I have no client-side code that checks if the high score has been uploaded already, but I feel that shouldn't be necessary as Steam automatically handles that.
 

Crimson Wizard

@CaptainD, can't say I understand all the context, but it's absolutely true that you should test an object for null if it *may* be null, prior to using it further.

Another thing that I might mention, in asynchronous programming a usual tradition is to use time as a limitation, rather than the number of tries, e.g. if you'd use DateTime functions to remember the time before you start connecting and wait for X seconds max (where X is whatever you think is okay for players to wait).

Whether to check for connection in one same function or in rep-exec imho depends mostly on whether you want players to retain input while this work is being done. Because that would be the biggest difference: if the reconnect/upload is done within 1 script function, then players won't be able to interact with anything in game until the script ends; at the same time if it's done in rep-exec (one try at a time) then players will be able to interact with the game while this process is happening.

If there's concern about overloading rep-exec with stuff, the common solution is to set a variable telling whether this process is going, and only do these connection tasks if it's active, and not otherwise. Thus you will skip unnecessary actions for the rest of the game.

CaptainD

@CW - many thanks, I'll take on board what you've said and rework my code, your comments are very helpful.
 

Crimson Wizard

Oh, I forgot to mention, if chosen to do in rep-exec - it should be rep-exec-always, so to make it work all the time, because regular rep-exec is disabled during blocking game actions.


CaptainD

For what it's worth, this is the code I ended up with. I couldn't get it to work with Steam at all unless I used the original AGSteam plugin; tried it with AGS2Client and Steam Disjoint but wouldn't do anything. Not sure why.

I may have ended up making the delay a bit longer than necessary as I wasn't sure initially if that's why it wasn't picking up the leaderboards. This way it always waits about a second before trying to access the requested leaderboard and at least half a second for the score to upload to the selected board.

I'm sure my code can be improved on but if anyone's got a game with multiple Steam leaderboards and are having trouble getting it to work, perhaps my example may be of some value.

Code: ags
function repeatedly_execute_always() 
{
  if (LB_loops==0)
    { 
      if (LB_type==1) AGS2Client.RequestLeaderboard("Individual_Level_Top_Scores", eAGS2ClientScoresRequestGlobal);
      if (LB_type==2) AGS2Client.RequestLeaderboard("Challenge_Mode_Top_Scores", eAGS2ClientScoresRequestGlobal);
      if (LB_type==3) AGS2Client.RequestLeaderboard("All_Time_Top_Scores", eAGS2ClientScoresRequestGlobal);
    }
  LB_loops++;
  
  if ((LB_loops>40) && (LB_loops<80) && (AGS2Client.CurrentLeaderboardName !=null))
    { 
      if (AGS2Client.CurrentLeaderboardName=="Individual_Level_Top_Scores") AGS2Client.UploadScore(HighScore1); 
      if (AGS2Client.CurrentLeaderboardName=="Challenge_Mode_Top_Scores") AGS2Client.UploadScore(CMHS1);
      if (AGS2Client.CurrentLeaderboardName=="All_Time_Top_Scores") AGS2Client.UploadScore(All_Time_Score);
      LB_loops=80;
    }
  if (LB_loops==100) 
    {
      LB_loops=0;
      LB_type++;
      if(LB_type==4) LB_type=1;
    }
}


Thanks again to CW for your help, also Laura and Denis for your assistance via Twitter.
 

rongel

Hello, and sorry for bumbing this, but just need a bit of clarification on the install instructions to make sure everything is like it should be.

Windows
I copy the "AGSteam.dll" and "steam_api.dll"to the AGS editor's directory. Everything works fine. Achievements work. All is good.

Linux
Now I have folders Linux32 and Linux64 in the install package. Do I copy the contents to AGS editor's root directory, like with the Windows version, or to the "Linux\lib32" and Linux\lib64 folders? Currently I've done the latter option. When I compile the game I get this warning:



So what I did is that I went to the Linux\lib32 folder and rename the libagsteam-32.so file to libagsteam.so. It feels a bit sketchy, but I got rid of the warning and it compiles fine. As I have no way to test the Linux version myself, I'm still wondering if it is like it should be. So any help is appreciated!

Bonus question: I think I read somewhere that I should copy the AGSteam files to the "_debug" folder also. Is this correct or necessary?

Thanks again!
Dreams in the Witch House on Steam & GOG

rongel

Ok, I got some help from Laura. I'll share the info here, so it could help others in the same situation. So here's some AGSteam Linux installation instructions:

1. Go to linux32 folder in the installation package, and rename libagsteam-32.so to libagsteam.so
2. Place the 32 and 64 bit versions of libagsteam.so and libsteam_api.so in the Linux subfolder of the AGS engine folder (Linux\lib32 & Linux\lib64)

+  Place the files also in compiled/linux/data/lib32 and lib64 folders (not sure if this is necessary, but just in case)

And that's it (as far as I know)!
Dreams in the Witch House on Steam & GOG

Dualnames

To my knowledge, there hasn't been a user of linux 32bit i've personally found.
In fact both manufacturers and distros even are dropping 32bit throughout.
Of course that doesn't per se answer your issue here.


You can make an sh file call it Start.sh
Code: ags

#!/bin/sh
SCRIPTPATH="$(dirname "$(readlink -f "$0")")"

if test "x$@" = "x-h" -o "x$@" = "x--help"
  then
    echo "Usage:" "$(basename "$(readlink -f $0)")" "[<ags options>]"
    echo ""
fi

chmod +x "$SCRIPTPATH/ags64" "$SCRIPTPATH/ags32"

if test $(uname -m) = x86_64
  then
    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${SCRIPTPATH}/lib64"
    export LIBGL_DRI3_DISABLE=true
    ALLEGRO_MODULES="$SCRIPTPATH/lib64" "$SCRIPTPATH/ags64" "$@" > "$SCRIPTPATH/log.txt" 2>&1
  else
    export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${SCRIPTPATH}/lib32"
    export LIBGL_DRI3_DISABLE=true
    ALLEGRO_MODULES="$SCRIPTPATH/lib32" "$SCRIPTPATH/ags32" "$@" > "$SCRIPTPATH/log.txt" 2>&1
fi



And use it in as "./Start.sh" and "./Start.sh --windowed" in the game executable.
Specifically, not sure how Linux 32 works for Steam, but for example OSX 32b is dropped entirely, and u cannot download 32bit mac builds through Steam.

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)

eri0o

Steam still allows shipping a depot for 32 bit Linux, but I don't think anyone uses a 32bit outside of VMs.

If you don't, I believe the game requirements specify it must be 64-bit.

I mentioned this elsewhere, but just to explain again. This plugin has stubs in the AGS engine, so if it's not found - the plugin, not the steam store dll -, the game should load but all of these plugin related methods will return either null or false and it will not work.

rongel

Thanks for the comments!

Mainly I was worried about the compile warning that I got with the libagsteam-32.so. Don't really understand how Linux works, but I was happy to get rid of it by renaming it.

Quote from: Dualnames on Wed 08/06/2022 10:18:57

You can make an sh file call it Start.sh


Wow, that's heavy stuff. What exactly does the code do? I think I will leave the proper Linux version for now, and get back to it after the full release. It seems that many Linux users use the Windows version with the Proton / Wine thing.
Dreams in the Witch House on Steam & GOG

Dualnames

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)

SMF spam blocked by CleanTalk