Missing libags2clientstub.so (AGS2Client)

Started by TheVolumeRemote, Fri 10/05/2024 23:22:23

Previous topic - Next topic

TheVolumeRemote

I've recently installed the AGS2Client plugin's and I can no longer compile the Linux build due to this error
Code: ags
Linux: plugin libags2clientstub.so not found for any arch
I haven't been able to find that file locally or online and would greatly appreciate any help.

It was a little tricky finding all I needed for the AGS2Client plugin, I suspect I'm both missing some files and am using superfluous files but alas, here are the DLL's I have in my AGS 3.6.1 folder
Code: ags
Galaxy.dll
steam_api.dll
AGSteam.dll
AGSteam-disjoint.dll
ags2clientstub.dll
agsgalaxy-disjoint.dll
agsgalaxy.dll

I currently only have AGS2Client enabled because I believe this is correct (if I want to produce a unified/joined build for both GOG and Steam). I'm also wondering if this is correct.
Image-5-10-24-at-5-33-PM" border="0

thank you for any help :)

Edit: I've found these files in Monkey's repo for Mac and Linux (both of which I have ports to) and I assume they go with the executable file but I'm wondering if they should also go in the AGS folder?
Code: ags
 Linux
libsteam_api.so
libagsteam.so
OSX
libsteam_api.dylib
agsteam.dylib 

eri0o

#1
The dll is only Windows plugin - AGS Windows from the Editor is currently specifically 32-bit Windows. So you would need plugin builds for each other platform and arch (x86, x64, armv8, ...) you are using.

I believe the Android build can disregard a few specific plugins and use internal stubs and only warn that to you - I don't remember exactly which ones.

Are your Linux builds intended to be on Steam/GOG too or are the Linux builds of your game distributed elsewhere?

Edit: ok, I wrote this error message. So what happens is it does build your Linux port - or at least it should. But it will fail to run because you are using a plugin that has no internal stubs.

If you only intend to use Steam you should use AGSteam. If you intend to use Gog you need to find someone that knows how it works. The libsteam_api and steam_api files are from Valve themselves, I believe you may need to update these with whatever you download from steamworks - their API is usually backwards compatible.

TheVolumeRemote

Hey Eri0o, thanks for helping!

Yes my Linux (and OSX) build is intended for Steam and GOG. Prior to installing the AGS2Client plugin, my Linux (and Mac/Data) build compiled and ran no problem.

I'm not compiling for Android (at the moment)

I'm using 3.6.1-23

The AGS2Client repo on Git has these files for the Linux and Mac
Code: ags
Linux
libsteam_api.so
libagsteam.so
OSX
libsteam_api.dylib
agsteam.dylib 
But I thought they went with the compiled executable and for the AGS2Client plugin itself to work w AGS I just need the DLL files that I used to enable the plugin. (Not sure though)

I'm also not sure if the missing .so file that causes the error is self-generating but I can't find it anywhere, not in my local files and not even online anywhere (which makes me think it is self-generating and that I'm missing something to make that happen?).


TheVolumeRemote

#3
Quote from: eri0o on Sat 11/05/2024 01:04:37The libsteam_api and steam_api files are from Valve themselves, I believe you may need to update these with whatever you download from steamworks - their API is usually backwards compatible.

Okay so I have
Code: ags
Linux
libsteam_api.so
libagsteam.so
OSX
libsteam_api.dylib
agsteam.dylib 

which you're referencing in regards to updating them. Where do I put these files, I thought they went w the compiled executable but it sounds like I need them to compile the executable?

Edit: I put the linux .so files in the AGS 3.6.1\Linux\lib folders (32 and 64 respectively) and tried to compile and got the same error. not saying I was supposed to do that, only that I tried it :)

Crimson Wizard

#4
Quote from: TheVolumeRemote on Sat 11/05/2024 01:54:08Where do I put these files, I thought they went w the compiled executable but it sounds like I need them to compile the executable?

You should not be placing these to game exe yourself, place plugins in Editor program folder and AGS will copy them over to your game as needed. Windows plugins go to the root folder historically, Linux to "Linux" folder etc. Well, looks like you already did it.

