luxtorpeda icon indicating copy to clipboard operation
luxtorpeda copied to clipboard

Engine request - Adventure Game Studio

Open neuromancer opened this issue 4 years ago • 25 comments

AGS could be a good addition to support a large amount of windows-only games using it (or to fix bugs in the games with Linux releases using ancient versions of it!)

neuromancer avatar Jul 31 '19 19:07 neuromancer

I am not sure if vanilla AGS is capable of running specific games - I think (but hopefully can be proven wrong), that games using AGS tend to fork the project and add it's own modifications on top - at least that's the case for Whispers of a Machine AGS engine, which I am very interested in compiling for Linux and packaging.

Do you know some specific games (and their Steam App IDs), that can be played through upstream AGS? You can also edit table in this wiki page: https://github.com/dreamer/luxtorpeda/wiki/Game-engines

dreamer avatar Jul 31 '19 20:07 dreamer

In fact, 99% of the games I played with AGS in Steam are working fine in modern versions of vanilla AGS. Some examples:

  • All Wadjet Eye games (Blackwell series, Shivah, Gemini Rue, Resonance, Primordia, puzzlebots, etc..)
  • Ben there, Dan that, time gentlemen please!
  • Heroine’s Quest (free!)
  • The Samaritan Paradox

I like to replace the AGS runtime, not only to fix potential bugs in old version but also because I like to use software that I have compiled from source. Even some recent games like Katty Rain and Whispers of a Machine are supported (or nearly supported as you can see here)

The only potential issue is the lack of the steam AGS plugin, that can be workaround using this: https://github.com/onitake/agsteamstub (However, I believe they provide this plugin with the game, it should work somehow)

neuromancer avatar Jul 31 '19 20:07 neuromancer

If these games work with vanilla AGS, then it's great news :) Let's start documenting SteamAppIDs.

dreamer avatar Jul 31 '19 20:07 dreamer

Here are the list of the games, not all are on Steam obviously:

https://www.adventuregamestudio.co.uk/site/games/allgames/

and

https://pcgamingwiki.com/wiki/Engine:Adventure_Game_Studio

Faalagorn avatar Aug 01 '19 21:08 Faalagorn

I made an AGS package supporting four Wadjet Eye games, Resonance, Shardlight, Technobabylon, and A Golden Wake; this does NOT work with Gemini Rue or Primordia (Or Kathy Rain, another AGS but not Wadjet Eye game).

The repo is here: Luxtorpeda-AGS

The necessary packages.json adjustment is here:

"307580": {
	"game_name":    "Technobabylon",
	"download": [
			{
					"name": "AGS",
					"url":  "https://gnoling.gitlab.io/luxtorpeda-ags/",
					"file": "ags-307580.tar.xz"
			}
	],
	"command":      "./ags64",
	"command_args": ["--windowed", "--gfxfilter", "stdscale", "2"]
},
"371800": {
	"game_name":    "Technobabylon Demo",
	"download": [
			{
					"name": "AGS",
					"url":  "https://gnoling.gitlab.io/luxtorpeda-ags/",
					"file": "ags-371800.tar.xz"
			}
	],
	"command":      "./ags64",
	"command_args": ["--windowed", "--gfxfilter", "stdscale", "2"]
},
"212050": {
	"game_name":    "Resonance",
	"download": [
			{
					"name": "AGS",
					"url":  "https://gnoling.gitlab.io/luxtorpeda-ags/",
					"file": "ags-212050.tar.xz"
			}
	],
	"command":      "./ags64",
	"command_args": ["--windowed", "--gfxfilter", "stdscale", "3"]
},
"336130": {
	"game_name":    "Shardlight",
	"download": [
			{
					"name": "AGS",
					"url":  "https://gnoling.gitlab.io/luxtorpeda-ags/",
					"file": "ags-336130.tar.xz"
			}
	],
	"command":      "./ags64",
	"command_args": ["--windowed", "--gfxfilter", "stdscale", "3"]
},
"307570": {
	"game_name":    "A Golden Wake",
	"download": [
			{
					"name": "AGS",
					"url":  "https://gnoling.gitlab.io/luxtorpeda-ags/",
					"file": "ags-307570.tar.xz"
			}
	],
	"command":      "./ags64",
	"command_args": ["--windowed", "--gfxfilter", "stdscale", "3"]
}

