Author Topic: The web version of AGILE (https://agi.sierra.games)  (Read 14430 times)

0 Members and 1 Guest are viewing this topic.

Offline lance.ewing

The web version of AGILE (https://agi.sierra.games)
« on: April 04, 2024, 04:07:51 PM »
Time to get the ball rolling with regards to a thread dedicated to AGILE GDX. I called it that simply because it is AGILE ported over to use the libgdx framework. So, agile-gdx is the name of the repo where I've put the code (https://github.com/lanceewing/agile-gdx), but when the web app runs in a browser, it is simply called AGILE.

https://agi.sierra.games/

The first request I have for feedback is with regards to the domain name. I managed to register the domain "sierra.games", and I've set up the sub-domain agi.sierra.games for accessing the web app. I thought that it quite nicely conveys what AGILE is all about, and it probably means more to people outside our community than something like agilegdx.com or agile.agifans.com would. If you try agi.sierra.games at the moment, you'll get a password form. I didn't want to open it up to everyone at this stage, in case it gets shared around too much before I'm ready. I may change various things over the next month and don't want to upset people that get used to how it currently is, and besides, its probably still a bit untested here and there, which is where I'll need your help. I haven't yet played a game through to completion, as I've been focusing more on the usability of the interface. I'm relying a lot of the fact that the AGILE C# version had most of the bugs resolved.

The biggest outstanding issue I have is a memory leak where it falls over after a while. Both the web and Java versions do this. I haven't seen it for a while, but that is mainly because I'm only running it for a few minutes at a time at the moment, to test specific fixes and changes. I will need to fix that memory leak before I fully release it to the world. All the other things on my TODO list are mainly nice to haves. There are a couple of bigger ones, e.g. not loading in the mobile version of Firefox, or on an ipad, but to be honest, if it loads and runs fine in Chrome, Edge and Firefox on a laptop/desktop, and on Chrome & Samsung Internet on Android, then that covers a lot of users. - I have no idea yet if it loads in Safari on a Macbook. I'm sure one of you will tell me that once I give you the password. Macbooks are very popular with web developers, so it would be great to confirm whether it works or not on there, and hopefully possible to fix if not. I'm really hoping it will be possible to fix on the ipad and iphone as well.

Let me know if you're keen to test it out and I'll send you a PM with the password. I didn't want to put it into this post. At some point I'll remove the password form. Actually, what I might do is send a PM already to people that I've seen on the site over the past couple of months, and other people I think might be interested. If you didn't get a PM, then let me know and I'll forward you the message.

The "core" of this web version of AGILE is obviously the interpreter itself, which should behave very similar to the C# version. Around that I have put a lot of usability features. For starters, it has a home screen that is modelled along the lines of things like the Android OS, Netflix, Amazon Prime, Disney+, etc., i.e. where you have pages of thumbnails that you can scroll/flick through and select. It comes preloaded with most of the AGI fan made games (there are a couple that don't work that I need to investigate further, so haven't yet included them). The first 14 games in the list are the original Sierra On-Line AGI games. It does not come preloaded with those ones for obvious reasons, but hopefully I've made it fairly easy to import them. You can either select a folder with the game files in it, or a ZIP file that contains the game files. It will then store them within the browser so that you don't have to continually import the games. Obviously this means that if you switch to another web browser, or try it on another device, you'll have to import it again, as it is tied to the browser installation. The same is true of the saved games.

I'll leave it at that for now. Looking forward to the feedback. Thanks.



Offline doomlazer

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #1 on: April 04, 2024, 11:03:05 PM »
Unfortunately, it doesn't load (after entering the password) in Safari. Attached an image below in case the error message is helpful at all.

I'll try to play through some games this weekend to look for bugs.

Game selection interface is pretty slick, but it would be nice if it remembered which page you were on when exiting a game instead of always reverting to page one.

An option to export all imported games and saves to a file would be really useful for backups and migrating to different devices.

Also, since you can delete the fan games, a way to restore them without nuking the browser cache might be good. Perhaps some more meta data about the fan game author, release date, etc. would be nice - I noticed several that I spot checked didn't have any credits in the About menu or the title screens.

Offline russdanner

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #2 on: April 04, 2024, 11:35:46 PM »
I'd like to check it out. Can I get the password?

Offline russdanner

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #3 on: April 04, 2024, 11:37:29 PM »
I'd like to check it out. Can I get the password?

OOOPS! I just saw the message (still learning the ropes on this forum) :)

Offline lance.ewing

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #4 on: April 05, 2024, 03:11:37 AM »
Unfortunately, it doesn't load (after entering the password) in Safari. Attached an image below in case the error message is helpful at all.

Thanks for the feedback. Ah, that error message is unfortunate. The SharedArrayBuffer is key to the inner workings of the web version of the interpreter. It allows the web worker and the UI thread to instantly communicate with each other regardless of where in the code each side is. Certain parts of the interpreter depend heavily on that and I don't think there is another way to solve that problem. - Supposedly it should be available in the latest versions of Safari:

https://caniuse.com/?search=SharedArrayBuffer

What version of Safari are you using?

I'll try to play through some games this weekend to look for bugs.

Thanks.

Game selection interface is pretty slick, but it would be nice if it remembered which page you were on when exiting a game instead of always reverting to page one.

An option to export all imported games and saves to a file would be really useful for backups and migrating to different devices.

Also, since you can delete the fan games, a way to restore them without nuking the browser cache might be good. Perhaps some more meta data about the fan game author, release date, etc. would be nice - I noticed several that I spot checked didn't have any credits in the About menu or the title screens.

Some great suggestions, Thanks. I'll see what I can do.

Offline lance.ewing

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #5 on: April 05, 2024, 03:41:33 AM »
OOOPS! I just saw the message (still learning the ropes on this forum) :)