Quote from: TheVolumeRemote on Sat 11/05/2024 01:54:08Edit: I put the linux .so files in the AGS 3.6.1\Linux\lib folders (32 and 64 respectively) and tried to compile and got the same error. not saying I was supposed to do that, only that I tried it :)

Your plugin is called "ags2clientstub" so you must have "libags2clientstub.so".

But then, is it really the plugin that you want?  My understanding is that "stub" means that it does not do anything, it only works as a "stub", emulating the presence of Steam/GOG plugin.
You probably need something that does not have "stub" in the name.

Where do you download these?

TheVolumeRemote

#5
Thank you CW. I will leave the .DLL plugin files in the main "Adventure Game Studio 3.6.1" folder (the editor's folder not the projects).

For the plug-ins themselves I have:

Code: ags
Galaxy.dll
steam_api.dll
AGSteam.dll
AGSteam-disjoint.dll
ags2clientstub.dll
agsgalaxy-disjoint.dll
agsgalaxy.dll

And I gathered them from different places under the impression that if want to build for GOG and Steam, I need AGSgalaxy, AGSteam and then AGS2Client to manage both of them using 1 unified build. I couldn't find all 3 components in 1 location so I got files from:

https://github.com/monkey0506/agsteam/releases

https://bitbucket.org/monkey0506/ags2client/downloads/

https://bitbucket.org/monkey0506/ags2clientstub/downloads/

And cherry picking I was able to get the 3 plugin's I think I need (AGSteam + AGSglaxy, controlled by AGS2Client). But I don't know why the Linux build throws up that error.

Considering how important AGS2Client is, it's really hard to find straight forward instructions on how to set it up- so if anyone out there sees this and knows how to use it for GOG and Steam, I would pay real life money for a tutorial to share with the AGS community! (And I'm aware of the wiki which is wonderful for understanding the functions but I can't find a lot of clear help for setting it all up)

Shorter term, any help with this Linux error I'm getting would be greatly appreciated :)

eri0o

#6
I think you are doing it wrong but CW is wrong too, the steam_api.dll is the DLL from steamworks from Valve themselves, and that one you have to copy manually because AGS Editor doesn't know it exists, it's a dependency on the plugin this plugin can be linked at build time to either that DLL or to the Galaxy.dll which is from GOG. The one you are copying depends on which one you build the plugin and you should build to tackle the platform you are shipping - the monkey plugin has some convoluted way to set a unified interface to both platforms.

Honestly, I hate how he codes and the design of the plugin and how monkey writes in a way that makes no sense at all his docs.

Anyway, now I looked in how to make a sane plugin, Valve puts an agreement along their binaries that allows one to redistribute their binaries but just don't mention and doesn't attach a license to their header files - why people do this? Anyway, opened a support ticket with them to get more information on how to make a proper open source plugin (can I redistribute your header's valve?).

Now to Gog, my login through their dev portal doesn't work anymore so I can't access a thing from their official docs and a recent binary and header. I opened a support ticket with them.

Anyway, in short I think from trying to figure it out monkey plugin that you use the agsteam.dll and put it in the AGS Editor root, the libagsteam.so you put in the Editor/Linux/lib64 I think and then you just hit build, and then you copy the steam_api.dll manually to your game dir in Windows or to your game lib64 dir in case of Linux - or maybe data64 I don't remember. Building with the Galaxy plugin you do disable this and use agsgalaxy.dll instead and copy manually the Galaxy.dll there. The thing is depending which monkey build the AGS header of the plugin will either be AGSteam/AgsGalaxy/Ags2Client in the autocomplete.

Anyway if I can figure some way to get an answer from gog I could maybe make my own version of this but with a saner api.

Honestly to me it's kinda bonkers that people release games and never bothered to maintain this after monkey disappeared so idnk... Btw if you want to give me money I wouldn't mind.

TheVolumeRemote

#7
Thanks for your help eri0o, I must admit it was cathartic to hear you vent about the state of this plugin because it's a crucial element for commercial releases and yet it doesn't seem to have been given very much love. The DLL's are scattered about, as are the Linus & Unix files, there's a "AGSteam-debug-exe" program that I'm still not sure what its purpose is, and scanning posts in the forums slowly provides some answers but nothing comprehensive and there's no organized source of information on the plug-in (besides the wiki which is great for using it in the editor but doesn't help with setting it up).

Basically as you said, I was also thinking it was kind of bonkers that such a crucial element to commercial games has been existing with almost no clear instructions and surviving off of duct tape and zip ties since it was last touched 6 years ago. Like, I still feel like I'm missing something obvious bc how are people even using it lol

Anyway thank you so much for giving this some time and for helping.

I did try to put libagssteam.so in the Editor/Linux/lib64 folder and to compile, but I got the same error "Linux: plugin libags2clientstub.so not found for any arch"

Luckily I've still got 2 months before I release my game so fingers crossed I can provide a Linux (and Mac) build with achievements by then and hey, if you have Ko-Fi or a Paypal or Venmo, lmk what it is, id be happy to buy you dinner for your help with this :)

Edit: fwiw here's a roundup of all the files I was able to gather. I have the DLL's in the editors root folder and within the editor, AGSteam and AGSgalaxy are disabled and AGS2Client is enabled https://www.dropbox.com/scl/fi/b3jwwjrctke4zpzb3zvnf/ags2client.zip?rlkey=y1o1nqbx5c7xjhanw0z9k9cbi&dl=1

eri0o

Tbh money is kinda irrelevant of sort before getting this done, most importantly would be actually having access to gog dev portal, like, if you do already at least it's possible to kick something working and test it.

I looked at GOG owns GitHub but their stuff is barely maintained there and has no license attached - who the hell shares code without even a copyright information???

I am pretty sure that making something up for Steam wouldn't be too hard...

Mostly because I have no idea, besides the achievements, what is used when integrating to these stores in an ags game?

My unordered thoughts about my idea for the plugin.

  • A name like StoreClient that works for whatever
  • Do not link or depend at build time of anything binary from the stores
  • Copy their headers in the project- with a clear note its third party and any licensing info there's
  • Dynamic load the damn stuff (steam_api.dll, Galaxy.dll, ...), adapt the plugin to whatever is found and handle things sanely if nothing is found
  • Stuff that is common generally may have some common api but in general use a string based api that is more flexible and can work with store specific thing
  • Provide CI integration and at least build for Windows/Linux/macOS/Android - some of these will internally just be stubs but it's alright
  • Some proper docs or an Editor plugin if necessary to not make things be cryptical

TheVolumeRemote

Love a good plan! I don't have a GOG dev account but I will bump up "Submit game for GOG approval" to the top of my priority list and if I'm accepted, (and I might not be,) I'll report back and see how I can help you help us, with GOG portal access. And if anyone who's already on GOG sees this, please jump in so AGS can have an updated solution for store achievements going forward!

Meanwhile thank you SO much for stepping in to save the day, please lmk if I can otherwise help and you still got 1 dinner, on me, when you want it :)

eri0o

#10
ok, started to work on this but it will take sometime - will probably only be able to work on this in the weekends... The base idea is the plugin will try to adapt to where it is, it's build config and (for desktops) look for libraries and try to figure things out on where it is and initialize the appropriate driver dynamically. For now the idea is to have a Steam driver, a GOG driver and a Dummy driver (in case no appropriate dll or whatever is found), which is also the base driver.

GOG apparently only supports Windows (32-bit and 64-bit) and macOS (64-bit), while Steam additionally supports Linux. This means that if you build for Android you will only have the dummy driver - maybe there will be something else in the future, but let's start things simpler.

At first each driver should be a single cpp/h pair. I made the internal driver just have an api that is similar to the script one, but without duplicating any AGS specifics - creating script strings.

My idea is to plan around the script API from Monkey's plugin at first, because I guess is what people are used, and the code is public domain license. I am adding only GetCurrentGameLanguage, get_Initialized, ResetStatsAndAchievements, SetAchievementAchieved, IsAchievementAchieved, once these are verified to work I may try other things.

For now my code is closed until I get some light on the matter of header license from the support tickets. I looked into GitHub and found plenty different engine plugins that just straight threw the Galaxy and Steamworks headers there so idnk, for now I used this to copy the Galaxy stuff from there so I can at least start to build things - can't test it though.

I have to sleep now.

Edit: sleeping is great, I just realized I can reimplement the script API from agsgalaxy and agsteam and then test in other people's games!

My idea is to have a compatibility mode that if you rename the library with either agsteam or agsgalaxy it will try to mimic the API of those libraries and register functions with their names instead - but still safely fail to dummy driver if no compatible steam_api.dll or Galaxy.dll is found.

This compatibility mode will be strictly in case you have a game already on Steam and want to update to this new plugin but are afraid to do so because of the save files and also you don't want to recode your game.

TheVolumeRemote

Quote from: eri0o on Mon 13/05/2024 01:46:22I have to sleep now.

Edit: sleeping is great

This made me lol, I love a good sleep induced breakthrough. Thank you for all your immediate hard work on this, I guess I'll be the guy on the sidelines holding out water bottles to you as you sprint past!

Just wanted to add I think it's a good choice to focus on the main functions like SetAchievementAchieved, I suspect that like myself, most people will only use those few basic functions. Some of the other functions were perhaps outside of the needs of most adventure games.

Regardless, I'm super grateful for you and thank you for working on this for all of us :)

eri0o

Just to keep this updated I have not yet had an answer from Valve and I am following a string of emails on GoG, but haven't yet got any useful answers.

In the meantime, I made a few advancements using other people's games, still haven't got it working yet, haven't had enough time to work during the week, but at least wrote the dummy driver and got a few ideas going on.

I believe I can at least make a post on the plugin forum board in the weekend with something.

Spoiler
Everytime I write C++ code I remember I don't actually know it well and it takes quite a few tries to get things going... :/

I am quite used to the nice utilities that exists in AGS codebase I forget the std is not great.
[close]

TheVolumeRemote

Quote from: eri0o on Thu 16/05/2024 23:16:57Just to keep this updated...

Thank you for the update eri0o, I've been checking in to see how it's going. I'll keep an eye on the plug-in forum this weekend and please let me know if there's anyway I can help. I really appreciate you :)

eri0o

ok, turns out a lot happened this weekend and I couldn't put as much effort as I wanted, so I am putting the source here: https://github.com/ericoporto/agsworks

There's a lot to do still, and during this week I will be traveling for work, so I will only touch it again next weekend. :/

The point I currently am is I want to use functions from the Steam and Gog API dynamically, and I have both headers. The thing is their APIs are C++ APIs so I need to do some magic there to be able to do this and I couldn't yet figure what such magic is.

TheVolumeRemote

Quote from: eri0o on Mon 20/05/2024 00:18:17There's a lot to do still, and during this week I will be traveling for work, so I will only touch it again next weekend.

I'm just here to wish you safe travels, thank you again for your work on this and then, I don't know. I set this up like I had a third thing... let's see... okay you said you needed to find that magic so I will do 2 things, 1, recommend you sleep bc that worked last time and 2, I'll offer a firm but supportive tap on the back that says "I believe in you!" :)