The current version of this leaves a lot to be desired, it does use a forked version of agsteamstub that adds a few API calls some of the games above require. There is some discussion to be made for better/further support, contrary to what's available on Steam some of the games actually do have official linux versions, and those support achievements and just aren't available on steam. Likewise, taking a prebuilt copy of the steam support .so's does work drop-in style, however I'm unsure if the licensing allows it to be distributed in that manner -- I think it might allow prebuilt to be distributed, but not the necessary source code to compile it.

Other AGS games not mentioned may work with this build (the built versions in the above quote are identical -- if anyone wants to test them, feel free to re-use the download urls for any of the above, or simply copy and paste the unpacked files to a game directory and try them out!). Unfortunately, most of my games for this engine I own on GOG, not Steam.

gnoling avatar Aug 19 '19 22:08 gnoling

That's great :) Are you the same user, who mentioned working on AGS on Discord channel?

I have several questions though:

Your package includes a binary version of AGS and does not rebuild it for Steam runtime. It might work - if this version of AGS was compiled in an environment compatible with Steam runtime - but I suspect it might fail on many Linux distributions. When projects distribute pre-built binaries this way, they usually fail everywhere except Ubuntu. Did you verify ABI versions of glibc++ and other libraries included in AGS zip file?

this does NOT work with (…) Kathy Rain

Shame, it's on my to-play list… But it supports Demo version of Technobabylon, so we have something to test it against :)

Likewise, taking a prebuilt copy of the steam support .so's does work drop-in style, however I'm unsure if the licensing allows it to be distributed in that manner -- I think it might allow prebuilt to be distributed, but not the necessary source code to compile it.

Maybe we can simply borrow this file from version already available on user's machine.

"command_args": ["--windowed", "--gfxfilter", "stdscale", "2"]

Any particular reason for these options? I am curious about --windowed.

Also, have you tried with any newer version of engine or do these games require this specific version?

I will fork your repo to create a new package and do some testing, maybe even merge changes to packages.json - but probably won't advertise it as "officially" supported in README file (yet). I would be much more comfortable when rebuilding engine specifically for Steam Runtime - it makes it easier to provide future maintenance and support wide range of distros.

From my POV this is WIP, but you we just moved substantially towards supporting AGS :)

dreamer avatar Aug 19 '19 23:08 dreamer

Yes that is me on the channel. Agreed on this being WIP, newer versions do NOT work on these games for varying reasons. It's very possible the unsupported games might work though! The version chosen matches the used version for one of the games, and the others simply "also work".

I haven't really worked on this for about a week and a half due to a vacation, prior to that I discussed issues with compiling on the discord server a bit which was the original approach I took.

As for those options, they're display options /mostly/ common to all versions of AGS. Windowed starts the games in a window, and the gfx filter option is what size to scale the game from it's original resolution. In my example package code they're set to roughly the same window size once scaled as the games differ in original sizes -- we might want full screen as default though. It'd honestly be ideal for a very basic launcher to choose those options.

On Mon, Aug 19, 2019, 6:22 PM Patryk Obara [email protected] wrote:

That's great :) Are you the same user, who mentioned working on AGS on Discord channel?

I have several questions though:

Your package includes a binary version of AGS and does not rebuild it for Steam runtime. It might work - if this version of AGS was compiled in an environment compatible with Steam runtime - but I suspect it might fail on many Linux distributions. When projects distribute pre-built binaries this way, they usually fail everywhere except Ubuntu. Did you verify ABI versions of glibc++ and other libraries included in AGS zip file?

this does NOT work with (…) Kathy Rain

Shame, it's on my to-play list… But it supports Demo version of Technobabylon, so we have something to test it against :)

Likewise, taking a prebuilt copy of the steam support .so's does work drop-in style, however I'm unsure if the licensing allows it to be distributed in that manner -- I think it might allow prebuilt to be distributed, but not the necessary source code to compile it.

Maybe we can simply borrow this file from version already available on user's machine.

"command_args": ["--windowed", "--gfxfilter", "stdscale", "2"]

Any particular reason for these options? I am curious about --windowed.

Also, have you tried with any newer version of engine or do these games require this specific version?

I will fork your repo to create a new package and do some testing, maybe even merge changes to packages.json - but probably won't advertise it as "officially" supported in README file (yet). I would be much more comfortable when rebuilding engine specifically for Steam Runtime - it makes it easier to provide future maintenance and support wide range of distros.

From my POV this is WIP, but you we just moved substantially towards supporting AGS :)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/dreamer/luxtorpeda/issues/8?email_source=notifications&email_token=AAF3U5WHPCGTLIHNSQIKPGDQFMTLHA5CNFSM4IIKBYA2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD4USQKA#issuecomment-522790952, or mute the thread https://github.com/notifications/unsubscribe-auth/AAF3U5SLXR7AMWDRJPPFNSLQFMTLHANCNFSM4IIKBYAQ .