Sorry for the confusion. You weren't the only one. I should have made that part of my post a bit clearer. Most of you should have the private message in your sciprogramming.com inbox now.
« Last Edit: April 05, 2024, 07:30:05 AM by lance.ewing »

Offline lance.ewing

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #6 on: April 05, 2024, 04:47:14 AM »
What version of Safari are you using?

MDN docs agree that it should be available from Safari 15.2 onwards, which was apparently released in Dec 2021.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer

Quote
SharedArrayBuffer objects are in principle always available, but unfortunately the constructor on the global object is hidden, unless the two headers mentioned above are set, for compatibility with web content.

What it means by that is that the response needs to have the following HTTP response headers:

Quote
Cross-Origin-Opener-Policy with same-origin as value (protects your origin from attackers)
Cross-Origin-Embedder-Policy with require-corp or credentialless as value (protects victims from your origin)

...which is the main reason why I'm hosting it on CloudFlare rather than Github Pages. It needs to add those two headers.

So that is another thing to check: Can you see the following HTTP response headers in the responses coming back from agi.sierra.games? The second one has two possible values to use, so I went with the credentialless value. Maybe I could try changing it to require-corp to see if that works on Safari.

Edit: Found the release notes for 15.2: https://developer.apple.com/documentation/safari-release-notes/safari-15_2-release-notes
« Last Edit: April 05, 2024, 04:51:15 AM by lance.ewing »

Offline doomlazer

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #7 on: April 05, 2024, 09:09:39 AM »
My Safari version is Version 16.6.1

Here are the response headers from agi.sierra.games:

Code: [Select]
Summary
URL: https://agi.sierra.games/
Status: 200
Source: Network
Address: 104.21.75.171:443

Request
:method: GET
:scheme: https
:authority: agi.sierra.games
:path: /
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate, br
Accept-Language: en-us
Connection: keep-alive
Cookie: CFP-Auth-Key=8e3f8a943893d9f2d1afbf9e35327e2aaa8adab297c535d4f11ae0dc26167d08
Host: agi.sierra.games
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: none
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.6.1 Safari/605.1.15

Response
:status: 200
Access-Control-Allow-Origin: *
Alt-Svc: h3=":443"; ma=86400
Cache-Control: public, max-age=0, must-revalidate
cf-cache-status: DYNAMIC
cf-ray: 86f9bca0a9869b59-SEA
Content-Encoding: br
Content-Type: text/html; charset=utf-8
Cross-Origin-Embedder-Policy: credentialless
Cross-Origin-Opener-Policy: same-origin
Date: Fri, 05 Apr 2024 13:03:11 GMT
nel: {"success_fraction":0,"report_to":"cf-nel","max_age":604800}
Referrer-Policy: strict-origin-when-cross-origin
Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v4?s=tShtXsPa0UEO5Aj9%2F9Be0U1XRFTm8OePWpqIdnpBZHWUxz5xJhPqIFqigc8%2F3TX9cZF19BQ2gS3dlSmJqlTE9oNI0cfme9u4Ldk0Bf16%2F9PPCpB2raNeOjvgXXg65Qn6YVgW"}],"group":"cf-nel","max_age":604800}
Server: cloudflare
Vary: Accept-Encoding
X-Content-Type-Options: nosniff