and it's true, I do. and I wish I could help more directly but will at least be here for moral support!

Crimson Wizard

Quote from: eri0o on Mon 20/05/2024 00:18:17The point I currently am is I want to use functions from the Steam and Gog API dynamically, and I have both headers. The thing is their APIs are C++ APIs so I need to do some magic there to be able to do this and I couldn't yet figure what such magic is.

If you mean getting function pointers from dlls, that's relatively simple, but has to be done differently per platform. We use "Library" class for this in AGS:
https://github.com/adventuregamestudio/ags/blob/e4a015b53ca7b6c6b4fc633fb334c1978daba65e/Engine/util/library_windows.h#L103-L108
https://github.com/adventuregamestudio/ags/blob/e4a015b53ca7b6c6b4fc633fb334c1978daba65e/Engine/util/library_posix.h#L94-L99


eri0o

Thanks @TheVolumeRemote !

And thanks @Crimson Wizard . So I got that but then noticed that Steam and Galaxy (GoG) have C++ APIs. Luckily Steam has a flat API too that is a C API so I can use that perhaps, but Galaxy doesn't.

I am playing with a library called dylib that has some name mangling facilities, that more or less work, but I may end up doing my own version of it - it's not a lot of code apparently and I need to have this working in C++11 for the Linux version anyway - although I may be able to bump to newer C++ since Galaxy doesn't have a Linux port.

SMF spam blocked by CleanTalk