gnoling avatar Aug 19 '19 23:08 gnoling

How can I test this WIP package?

neuromancer avatar Aug 28 '19 22:08 neuromancer

You can add new entries mentioned by @gnoling above to packages.json file in directory, where Luxtorpeda is installed on your system and that's basically it.

Just be aware, that these are precompiled binaries and not created specifically for Steam Runtime - I haven't verified if they are exactly the same as binaries provided by AGS project. Once I'll have some time, I intend to re-create these packages by compiling the source code during package creation - it should also be possible to compile several different versions of AGS in parallel, to support more games.

dreamer avatar Aug 28 '19 22:08 dreamer

We have now buildable AGS package https://gitlab.com/luxtorpeda/packages/ags :)

@gnoling information you provided was essential, but I decided to create a new package from scratch; feel free to send merge requests to that repo. Or maybe you want to be a maintainer? I don't own any of the titles mentioned above - it would make sense to have a package maintainer that can easily test things.

Allegro and AGS were somewhat annoying due to both projects not following the usual build conventions and outdated documentation, but it's resolved now :) I'll probably need to send a patch to upstream at some point.

AGS now builds, but it likely does not work with games yet (I skipped bundling *.so files and there's no launcher script yet) - hopefully I can make it work with Technobabylon Demo.

[edit] it would be super cool to identify games, that require other version of AGS to run.

dreamer avatar Aug 31 '19 19:08 dreamer

I just tested Technobabylon and I can confirm it does not run. I tried to manually run it using a recent version of AGS (I had installed 3.4.1.10) and the agsteamstub and it worked fine.

neuromancer avatar Aug 31 '19 21:08 neuromancer

@gnoling have you tried to play the game or did you just run it?

Technobabylon Demo starts (without sound), but the moment I try to play it, it closes with:

Adventure Game Studio v3.4 Interpreter
Copyright (c) 1999-2011 Chris Jones and 2011-2018 others
ACI version 3.4.1.13

Initializing allegro
Initializing game data
Located game data file: /home/dreamer_/.local/share/Steam/steamapps/common/Technobabylon Demo/Technobabylon.exe
Opened game data file: game28.dta
Game data version: 43
Compiled with: 3.3.0.1164
Setting up game configuration
Setting up window
Initializing TTF renderer
Initializing mouse: number of buttons reported is 3
Checking memory
Data directory: /home/dreamer_/.local/share/Steam/steamapps/common/Technobabylon Demo
Voice pack found and initialized.
Audio vox found and initialized.
Initializing keyboard
Install timer
Sound settings: digital driver ID: 'Auto' (0xffffffff), MIDI driver ID: 'Auto' (0xffffffff)
Failed to init one of the drivers; Error: 'Insufficient digital voices available'.
Will try to start without MIDI
Failed to init one of the drivers; Error: 'Insufficient digital voices available'.
Will try to start without DIGI
Failed to init sound drivers. Error: Insufficient digital voices available

Unable to initialize your audio hardware.
[Problem: /dev/sequencer: No such file or directory]
Installed digital driver ID: 'None' (0x0), MIDI driver ID: 'None' (0x0)
Install exit handler
Initialize path finder library
Game GUI version: 116
Placeholder functions for the plugin 'ags_shell' found.
Game title: 'Technobabylon'
Checking for disk space
Game native resolution: 640 x 400 (32 bit)
Game settings: windowed = yes, screen def: scaling, screen size: 0 x 0, match device ratio: ignore, game scale: 2
Mouse control: off, base: 1.000000, speed: 1.000000
Initialize sprites
Audio is processed on the main thread
Engine initialization complete
Starting game
An error has occurred. Please contact the game author for support, as this is likely to be a scripting error and not a bug in AGS.
(ACI version 3.4.1.13)

in "TechnoScript.asc", line 1007
from "GlobalScript.asc", line 780

Error: Error running function 'ButtonStart_OnClick':
Error: Null pointer referenced

***** ENGINE HAS SHUTDOWN

I haven't added agsteamstub to the build yet, though - does it help with this issue? How does the log look like for working invocation of the game?

dreamer avatar Aug 31 '19 22:08 dreamer

That might be fixable with settings changes to acsetup.cfg (if I recall the filename correctly), though you shouldn't "have" to generally speaking; that's where engine settings and devices can be set. I've played the games I mentioned earlier / the ones I noted as compatible, the only exception is actually the one you tested with -- the demo version of Technobabylon. When I get a chance I'll give your version a shot with the full games.

I'm willing to be a package maintainer, sure.

That error wouldn't be related to agsteam, those would appear as script/function errors later on in startup and they'd note missing functions like "AGSteam::*" and "Steam::". My forked version adds some additional placeholders required for some of the games. The problem we'll run into with the steam versions of AGS games regarding agsteam is related to how much that module has changed over the years, renaming different functions and they're returns and such; the one mentioned in this thread placeholders them, but is missing some. Non-steam versions of the games, which do exist, I imagine are much easier to get working with homegrown AGS compiles due to this.

I looked at the pipeline output of your last build and nothing jumped out at me immediately. If its not fixable through configuration its probably related to allegro (or possibly libdumb == being audio related).

gnoling avatar Sep 01 '19 01:09 gnoling

Out of curiosity, have you tried my non-build build and see if that works on your system? I believe I left the URL of the package it uses in build.sh, you can always just md5sum compare them if you're worried about that. If I didn't you can find it under their releases on github for that repo. Source is absolutely the way to go obviously, but it'd be good to know.

gnoling avatar Sep 01 '19 01:09 gnoling

Just tried and pre-built version fails in exactly the same way for me. This might indicate a problem with the Demo version (as log would suggest).

Also, both versions trigger a bug when running in fullscreen (they break my display setup and both of my displays are mirrored - even after the game exits) - is it a known issue?

@neuromancer The version you tested had 2 small bugs, that I corrected in successive commits.

@gnoling Added you as a maintainer - just follow commit message guidelines and run lint.sh to prevent problems with shellscripts :) (I seriously need to write proper contributing guide).