Edit: require-corp might fix it. If you want to try, I can test it again after work.

If it can't be fixed most Mac users have Firefox or Chrome installed as well, so just detecting the browser and displaying an error  message directing users to another browser would probably be fine.
« Last Edit: April 05, 2024, 10:30:07 AM by doomlazer »

Offline lance.ewing

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #8 on: April 05, 2024, 12:34:04 PM »
Edit: require-corp might fix it. If you want to try, I can test it again after work.

If it can't be fixed most Mac users have Firefox or Chrome installed as well, so just detecting the browser and displaying an error  message directing users to another browser would probably be fine.

Can you try it again now? I have changed it to require-corp. It does appear that this is what the webkit implementation was originally (perhaps is still?) looking for:

https://trac.webkit.org/changeset/281832/webkit/

Edit: MDN says that "credentialless" is not supported by Safari (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy#browser_compatibility), so that would explain it.

Edit 2: Oh! It also says that Firefox for Android doesn't support credentialless. That might be why it doesn't work on there then.
« Last Edit: April 05, 2024, 12:40:52 PM by lance.ewing »

Offline Charles

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #9 on: April 05, 2024, 03:20:17 PM »
Hey, I've just given it a quick try today, and gotta say it's very cool.

I only played around for a couple minutes so haven't really put it through its paces... running Firefox in Windows 10, so not really an edge-case scenario. The only things I noticed off the bat i was curious about: how much control do you have over the filters/scalers?  It looks like a simple bilinear upscale, which is really blurry... my personal preference is a nearest-neighbor overscale, then bilinear to down-sample to the desired size.

Also, ever since i learned the Apple IIgs versions have digitized sounds effects, those have been my goto in scummvm. I tried loading KQ3 IIgs and while it detected it, it only loaded a black screen. Are those unsupported?

Oh, and one minor thing... thanks to my goldfish memory, when I clicked a game to load, I'd forgotten which game I'd clicked on by the time it came for me to browse for it. Are you able to put the game name in the file dialog? Or is that too OS specific? Or maybe a different kind of highlight in the game selection window while I'm browsing.

Otherwise though, super impressive work. It looks fantastic!

Offline doomlazer

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #10 on: April 05, 2024, 06:47:56 PM »
Edit: require-corp might fix it. If you want to try, I can test it again after work.

If it can't be fixed most Mac users have Firefox or Chrome installed as well, so just detecting the browser and displaying an error  message directing users to another browser would probably be fine.

Can you try it again now? I have changed it to require-corp. It does appear that this is what the webkit implementation was originally (perhaps is still?) looking for:

https://trac.webkit.org/changeset/281832/webkit/

Edit: MDN says that "credentialless" is not supported by Safari (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cross-Origin-Embedder-Policy#browser_compatibility), so that would explain it.

Edit 2: Oh! It also says that Firefox for Android doesn't support credentialless. That might be why it doesn't work on there then.

Works on Safari for iOS! I'll check the desktop version in a few hours when I get home.

Edit: Working well on Safari desktop now! Nice work.

Edit2: Safari can't seem to import games. No error message, the other browsers on OS X import fine.
« Last Edit: April 06, 2024, 12:15:05 AM by doomlazer »

Offline AGKorson

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #11 on: April 05, 2024, 09:00:04 PM »
I did a quick test of it this afternoon (Windows 11, Edge). It's really quite impressive!

So far, the only thing I found is the '5' key on number pad is supposed to stop ego motion. Looking at your source, that should be easy enough to add.

I also agree with Charles. I don't care for the blurry upscaling. If possible, a setting allowing user to choose the scaling mode would be nice.

I am very interested in how you got the sound to emulate the original. I'd like to do the same in WinAGI if possible. Do you think it would be possible to port that to C#?

Offline lance.ewing

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #12 on: April 06, 2024, 02:58:28 AM »
Hey, I've just given it a quick try today, and gotta say it's very cool.

Thanks.

I only played around for a couple minutes so haven't really put it through its paces... running Firefox in Windows 10, so not really an edge-case scenario. The only things I noticed off the bat i was curious about: how much control do you have over the filters/scalers?  It looks like a simple bilinear upscale, which is really blurry... my personal preference is a nearest-neighbor overscale, then bilinear to down-sample to the desired size.

I'll have a look to see what I can do. I think it should be possible.

Also, ever since i learned the Apple IIgs versions have digitized sounds effects, those have been my goto in scummvm. I tried loading KQ3 IIgs and while it detected it, it only loaded a black screen. Are those unsupported?

Strange that it recognised it actually. I have only added detection for DOS versions of the games so far. I assume that the DIR file it uses to calculate the MD5 hash from is identical in that IIgs version of KQ3 to one of the DOS versions. I'm not sure when I would get around to supporting the other platforms. I don't think it would be for quite a while, but it is something I'll add to the list for when time allows.

Oh, and one minor thing... thanks to my goldfish memory, when I clicked a game to load, I'd forgotten which game I'd clicked on by the time it came for me to browse for it. Are you able to put the game name in the file dialog? Or is that too OS specific? Or maybe a different kind of highlight in the game selection window while I'm browsing.

I've encountered the same problem a few times. Unfortunately, I don't appear to have control over that, at least not with what I'm currently using to open the file dialog. I will check if there is an alternative way to open file dialogs that has that kind of control.

Offline lance.ewing

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #13 on: April 06, 2024, 03:21:55 AM »
Works on Safari for iOS! I'll check the desktop version in a few hours when I get home.

Nice! Was that on an iPhone, or an iPad? I guess it might work on both if it works on one.

Edit: Working well on Safari desktop now! Nice work.

Cool! Good to know that that was what the issue was then.

Edit2: Safari can't seem to import games. No error message, the other browsers on OS X import fine.

Ah... not so nice. At what point does it stop working? Does it show the open file dialog? - Unfortunate that there are no errors logged. Usually browsers are quite good at logging errors for things that don't work. No error could be a clue though.

Does the save game feature work in Safari? The game import code uses something called OPFS to store the game data. Saved games uses the same OPFS feature. It looks like OPFS should be supported in Safari from 15.2 onwards.

The game import feature uses a kind of hack. It could be due to that. What it does is to use Javascript to dynamically create a file type input element and then uses JS to click it. It registers an onchange event listener on that element so that when the file(s) are uploaded, it then uses a FileReader to process them. FileReader API has been around for a long time, but not sure if all browsers are happy with that hack I'm using.

I could add some debug console logging, but I'll let you answer the above questions first, so I know where to focus.

Offline lance.ewing

Re: The web version of AGILE (https://agi.sierra.games)
« Reply #14 on: April 06, 2024, 03:35:10 AM »
I did a quick test of it this afternoon (Windows 11, Edge). It's really quite impressive!

Thanks!

So far, the only thing I found is the '5' key on number pad is supposed to stop ego motion. Looking at your source, that should be easy enough to add.

I have been developing on a Microsoft Surface tablet that doesn't have that key, but I agree that it should be easy to fix. I do have a couple of old desktop PCs I could fire up to test on, if I can find the cables...  or better yet, I'll just plug one of their keyboards into the tablet.

I also agree with Charles. I don't care for the blurry upscaling. If possible, a setting allowing user to choose the scaling mode would be nice.

I'll take a look. If people are in agreement that the blurry upscaling isn't great, then I'll just switch over to Charles' suggestion. I haven't yet thought about how best to add a settings option into the UI and still keep it looking good.

I am very interested in how you got the sound to emulate the original. I'd like to do the same in WinAGI if possible. Do you think it would be possible to port that to C#?

I don't think it is that different from the C# version to be honest, so if you look in the C# AGILE repo, you should be able to use that. It uses an emulation of the computer chip used in the PCJR to play sound. Look in the SoundPlayer.cs file: https://github.com/lanceewing/agile/blob/master/AGILE/SoundPlayer.cs



SMF 2.0.19 | SMF © 2021, Simple Machines
Simple Audio Video Embedder

Page created in 0.04 seconds with 23 queries.