dreamer avatar Sep 01 '19 02:09 dreamer

I was gifted Unavowed today (thanks, Zyro!); according to AGS forum thread, beta version was playable with AGS 3.4.1, but it does not start for me:

No placeholder functions for the plugin 'agsteam-unified' found. The game might fail to load.
Loading game failed with error:
Script link failed: Runtime error: unresolved import 'AGS2Client::SetAchievementAchieved^1'.

I get exactly the same error with both precompiled version and rebuilt version.

(libagsteam.so is already included with Luxtorpeda package)

dreamer avatar Sep 01 '19 23:09 dreamer

According to this, you need to compile agsteam-unified.so from here.

neuromancer avatar Sep 02 '19 03:09 neuromancer

@dreamer can you retry with 3.4.4.2? They recently merged the code for the Steam stubs, so there is no need to add a separated library.

neuromancer avatar Nov 22 '19 01:11 neuromancer

@dreamer I'm really longing for this, any chance you give it a look again? (zyro)

eikesauer avatar Oct 01 '20 12:10 eikesauer

I suppose I wouldn't mind trying to pick this up again either; I remember having trouble getting the build tools working properly on Ubuntu/Mint/Debian which made working on this really tedious but that was almost a year ago.

gnoling avatar Oct 01 '20 13:10 gnoling

An AGS implementation will be included in the next scummvm release (already available in their git repository). It will be absolutely great if we can allow users to test the scummvm version of this engine. Should we think in moving this Roberta instead?

neuromancer avatar Mar 21 '21 12:03 neuromancer

No, let's keep this issue in here. If AGS will work well for the selected games via ScummVM (it probably will) then great, but AGS was problematic just enough to build, that I will want to test it in new Steam Runtime Soldier runtime when working on Luxtorpeda 2.0.

dreamer avatar Mar 21 '21 13:03 dreamer

Fair enough. Keep in mind that compiling the AGS engine in ScummVM should be easier than the official version since the dependencies were simplified (unless you had trouble with ScummVM itself).

neuromancer avatar Mar 21 '21 15:03 neuromancer

Why not use the AGS- Engine from the Snap- Paggage? it's sinple to install and to use (snap install ags --edge --devmode) and ScummVM in "Roberta" had bind in local installed ScummVM to.

SaschaVasarrhelyi avatar Feb 01 '23 09:02 SaschaVasarrhelyi

Ok an great problem with snap- AGS is the midi-patch that dosn't work with this version of AGS but that hit's just old games like "The Adventures Of Fatman" or "5Days a Stranger" and so on. I know, eventualy an bad idea from me.

SaschaVasarrhelyi avatar Feb 01 '23 09:02 SaschaVasarrhelyi