Community
AGI Programming => AGI Development Tools => Topic started by: lance.ewing 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.
-
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.
-
I'd like to check it out. Can I get the password?
-
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) :)
-
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.
-
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.
-
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
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:
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
-
My Safari version is Version 16.6.1
Here are the response headers from agi.sierra.games:
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.
-
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.
-
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!
-
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.
-
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#?
-
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.
-
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.
-
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
-
One small thing that I noticed is that the folder browser gets pegged as a popup in Firefox. Odd in that a regular file/folder open dialog for uploading does not do this. That dialog looks like a normal Windows dialog and not a Java one. This does not occur on Chrome.
-
Nice! Was that on an iPhone, or an iPad? I guess it might work on both if it works on one.
iPhone, but should be the same browser on iPad.
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.
It allows me to select a folder or zip file, but does nothing once chosen. If you want to add some logging in GetDialogHandler.java I'll try it again.
Edit: Saving/loading seems to work just fine. Maybe it something later in the import process?
-
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, that's surprising... it added it as King's Quest 3 [Apple IIgs], but now that I look at it, the text is White (not grey) but the thumbnail picture is still dimmed. Honestly I was surprised that it recognized the IIgs version at all, but now I'm even more surprised knowing you didn't purposefully code it to recognize it.
-
Oh, that's surprising... it added it as King's Quest 3 [Apple IIgs], but now that I look at it, the text is White (not grey) but the thumbnail picture is still dimmed. Honestly I was surprised that it recognized the IIgs version at all, but now I'm even more surprised knowing you didn't purposefully code it to recognize it.
I think I know what happened. Was that the name of the folder that contained the files? If it can't detect the game, then it uses the folder name instead.
-
One small thing that I noticed is that the folder browser gets pegged as a popup in Firefox. Odd in that a regular file/folder open dialog for uploading does not do this. That dialog looks like a normal Windows dialog and not a Java one. This does not occur on Chrome.
What do you mean by pegged as a popup? Do you have something installed in Firefox to prevent popups? Or is that happening by default in your installation of Firefox? If so, what version of FF is it? - I am not seeing this behaviour in Firefox myself, but it does worry me a bit in regards to the way I'm launching that open file dialog, that perhaps it will be seen as a popup for other people as well.
-
It allows me to select a folder or zip file, but does nothing once chosen. If you want to add some logging in GetDialogHandler.java I'll try it again.
Edit: Saving/loading seems to work just fine. Maybe it something later in the import process?
When you say that it allows you to select a folder or zip file, do you mean the choice of option from the drop down in the "Please select the type of import" dialog? i.e. not the selection of the actual ZIP or folder within the open file dialog? Or do you mean that it shows the open file dialog, lets you select a folder or zip, but does nothing after that?
If it is the first scenario, then it could be that its getting blocked, perhaps even detected as a popup similar to what Collector described.
If it is the second scenario, then I have found this stackoverflow page that might be related, although it does appear to be mentioning only iOS Safari: https://stackoverflow.com/questions/47664777/javascript-file-input-onchange-not-working-ios-safari-only
It is unfortunate though, as I didn't really want to add the input element to the dom, although there is one person that says that simply changing the onchange to addEventListener was all that was required for them. For now, I'll add only the console logging, so that we can see where it gets up to. Hopefully that helps narrow it down.
I have just deployed the version with the console logging adding. Can you give it another go now and let me know what you see in the console? Thanks.
-
I'd like to check it out.
@russdanner, how are you getting on? I'm interested in how it works on the Linux versions of the browsers. Any issues so far?
-
It was the builtin popup blocker. Upgrading to the latest quit flagging it as a popup.
-
When you say that it allows you to select a folder or zip file, do you mean the choice of option from the drop down in the "Please select the type of import" dialog? i.e. not the selection of the actual ZIP or folder within the open file dialog? Or do you mean that it shows the open file dialog, lets you select a folder or zip, but does nothing after that?
If it is the first scenario, then it could be that its getting blocked, perhaps even detected as a popup similar to what Collector described.
If it is the second scenario, then I have found this stackoverflow page that might be related, although it does appear to be mentioning only iOS Safari: https://stackoverflow.com/questions/47664777/javascript-file-input-onchange-not-working-ios-safari-only
It is unfortunate though, as I didn't really want to add the input element to the dom, although there is one person that says that simply changing the onchange to addEventListener was all that was required for them. For now, I'll add only the console logging, so that we can see where it gets up to. Hopefully that helps narrow it down.
I have just deployed the version with the console logging adding. Can you give it another go now and let me know what you see in the console? Thanks.
Here is a short video capture so you can see what's happening: https://drive.google.com/file/d/1ynF57pzOToBCpV0fQLKBF9Gp5o97YUE9/view?usp=sharing
addEventListener ("load" in my case) has worked for me before with Safari, and I didn't need to appendChild to import.
-
It was the builtin popup blocker. Upgrading to the latest quit flagging it as a popup.
Thanks. That's good to know. I may need to put some checks in up front that displays a message if it thinks that the browser needs to be updated, e.g. checking for the APIs that it is dependent on, such as the SharedArrayBuffer, Origin Private File System, and a few others. Not certain exactly what to check for in the case of this popup blocker though. Perhaps the simplest way would be to check the browser version for each browser. I'd need to work out what the minimum is in each case though. Do you know what version of Firefox you had before you upgraded?
-
Here is a short video capture so you can see what's happening: https://drive.google.com/file/d/1ynF57pzOToBCpV0fQLKBF9Gp5o97YUE9/view?usp=sharing
addEventListener ("load" in my case) has worked for me before with Safari, and I didn't need to appendChild to import.
Thanks. That video seems to suggest that it is indeed the change event handler that isn't running. I have now changed it to use addEventListener rather than onchange. I've only made that change for now, i.e. haven't used appendChild yet. - Can you try again now?
-
Sorry, but it's the same behavior as before.
Edit: I'm hesitant to point to any of my own code, but this (http://github.com/Doomlazer/SCI-View-Converter/blob/0406941e26700828a5881f5f516b3afd67dfe876/index.html#L99) worked for me in Safari for loading view files:
function importFile() {
var input = document.createElement('input');
input.type = 'file';
input.onchange = e => {
var file = e.target.files[0];
const reader = new FileReader();
reader.addEventListener(
"load",
() => {
// Do stuff
}
},
false,
);
if (file) {
reader.readAsArrayBuffer(file);
}
}
input.click();
}
-
Sorry, but it's the same behavior as before.
Edit: I'm hesitant to point to any of my own code, but this (http://github.com/Doomlazer/SCI-View-Converter/blob/0406941e26700828a5881f5f516b3afd67dfe876/index.html#L99) worked for me in Safari for loading view files:
function importFile() {
var input = document.createElement('input');
input.type = 'file';
input.onchange = e => {
var file = e.target.files[0];
const reader = new FileReader();
reader.addEventListener(
"load",
() => {
// Do stuff
}
},
false,
);
if (file) {
reader.readAsArrayBuffer(file);
}
}
input.click();
}
One difference I can see is that I'm using the loadend event, whereas you're using the load event. According to the docs, the difference is that loadend is called regardless of whether it was successful or not.
This seems irrelevant though, as my code doesn't appear to be getting as far as the equivalent of your load event hadler. I currently have an event listener on the FileReader for the loadend event, but that is added within the change event listener, the start or which is as follows:
fileInputElem.addEventListener("change", function(event) {
if (this.files.length === 0) {
console.log('No files selected for import');
// No file was selected, so nothing more to do.
resultsHandler.@com.agifans.agile.gwt.GwtOpenFileResultsHandler::onFileResultsReady([Lcom/agifans/agile/gwt/GwtOpenFileResult;)([]);
}
else {
console.log('File(s) were selected for import. Reading them now...');
...and then later on within the code of that 'change' event listener, it creates the FileReader and adds the loadend event handler. But looking at your video, it isn't logging the "File(s) were selected for import. Reading them now..." message, so that would mean that the 'change' event handler hasn't been executed yet, so it wouldn't be getting to the FileReader creation or associated event handler.
But if your code is working in Safari, there must be a clue in there somewhere. Let me look it over for other differences... Hmmm, I can't seem to see anything that would explain why your onchange event handler is running and my one wasn't. I previously had it exactly as you have it, i.e. create the input file element then setting onchange, but that wasn't working, and now also the addEventListener equivalent isn't working.
Maybe there is something different about where our two bits of code are being executed from that makes Safari behave differently.
I can try a couple more things based on other suggestions I've seen in stackoverflow answers. I'll post back here in a bit after making the first of those (probably the appendChild change first, and if that doesn't work, then I'll try changing it to the blur event).
Edit: Just to double check my assumptions above, when you say the following:
Sorry, but it's the same behavior as before.
...were the console log messages also exactly the same? i.e. the "File(s) were selected for import. Reading them now..." message isn't logged? - I just realised I was commenting on the pre "addEventListener" version of the change event handler when referring to the console messages. What I might do before using appendChild is to change the load event of the FileReader to also use addEventListener, since I'm guessing I'll have an issue with that one as well.
-
What I might do before using appendChild is to change the load event of the FileReader to also use addEventListener, since I'm guessing I'll have an issue with that one as well.
I've just deployed that change. It is now using addEventListener for both the file input element change event, and now also the FileReader loadend event.
-
...were the console log messages also exactly the same? i.e. the "File(s) were selected for import. Reading them now..." message isn't logged? - I just realised I was commenting on the pre "addEventListener" version of the change event handler when referring to the console messages. What I might do before using appendChild is to change the load event of the FileReader to also use addEventListener, since I'm guessing I'll have an issue with that one as well.
The console messages are still:
[Log] About to create input element of type file...
[Log] Finished creating input element of type file
[Log] File input element has been clicked.
It seems like the "change" event listener never triggers on Safari. Testing with my old project, changing "load" to "loadend" fires an event, but "change" never seems to. Isn't change just for radio buttons and checkboxes?
Instead of using an event listener for "change" in my project I do:
input.onchange = e => {
while you've got:
fileInputElem.addEventListener("change", function(event) {
I only use the eventlistener for "load" on the FileReader.
-
The console messages are still:
[Log] About to create input element of type file...
[Log] Finished creating input element of type file
[Log] File input element has been clicked.
Okay, thanks for confirming that. Yeah, it seems that changing the "onchange" way of registering the change event handler to instead use the addEventListener("change"... way of registering it hasn't had any effect.
It seems like the "change" event listener never triggers on Safari. Testing with my old project, changing "load" to "loadend" fires an event, but "change" never seems to.
I'm a bit confused. It looks like your old project is also using the change event on a "file" type input element, i.e. in the bit I've included below:
function importFile() {
var input = document.createElement('input');
input.type = 'file';
input.onchange = e => {
The "onchange" on the input element is registering the change event listener. Are you saying that this code from your project doesn't work for you in Safari? Your code that uses the load event wouldn't run unless the change event is fired, as the code that adds the load event listener is in the change event listener.
Isn't change just for radio buttons and checkboxes?
The MDN documentation claims that the change event is fired when a file is selected using a "file" type of input:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event
...and it is working fine in other browsers. Not sure yet why it isn't firing in Safari for AGILE, but it might be due to it not being in the dom. I'll try the appendChild suggestion now. I'll let you know when that code is deployed. I'm a bit worried about a recent comment on the stackoverflow page (https://stackoverflow.com/questions/47664777/javascript-file-input-onchange-not-working-ios-safari-only#comment-137356332) from January 2024 where someone claims that in iOS 17.3 nothing works (addEventListener & append to dom). Fingers crossed that this won't end up being the case. Hopefully that person was encountering a different issue.
-
Instead of using an event listener for "change" in my project I do:
input.onchange = e => {
while you've got:
fileInputElem.addEventListener("change", function(event) {
I only use the eventlistener for "load" on the FileReader.
Sorry, in my last post, I hadn't seen your recent edit to your post. I've actually tried both approaches to registering the change event listener. The original code that you tried the first time was using the input.onchange approach that your project code is also using. That obviously didn't work for AGILE, and the stackoverflow page below mentions people that were having the same issue with the input.onchange approach not working:
https://stackoverflow.com/questions/47664777/javascript-file-input-onchange-not-working-ios-safari-only
A few of the answers and comments suggest that changing the "onchange" to use addEventListener instead fixed the problem for them, but that doesn't seem to have worked for AGILE. Neither the "onchange" approach nor the addEventListener approach have worked.
I'll try the append to dom approach to see if that works.
-
I'm a bit worried about a recent comment on the stackoverflow page (https://stackoverflow.com/questions/47664777/javascript-file-input-onchange-not-working-ios-safari-only#comment-137356332) from January 2024 where someone claims that in iOS 17.3 nothing works (addEventListener & append to dom).
Yeah, that doesn't bode well, does it. It's a shame because everything else seems to work fine on Safari besides import.
-
@doomlazer, can you give it another try now? The code now appends the input element to the dom. I couldn't see any visual difference, despite the fact that the file input element is now in the dom. It has added it into an iframe, which is where this Javascript is running (something to do with how libgdx sets up the web page), so I'm a little worried about whether this will actually work, but let's give it a go. If it doesn't work, then I can see if there is a way to get the input element added to the top level web page instead.
-
I completely reset the browsers on both the desktop and iPhone and it does import games now!
Unfortunately, there are some problems loading the imported games (Fan games load and play fine). Here's a video of the current errors: https://drive.google.com/file/d/13C3JOZBwA99aVaNrpzToXroiP35BO7O2/view?usp=sharing
I'm happy to keep testing, but please don't feel like you need to support Safari because of me.
-
I completely reset the browsers on both the desktop and iPhone and it does import games now!
That's great news! Thanks for confirming. Did you do the same reset before the previous tests? Just wondering if it really was the appending to the dom that made it work. I think I will leave it in there in any case, as it doesn't hurt, and can only help, really. It's not visible.
Unfortunately, there are some problems loading the imported games (Fan games load and play fine). Here's a video of the current errors: https://drive.google.com/file/d/13C3JOZBwA99aVaNrpzToXroiP35BO7O2/view?usp=sharing
Hmmm, this looks like it is in the OPFS part of the code. One of the methods I'm using isn't recognised. The saved game OPFS code works though, but that code doesn't use this particular method. It must be a more recent addition. Let me look up the documentation and release notes to see if I can find anything. Will report back later (will probably be tomorrow now).
I'm happy to keep testing, but please don't feel like you need to support Safari because of me.
You're actually doing me a big favour. I don't have easy access to testing on iPhone, iPad and Macbook myself, and I am quite keen for it to work on those platforms.
I have noticed that it now works on the Mobile version of Firefox, which it wasn't previously. I think that might have been from one of the earlier changes though, probably the security headers change.
-
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.
How does it look now? If you don't see a difference, try doing a force refresh of the page. I've changed it to "Nearest" in the code. It was set to Linear before. I'm surprised that I didn't change this already, as this is clearly different from the C# version of AGILE. I think I just got used to it and didn't notice it until you pointed it out. Now that I've changed it to Nearest, it looks a lot more original AGI :D
I didn't do the overscale and down-sample approach that you mentioned. All I did was change the filter it was already using from Linear to Nearest. Does it look good enough? Or do you think it needs the approach you mentioned? For all I know, the framework might be doing what you suggested under the hood, but not sure.
-
That's great news! Thanks for confirming. Did you do the same reset before the previous tests? Just wondering if it really was the appending to the dom that made it work. I think I will leave it in there in any case, as it doesn't hurt, and can only help, really. It's not visible.
I hadn't reset the history before. When the console logging was added it only took a page refresh, so I had normally been refreshing and deleting the stored website data. I tried refreshing after this most recent change and it still wasn't working. Since attaching to the DOM was kind of the last thing to try, I reset the history and it started importing the games.
Let me know when you make some changes and I'll try it again.
-
How does it look now? If you don't see a difference, try doing a force refresh of the page. I've changed it to "Nearest" in the code. It was set to Linear before. I'm surprised that I didn't change this already, as this is clearly different from the C# version of AGILE. I think I just got used to it and didn't notice it until you pointed it out. Now that I've changed it to Nearest, it looks a lot more original AGI :D
Oh much better. I don't see any need to do anything fancier than that for the classic chunky look. Others tastes may vary, but personally I think at a minimum this nearest neighbour look is better than a simple liner upscale.
And I think you were absolutely right about the folder name for the IIgs... it had to be that. Although it did auto add the KQ3 thumbnail which was surprising. Maybe it was because I clicked to add KQ3 to begin with, and duplicated that?
-
I think you were absolutely right about the folder name for the IIgs... it had to be that. Although it did auto add the KQ3 thumbnail which was surprising. Maybe it was because I clicked to add KQ3 to begin with, and duplicated that?
Well, it might be because it got the game ID from the LOGIC resources. If a game sets the game ID, but the detection tables don't have an entry for it, then it uses the game ID that is set in the LOGIC resources. Most original Sierra AGI games set the game ID, and for those that don't (MH1 is the only one, I think), then if it is an AGIV3 game, it uses the prefix of the DIR file. So it will pick up the KQ3 thumbnail due to that. This means that it successfully decoded the resource files, since if it hadn't, you would have got an error message pop up. So an IIgs game must in the most part have the same game data files and resource format. The digitized sound must be getting ignored. Obviously if it is hanging though, something isn't quite the same.
-
Unfortunately, there are some problems loading the imported games (Fan games load and play fine). Here's a video of the current errors: https://drive.google.com/file/d/13C3JOZBwA99aVaNrpzToXroiP35BO7O2/view?usp=sharing
Hmmm, this looks like it is in the OPFS part of the code. One of the methods I'm using isn't recognised. The saved game OPFS code works though, but that code doesn't use this particular method. It must be a more recent addition. Let me look up the documentation and release notes to see if I can find anything. Will report back later (will probably be tomorrow now).
It is bad news, unfortunately. Safari doesn't yet support the "createWritable" method on a file handle in OPFS. It is showing as not implemented on the MDN page:
https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileHandle
There is a bug associated with it (see comment 7):
https://bugs.webkit.org/show_bug.cgi?id=231706#c7
I'll have to get my head around OPFS again to see if I can use the approach I used for saved games when storing the game data files. It uses a SyncAccessHandle instead, which is supported by Safari. I avoided that one for the game data files for a reason but I need to work through it again to remember why. Hopefully it was one of these "too hard" decisions rather than "its impossible" cases. If it was simply harder than the other approach, then it might still be possible. Hopefully I can get this working then.
-
It is bad news, unfortunately. Safari doesn't yet support the "createWritable" method on a file handle in OPFS. It is showing as not implemented on the MDN page:
That's Safari for you, always behind everyone else. I remember they didn't support WebGL 2.0 until nearly 2 years after Edge did, and like 4 years after Chrome and Firefox supported it.
-
I'll have to get my head around OPFS again to see if I can use the approach I used for saved games when storing the game data files. It uses a SyncAccessHandle instead, which is supported by Safari. I avoided that one for the game data files for a reason but I need to work through it again to remember why. Hopefully it was one of these "too hard" decisions rather than "its impossible" cases. If it was simply harder than the other approach, then it might still be possible. Hopefully I can get this working then.
I recall what the issue was now. The sync access handle feature can only be used in web workers, since I guess they don't want to block the main UI thread with synchronous IO. That seems fair enough. So I won't be able to use it as an alternative unless I create a web worker to store it. It's not impossible then, but is a little inconvenient. I will see if I can add that in somehow. An idea on how I might do that is taking shape already.
-
@doomlazer, can you try the game import again in Safari, for both iOS and macbook? I have changed it now so that it uses a sync access handle within a web worker. I've confirmed it still works in Chrome. The question now is whether it will start working in Safari. I haven't yet tried Firefox or Edge.
-
Good news! It works on Safari iOS! I'll need to wait until I get home from work to test for the desktop version of Safari, but I'm sure it will be successful as well.
Edit: Confirmed working on Safari Desktop as well. Nice work!
FYI, I'm on a MBP that's 10+ years old and running an outdated OS, which can no longer be updated. While the game now loads fine, there seem to be some minor control/keyboard issues that take some browser refreshes to get working. I believe that's because I'm stuck on Safari 16.6.1. On the iPhone, which is running Safari 17.4, everything seems to work perfectly every time.
Not sure there is anything to be done about Safari <= v16, other than maybe mention Agile only officially support Safari 17+ somewhere.
-
Good news! It works on Safari iOS! I'll need to wait until I get home from work to test for the desktop version of Safari, but I'm sure it will be successful as well.
Edit: Confirmed working on Safari Desktop as well. Nice work!
That's great news! Thanks for checking both of those.
FYI, I'm on a MBP that's 10+ years old and running an outdated OS, which can no longer be updated. While the game now loads fine, there seem to be some minor control/keyboard issues that take some browser refreshes to get working.
Can you elaborate on what you mean by control/keyboard issues? Is it to do with the movement of ego and the direction keys? I did make another change yesterday that should have improved the responsiveness of the arrow keys. Could that be it?
-
After testing again it does seem like that might be the problem. I'm having arrow key (physical and virtual) and joystick issues on Safari 16.6.1. They don't move the character, but typing works fine.
On Safari for iOS (v17.4) the joystick and virtual keyboard arrow keys still work perfectly though.
-
After testing again it does seem like that might be the problem. I'm having arrow key (physical and virtual) and joystick issues on Safari 16.6.1. They don't move the character, but typing works fine.
On Safari for iOS (v17.4) the joystick and virtual keyboard arrow keys still work perfectly though.
Hmmm, that's strange. You are describing the opposite of what I expected to happen. Was it behaving like that in Safari 16 from the beginning? Or was it only since about a day ago? - It wouldn't surprise me if it was like prior to yesterday, but I was expected it to be fixed now.
@Kawa raised the issue to me originally, that the direction keys were not working reliably in Firefox. I think it was a more general problem, but certainly very noticeable in Firefox. Chrome was generally reliable, but sometimes I also noticed that a direction key was ignored there as well.
The cause for this was that the current direction key state was being tested by the interpreter, i.e. "is it currently down, and has it just been clicked", rather than having the direction/arrow key presses also go via the keypress queue. It gives an opportunity for an arrow key to be pressed quickly, where the down and up happens fast enough that the interpreter doesn't see it. Chrome seemed to be able to pick up on them but not so much Firefox. Perhaps Safari had a similar issue. - One thing that I see happen in Firefox fairly regularly are small pauses in the animation, which probably contributed to the loss of arrow key detection, but now that they're going via the keypress key, it should be working (I need to investigate the small "hanging" moments in Firefox as a separate issue).
Yesterday I made a change to address this. It now sends the arrow key presses via the same key press queue that the other key presses go via. It appeared to fix the issue in Firefox for me, but if other people are seeing issues, then maybe I haven't covered all the bases with regards to the key codes. It looks like I have though. Both the arrow keys and the numeric key pad equivalents are working for me.
Has anyone else noticed issues with the direction keys over the past day?
-
I don't think the keyboard issues with Safari 16 have changed in the last few days as far as I can tell. It's strange because if I open the java console to check for errors the joystick and arrow keys magically start working - I noticed similar behavior last week as well so it feels consistent.
-
I don't think the keyboard issues with Safari 16 have changed in the last few days as far as I can tell.
It's strange because if I open the java console to check for errors the joystick and arrow keys magically start working - I noticed similar behavior last week as well so it feels consistent.
Is it that the direction keys don't work at all in Safari 16, i.e. not possible to move ego at all, unless you open the javascript console?
If so, that is a bit strange.
I assume that other animation is working fine? e.g. waves breaking at the start of King's Quest 2? Crocodiles moving at the start of King's Quest 1?
The keypress events are sent from the UI thread to the web worker thread via a SharedArrayBuffer. I wonder if the problem is that the web worker isn't seeing the state of that SharedArrayBuffer changing (some sort of delay in earlier Safari versions in making it visible to the other side), or whether it is seeing it but the animation isn't updating. I suspect that if the animation wasn't updating that you would see more obvious indications of that.
-
(I need to investigate the small "hanging" moments in Firefox as a separate issue).
I have a theory about what is causing this. The UI thread posts a message to the web worker telling it to perform a "Tick", and then the web worker sends another message back saying that the tick is complete. If the browser slows down momentarily in processing the messages on each side then it would result in short hanging moments. Ticks need to be processed in quite quick succession, so the current approach relies a lot on these posted messages being picked up immediately. I'm having a rethink about how to keep the animation smooth whilst still keeping the two sides in sync. I tried something last night that should have worked but struggling to get the browser to recognise the API I'm trying to use. It is theoretically possible to get the web worker called for every browser animation frame, even though web workers don't have direct access to the UI. The libgdx framework uses that within the UI thread to do its rendering. So maybe I can get the web worker to get pinged by the browser directly at the same rate as the UI thread and use the AGI interpreter's master tick counter to play catch up if required, so they're kept in sync. I need to do something like this as I'm not happy with how the animation hangs for short durations in Firefox, leading to jerky animation.
-
Is it that the direction keys don't work at all in Safari 16, i.e. not possible to move ego at all, unless you open the javascript console?
If so, that is a bit strange.
I assume that other animation is working fine? e.g. waves breaking at the start of King's Quest 2? Crocodiles moving at the start of King's Quest 1?
The keypress events are sent from the UI thread to the web worker thread via a SharedArrayBuffer. I wonder if the problem is that the web worker isn't seeing the state of that SharedArrayBuffer changing (some sort of delay in earlier Safari versions in making it visible to the other side), or whether it is seeing it but the animation isn't updating. I suspect that if the animation wasn't updating that you would see more obvious indications of that.
It's super inconsistent with Safari 16. Often the sound doesn't work until refreshing, other times no key presses work and I can't make it past the title screen (until opening the developer java console). Reloading will sometime make sounds and letter key presses work, but then movement doesn't register. Non-movement animations always seem fine and it always loads and imports games now. Opening the Java console seems to magically make things work, but a regular user will never do that.
Everything seems to work great in Safari 17, so I wouldn't focus too much on older versions. Even on my outdated Mac OS the other browsers seem to work just fine. Safari is kind of terrible for compatibility in general, so I wouldn't spend too much time trying to fix for Safari 16. Considering how few Safari users there will be in general and that planned obsolescence seems to be the Apple strategy, I feel like the fixes you've implemented with importing games have addressed the Safari bugs. Time would be better spent on bugs manifesting in real browsers than anomalies specific to Safari <= v16. Still happy to test as requested, of course.
-
It's super inconsistent with Safari 16. Often the sound doesn't work until refreshing, other times no key presses work and I can't make it past the title screen (until opening the developer java console). Reloading will sometime make sounds and letter key presses work, but then movement doesn't register. Non-movement animations always seem fine and it always loads and imports games now. Opening the Java console seems to magically make things work, but a regular user will never do that.
Everything seems to work great in Safari 17, so I wouldn't focus too much on older versions. Even on my outdated Mac OS the other browsers seem to work just fine. Safari is kind of terrible for compatibility in general, so I wouldn't spend too much time trying to fix for Safari 16. Considering how few Safari users there will be in general and that planned obsolescence seems to be the Apple strategy, I feel like the fixes you've implemented with importing games have addressed the Safari bugs. Time would be better spent on bugs manifesting in real browsers than anomalies specific to Safari <= v16. Still happy to test as requested, of course.
Thanks for the description of the Safari 16 behaviour. Given how inconsistent it is, where it sometimes works and sometimes doesn't, I'm inclined to agree with you that there isn't much that can be done and that Safari 17 should be the recommended starting point. Some of the APIs I'm using are quite new ones, so perhaps the Safari 16 implementations of those APIs are not the best.
-
I have a theory about what is causing this. The UI thread posts a message to the web worker telling it to perform a "Tick", and then the web worker sends another message back saying that the tick is complete. If the browser slows down momentarily in processing the messages on each side then it would result in short hanging moments. Ticks need to be processed in quite quick succession, so the current approach relies a lot on these posted messages being picked up immediately. I'm having a rethink about how to keep the animation smooth whilst still keeping the two sides in sync. I tried something last night that should have worked but struggling to get the browser to recognise the API I'm trying to use. It is theoretically possible to get the web worker called for every browser animation frame, even though web workers don't have direct access to the UI. The libgdx framework uses that within the UI thread to do its rendering. So maybe I can get the web worker to get pinged by the browser directly at the same rate as the UI thread and use the AGI interpreter's master tick counter to play catch up if required, so they're kept in sync. I need to do something like this as I'm not happy with how the animation hangs for short durations in Firefox, leading to jerky animation.
Apologies, I may have made things worse in some places in an attempt to fix the above issue. The brief pauses in animation are no longer happening in Firefox, but I've noticed some weird flashing of text windows in some scenarios (e.g. KQ4 intro) that weren't happening before. I'll investigate this later on.
-
Thanks for the description of the Safari 16 behaviour. Given how inconsistent it is, where it sometimes works and sometimes doesn't, I'm inclined to agree with you that there isn't much that can be done and that Safari 17 should be the recommended starting point. Some of the APIs I'm using are quite new ones, so perhaps the Safari 16 implementations of those APIs are not the best.
Apple is good at selling $75 cables and scraping 30% off the top of in-app purchases. They never really mastered the whole browser thing. You'd probably have better luck supporting text browsers like Links/Lynx.
-
WebKit descends from KHTML. A teaching assistant I had at university worked on KHTML.
-
WebKit descends from KHTML. A teaching assistant I had at university worked on KHTML.
So did I! This was my second programming language/engine project after AGI studio; I worked on KJS, the JavaScript engine, and parts of the DOM APIs.
By far the most difficult aspect of it was the extent to which web pages and scripts did not comply with the standards. If you think fixing compatibility issues among different AGI or SCI games is tricky, try supporting the entire web. And at that time web developers would just target Netscape/IE (increasingly the latter), because that was "the standard".
Like the time I spent on AGI, I was also told that the KHTML/KJS projects were a waste of time and what was the point, IE is the standard and you should just accept the status quo. I've long-since learned to ignore people who say things like that. Both were extremely educational experiences that lead me on to even better things. At the time I had no idea it would be adopted by Apple, but that wasn't relevant; I just work on things that are fun and/or potentially useful.
-
Apologies, I may have made things worse in some places in an attempt to fix the above issue. The brief pauses in animation are no longer happening in Firefox, but I've noticed some weird flashing of text windows in some scenarios (e.g. KQ4 intro) that weren't happening before. I'll investigate this later on.
I have improved things a bit by using an approach that is partway between what I was originally using, and the approach I changed it to a few days ago. The flashing text window in the KQ4 intro is no longer happening in Chrome and Edge, but does still happen in Firefox, unfortunately. That made me a little suspicious, so I went back to test with Firefox using the original code. The flashing text window happens in Firefox with that code as well, so the new approach hadn't introduced that issue, at least in the case of Firefox. So I'm going to keep the new hybrid approach, since it fixes the short pauses that Firefox was experiencing, which was the main reason for the change, and as far as I can tell, the other browsers still look fine. I'll treat the Firefox flashing window issue in KQ4 as a pre-existing separate issue to deal with, although it may be quite a hard one to address.
-
Thanks for the description of the Safari 16 behaviour. Given how inconsistent it is, where it sometimes works and sometimes doesn't, I'm inclined to agree with you that there isn't much that can be done and that Safari 17 should be the recommended starting point. Some of the APIs I'm using are quite new ones, so perhaps the Safari 16 implementations of those APIs are not the best.
Apple is good at selling $75 cables and scraping 30% off the top of in-app purchases. They never really mastered the whole browser thing. You'd probably have better luck supporting text browsers like Links/Lynx.
Out of curiosity, is it working any better in Safari 16 at the moment? (now that I've got rid of the postMessage mechanism for syncing the UI thread and web worker; it is using an entry in a SharedArrayBuffer now. It wouldn't surprise me actually if it is now running worse on Safari 16 given this change, but I think I needed to address the animation pauses within Firefox as a priority over Safari 16. Still, it would be interesting to know if it had any impact on Safari 16 either way, for the better or worse.
-
Like the time I spent on AGI, I was also told that the KHTML/KJS projects were a waste of time and what was the point, IE is the standard and you should just accept the status quo. I've long-since learned to ignore people who say things like that. Both were extremely educational experiences that lead me on to even better things. At the time I had no idea it would be adopted by Apple, but that wasn't relevant; I just work on things that are fun and/or potentially useful.
Back when you released AGI Studio, it was roughly when I was starting full time work in IT. I'd just graduated from University. I remember that the web browsers around at that time were Netscape 2/3 and IE 3/4. I didn't look that up, so my memory might be a bit vague, but those versions seem to ring a bell. In those days, IE had the Java VM built into the web browser itself, rather than being a plugin. And I remember that Microsoft's implementation of the Java VM wasn't 100% accurate compared to Sun's. Well, Java applets haven't been a thing in web browsers for a long time now, so fortunately we don't have to worry about differences in that area anymore. And Javascript seems mostly quite consistent across the browsers these days. I have very little experience with Safari though, as is evidenced by the discussion in this thread.
@pmkelly, what are your thoughts regarding the web version of AGILE? Have you had a chance to try it out yet?
-
Out of curiosity, is it working any better in Safari 16 at the moment? (now that I've got rid of the postMessage mechanism for syncing the UI thread and web worker; it is using an entry in a SharedArrayBuffer now. It wouldn't surprise me actually if it is now running worse on Safari 16 given this change, but I think I needed to address the animation pauses within Firefox as a priority over Safari 16. Still, it would be interesting to know if it had any impact on Safari 16 either way, for the better or worse.
Safari 16 seems the same, by which I mean very inconsistent. Still no noticeable issues in Safari 17!
Edit: quoted wrong post
-
@pmkelly, what are your thoughts regarding the web version of AGILE? Have you had a chance to try it out yet?
Could you DM me the password?
-
Could you DM me the password?
In theory, I already have, on the 4th April. I will resend it again now. Let me know if you receive it.
-
Could you DM me the password?
In theory, I already have, on the 4th April. I will resend it again now. Let me know if you receive it.
My mistake - I wasn't paying attention and missed your earlier DM when you sent me the password, sorry about that.
I've spent a little bit of time having a look at it and first of all I have to say it's impressive seeing this running on the web! I like the ability to upload files as a way to avoid legal problems, as well as the fact you have a large collection of fan-made games. Perhaps you can work something out with Microsoft who now own the licenses regarding allowing the full versions online, similar to what sarien.net did.
I tried it both on mac (firefox & chrome) and on iPad. On the former, with both firefox and chrome, I noticed that the behaviour of the keyboard appearance is a bit weird. When the window is narrow, the keyboard appears below the picture; when it is wide enough the keyboard is not visible at all. But between these widths it appears overlaid on top of the picture, which for desktop doesn't seem to make sense - I think better to avoid the keyboard overlay altogether for the desktop. See:
https://www.pmkelly.net/temp/keyboard-narrow.png
https://www.pmkelly.net/temp/keyboard-medium.png
https://www.pmkelly.net/temp/keyboard-wide.png
On iPad (with Safari), I found that the keyboard didn't work very well at all when trying to navigate the menus and type in commands. I made a short video of me trying to play KQ4 which should make the problems clear:
https://www.pmkelly.net/temp/kq4ipad1.mov
This is as far as I've looked into it so far; I will do some more testing later on and give you some more feedback.
-
Perhaps you can work something out with Microsoft who now own the licenses regarding allowing the full versions online, similar to what sarien.net did.
But not Larry nor DDPG.
-
I've spent a little bit of time having a look at it and first of all I have to say it's impressive seeing this running on the web! I like the ability to upload files as a way to avoid legal problems, as well as the fact you have a large collection of fan-made games. Perhaps you can work something out with Microsoft who now own the licenses regarding allowing the full versions online, similar to what sarien.net did.
Thanks for giving it a try Peter. I really appreciate the feedback.
Yeah, I was thinking along the same lines regarding Microsoft. I was intending to contact the author of sarien.net to see if he has a contact I could use for that purpose. I guess that this scenario is a little different from the sarien.net one though. In that case, it is a conversion of the game into a different form, whereas I would actually need to host the original game files free of charge. They might be less open to that scenario, particularly given that exactly the same set of files are still being sold online, on sites like gog.com. Having said that, they're all on archive.org, although not sure what Microsoft thinks about that.
I tried it both on mac (firefox & chrome) and on iPad. On the former, with both firefox and chrome, I noticed that the behaviour of the keyboard appearance is a bit weird. When the window is narrow, the keyboard appears below the picture; when it is wide enough the keyboard is not visible at all. But between these widths it appears overlaid on top of the picture, which for desktop doesn't seem to make sense - I think better to avoid the keyboard overlay altogether for the desktop. See:
https://www.pmkelly.net/temp/keyboard-narrow.png
https://www.pmkelly.net/temp/keyboard-medium.png
https://www.pmkelly.net/temp/keyboard-wide.png
Yeah, that is due to it reacting to orientation and resize changes, and is currently deliberate, but is primarily to support mobile devices, where you can't usually alter screen size other than to rotate between portrait and landscape. It deliberately makes the virtual keyboard always available for portrait, assuming there would be space, but hidden for landscape, with an icon added to make the keyboard appear. That felt like the best approach to me when I was testing on my mobile. I felt like having the keyboard icon in portrait on a mobile device was wasting space. That grey area between the two, where the width to height ratio is not one of these cleaner cases, is a bit difficult to decide what to do. For example, at what point is it considered portrait vs landscape? This is where you get the virtual keyboard being shown on top of the screen but with no way to hide it.
I did have a debate with myself a few weeks back about whether to retain the virtual keyboard for the desktop web version, to avoid the kind of cases you've shown. In most cases, I assume people on desktop would have a more standard landscape width to height ratio, but if the window size is adjusted, then it does lead to those kinds of scenarios. Attempting to detect whether it is running on a desktop browser vs mobile browser isn't straight forward though. There are some old ways of doing it that are not recommended anymore. I guess I could go with one of those, but web developers are being strongly encouraged to test for features these days rather than platforms, browsers, device, etc., with the old ways of testing platform/device being on the cards to be deprecated by browsers. I saw a discussion online about using the presence of a touch device as one way, but that doesn't work for my Microsoft Surface tablet, in that I'd prefer that to be seen as a desktop rather than mobile, but due to it having a touch screen, it would be classed as mobile. I think there are many desktop type devices with touch screens these days, so it probably isn't the way to go if the question being asked is whether it is desktop or not. I wondered about trying to detect the presence of a physical keyboard but apparently browsers are deliberately making that kind of thing difficult to detect.
Hmmm, maybe I can just go with the old way of detecting platform, even though it is not recommended anymore, which can at least tell whether it is Windows or Mac, vs something else. I think Linux is difficult, as some mobile devices might report that they're Linux. Devices that report themselves as Android, iPad or iPhone can probably be relied on as well though. So there might be a small group of less common devices in the middle that it wouldn't be 100% accurate for. That is probably fine.
Or I could simply provide the virtual keyboard for all touch devices, regardless of whether they are desktop or not. I certainly wouldn't mind having it on my Windows tablet. I'll have a think about it. I agree that it needs some kind of change, to avoid the kind of thing that you're seeing. So the decision will be between using platform/useragent vs. presence of a touch screen. I would be keen to know your thoughts on which of those two approaches sounds the best. I guess I could also use a hybrid approach between the two.
On iPad (with Safari), I found that the keyboard didn't work very well at all when trying to navigate the menus and type in commands. I made a short video of me trying to play KQ4 which should make the problems clear:
https://www.pmkelly.net/temp/kq4ipad1.mov
This is as far as I've looked into it so far; I will do some more testing later on and give you some more feedback.
Thanks for that. Looking forward to the additional feedback. - Yeah, that is definitely weird alright. What version of Safari is that? @doomlazer reported issues on Safari 16 but what you're showing looks like something different. @doomlazer, is this what you see on Safari 16? Do you see anything like that on Safari 17?
I'll have a think now about what might be causing this.
@pmkelly, does it all work fine on your iPad when using Chrome?
-
Perhaps you can work something out with Microsoft who now own the licenses regarding allowing the full versions online, similar to what sarien.net did.
But not Larry nor DDPG.
Nor Gold Rush!, right? I think the MacNeill brothers own that now.
Actually, this is a good follow up question: For the 14 AGI games, who currently owns each of them? Am I correct in assuming that Microsoft own: KQ1-4, SQ1-2, PQ, MUMG, and MH1-2 ?
What is the situation with BC?
-
Thanks for that. Looking forward to the additional feedback. - Yeah, that is definitely weird alright. What version of Safari is that? @doomlazer reported issues on Safari 16 but what you're showing looks like something different. @doomlazer, is this what you see on Safari 16? Do you see anything like that on Safari 17?
It seems like the problem in the video isn't specific to Safari. I think it's that when the keyboard is overlaid on the game screen the clicks/touches are registering on first the game screen, then the virtual keyboard and both actions are happening. I get this in both Safari and a Chromium browser, so I assume it's happening for all devices/browsers.
In the fan game I tested, Bob the Farmboy, clicks to the game screen will "execute" any text on the input line, so if you type LOOK while the virtual keyboard is covering the game screen you get:
L - nothing on input line, click/touch registered by game screen does nothing; click registered by VK types L.
O - click on game screen executes the input line text "L", generating a message and clearing input line; click registered by VK adds O to input line.
O - click on game screen dismissed "unknown word" message; click registered by VK adds 2nd O to input line.
K - click on game screen executes input line text "OO" generating a message and clearing input line; click registered by VK adds K to input line.
That's the long way of saying you probably just need to ignore clicks to the game screen where it is overlaid by virtual keys.
-
Oh... this might be a side effect of a feature I added a couple of weeks ago that I thought was a nice addition. In summary, it sends an ENTER key if the screen is clicked, the idea being that clicking the screen can be used to close text windows. Seems I didn't think it through enough, so will go back to the drawing board on that one, maybe even remove it if I can't get it to work cleanly. But yes, maybe it will be as simple as not calling the handler for game screen clicks when it also is on the virtual keyboard. Will think through whether there are any other gotchas with sending through an ENTER like that. Maybe it needs to be ignored if the menu is open as well.
-
Oh... this might be a side effect of a feature I added a couple of weeks ago that I thought was a nice addition. In summary, it sends an ENTER key if the screen is clicked, the idea being that clicking the screen can be used to close text windows. Seems I didn't think it through enough, so will go back to the drawing board on that one, maybe even remove it if I can't get it to work cleanly. But yes, maybe it will be as simple as not calling the handler for game screen clicks when it also is on the virtual keyboard. Will think through whether there are any other gotchas with sending through an ENTER like that. Maybe it needs to be ignored if the menu is open as well.
I have removed this behaviour for now. If you both try again, then it should work a lot better when the keyboard is overlaying the screen.
I do like the idea of being able to click the game screen to close an AGI text window, but will need to think through a better approach. I can think of one way, but it would involve changing the code of the interpreter itself, which I try to avoid most of the time. Maybe I can still use something similar to what I was doing, but detect when a standard text window is open so that it only does it in that scenario.
(Only 15 days left until the KQ anniversary date...)
-
It works correctly for me in both browsers now, though I did have to reset the browser history to get the new changes; reloading wasn't enough.
-
Yeah, the MacNeill brothers have the Gold Rush! IP. I should have remembered that since when I did that package for Sunlight Games I had to have the MacNeill brothers approve everything I did for the final package.
As for BC, isn't that Disney? All of the Disney IPs is probably whole other kettle of fish. Don't know how zealous they will be of such ancient games being played online. Even if you get permission from MS, you may still have to have the same proof of ownership system you are using now for the Disney games.
Does Codemasters still have the Larry IP or did that German company that did the Wet Dreams games get it?
-
Regarding the keyboard: I was initially thinking that having the toggle button for showing/hiding the keyboard visible at all times would be a good approach, then the user can choose. Then I had another idea which I think would be even better for mobile - what about an SCI-style approach where the input window is visible only when you want to enter a command? For devices with a keyboard (desktop or ipad with bluetooth keyboard) this would be triggered by pressing any letter (which would appear as the first character of the command). The user can also click/touch the input line (still visible, or with a "click to type" text or similar) to bring up the text input window.
If you use the browser's native text input mechanism (by temporarily creating a form on the page with a text input field), this would then allow the user to use the keyboard built-in to the OS, which may be easier to use than the custom one in AGILE. I'm not sure how difficult this is given the way the web-based version of the engine works though.
Will get back to you later on the Safari version (wife is currently using the iPad).
-
Regarding the keyboard: I was initially thinking that having the toggle button for showing/hiding the keyboard visible at all times would be a good approach, then the user can choose.
Yeah, perhaps I should go down this route. I think it might be the best approach. Just need to work out where it would make sense to add the keyboard icon when in portrait mode, as it starts to look a bit cluttered with four icons at the bottom of the screen. I'll play around with putting it in different spots to see what feels best. I didn't feel like I could sacrifice any of the other three icons when in portrait mode. Full screen, joystick, and back icons all felt like they were needed. Some fan made games are not trivial to exit out of, which was why I added that Back icon. It made it really simple to get back to the game selection screen.
Then I had another idea which I think would be even better for mobile - what about an SCI-style approach where the input window is visible only when you want to enter a command? For devices with a keyboard (desktop or ipad with bluetooth keyboard) this would be triggered by pressing any letter (which would appear as the first character of the command). The user can also click/touch the input line (still visible, or with a "click to type" text or similar) to bring up the text input window.
There are some fan-made AGI interpreters that do something like that, i.e. a SCI-like text entry. I think that AGI Player has a mode like that (https://github.com/huguesv/AgiPlayer). And I did consider it for AGILE, but in the end I wanted to keep it as AGI-like as possible. If a game happens to have a hack that makes use of such text entry, then I'd make sure it supports that hack, but not so sure about applying it to all.
One thing I'm certain should be avoided is the way in which SCI pauses the game while the text input window is open. Part of the nature of AGI is how you can type a command while things are also happening on screen.
If you use the browser's native text input mechanism (by temporarily creating a form on the page with a text input field), this would then allow the user to use the keyboard built-in to the OS, which may be easier to use than the custom one in AGILE. I'm not sure how difficult this is given the way the web-based version of the engine works though.
I don't think it would work to use the browser's native text input. Well, it might work in most cases, but it would reduce the overall AGI compatibility. It would be possible to write a game, may even be a few out there already, for which this approach wouldn't be compatible with. The problem is that every key press should go through the AGI key event queue as it happens, even when typing a command. I believe there is a way to bring up the OS's built-in virtual keyboard programmatically from a web app, but there was a reason why I dismissed that. Struggling to remember now what it was, but I didn't feel like it would be an option that would consistently work. After contemplating that for a few days, I decided to go with building my own virtual keyboard mechanism, so that it would be consistent for everyone. I could be certain that all possible keys and key combinations that could be understood by the AGI interpreter were covered off. That was probably the main reason now that I think about it. These modern virtual popup keyboards may not necessarily be able to cover off all possible key codes and key combinations that the AGI interpreter understood.
Will get back to you later on the Safari version (wife is currently using the iPad).
Thanks again. Looking forward to hearing back on that.
-
One thing I'm certain should be avoided is the way in which SCI pauses the game while the text input window is open. Part of the nature of AGI is how you can type a command while things are also happening on screen.
I agree that typing without pausing sure gives me the AGI feels while playing, but it's important to note that the original interpreter did pause (at least some versions of it). My recollection is specifically the dos herc.mono version. No clue why it did that... I always assumed it was because of some limitation of the hardware.
For what it's worth, ScummVM has also implemented this feature across all graphic modes as an optional toggle... not that ScummVM should be your model of reference.
-
I agree that typing without pausing sure gives me the AGI feels while playing, but it's important to note that the original interpreter did pause (at least some versions of it). My recollection is specifically the dos herc.mono version. No clue why it did that... I always assumed it was because of some limitation of the hardware.
Yeah, you're right. I keep forgetting that, probably because it wasn't part of the experience I had when originally playing these games back in the late 80s. Our first PC already had EGA. I don't think I ever tried the games on a monochrome set up.
I was just looking at Sierra's original AGI interpreter source code. The HDIALOG.C file has the code for mono text entry. It shows that it uses the standard AGI text window for that mode, clears most of the bottom line within that window, and then accepts text input within that space. It exits when ENTER is hit. It looks like it might also show the text "ENTER COMMAND" within that window, although I can't spot where it actually displays that in the code. An AGI fan made game could easily replicate all of that in LOGIC code.
The original AGI interpreter source fragments we have from the original SQ2 and KQ3 disks doesn't include the bit that triggers the opening of this window though. I'll have to start up dosbox to see when that happens, e.g. is it on every key stroke? Or is there a key combination that opens the window? This is more out of curiosity, as I don't think I would add an option for a mode like this. Perhaps later down the track. At launch, it is unlikely to have any optional settings.
Edit: I just tried it in dosbox. Looks like it shows the text entry dialog on any keystroke that would normally be expected to be used for command entry. Obviously it doesn't do it for direction keys, function keys, and other special keys.
-
Regarding the keyboard: I was initially thinking that having the toggle button for showing/hiding the keyboard visible at all times would be a good approach, then the user can choose.
Yeah, perhaps I should go down this route. I think it might be the best approach. Just need to work out where it would make sense to add the keyboard icon when in portrait mode, as it starts to look a bit cluttered with four icons at the bottom of the screen. I'll play around with putting it in different spots to see what feels best. I didn't feel like I could sacrifice any of the other three icons when in portrait mode.
I have released a change that has added the keyboard icon for portrait mode. I just shifted the icons to give space, so that the four are evenly spaced. It doesn't look too bad actually. Not sure what I was worried about.
So this addresses the concern about not being able to hide the virtual keyboard when in "portrait" mode. I'm going to think more about whether to show it by default in portrait mode, which is what it currently does. I think it makes sense when the keyboard wouldn't overlap the screen, such as when on a mobile phone, but isn't great for these non-standard sizes where it does overlap.
-
I tried it both on mac (firefox & chrome) and on iPad. On the former, with both firefox and chrome, I noticed that the behaviour of the keyboard appearance is a bit weird. When the window is narrow, the keyboard appears below the picture; when it is wide enough the keyboard is not visible at all. But between these widths it appears overlaid on top of the picture, which for desktop doesn't seem to make sense - I think better to avoid the keyboard overlay altogether for the desktop.
I released several changes over the past couple of days to hopefully address all of these issues.
It should look and behave much better on iPad now. I have added a new placement for the keyboard and icons for those in-between screen sizes that are kind of a portrait/landscape hybrid. There are now three different UI layouts. One is when it is clearly landscape in nature, in which case the icons will be on the side of the game screen. The second is when it is clearly portrait, in which case the icons appear at the bottom, larger in size, and evenly spaced across the bottom. For this one, the virtual keyboard automatically shows when the height to width ratio gets to a certain point, which should mean that it automatically shows in portrait mode on most phones. For portrait sizes that are a little "shorter", it dynamically scales the height of the keyboard to avoid overlapping the screen. - The third UI layout is for these in-between sizes where it isn't strongly elongated in the width or height direction. For those, it shows the icons at the bottom of the screen, but not spanning the full width, so that the virtual joystick has space also in the bottom right corner, and the keyboard likewise doesn't span the whole width but instead is more like the fully landscape mode.
Not sure if I described that well enough, but have a play around to see what I mean.
Assuming no major bugs are discovered with this over the next week, then this is the version that will be launching next Friday, exactly a week from now.
-
Continuing on from the previous post, yes, it is exactly 1 week until the 40 year anniversary of the release of King's Quest. As mentioned above, I have made a few changes over the past few days. One of those involved fixing a saved game bug where it was failing to overwrite previously saved game slots, which was a big problem actually. Luckily I had been trying to play through King's Quest 4 and was wondering why my game wasn't saving after I'd using up all the slots. Problem solved now though. It was appending to the existing file rather than overwriting it! ;D
If people get a chance, can I ask you to have another play to see if you can spot any major issues.
@doomlazer, I do plan to add some features to export the whole state, but I didn't want to put the 10th May launch into jeopardy, so I'm planning for that feature to be a quick follow later in the month.
-
Continuing on from the previous post, yes, it is exactly 1 week until the 40 year anniversary of the release of King's Quest. As mentioned above, I have made a few changes over the past few days. One of those involved fixing a saved game bug where it was failing to overwrite previously saved game slots, which was a big problem actually. Luckily I had been trying to play through King's Quest 4 and was wondering why my game wasn't saving after I'd using up all the slots. Problem solved now though. It was appending to the existing file rather than overwriting it! ;D
If people get a chance, can I ask you to have another play to see if you can spot any major issues.
@doomlazer, I do plan to add some features to export the whole state, but I didn't want to put the 10th May launch into jeopardy, so I'm planning for that feature to be a quick follow later in the month.
Upload game seems to work :) I'll be testing like a crazy person in the next few days :)
-
Only 3 days left! (including today). I'd be keen to know people's suggestions on how best to go about promoting the release on Friday. What sites do you recommend I mention it on? To be honest, I haven't really promoted one of my own projects much before.
-
I'll announce on the Sierra Facebook groups.
-
I recommend contacting the Space Quest Historian (https://spacequesthistorian.com/). You might even be able to convince him to make a youtube video about it, or perhaps a livestream.
-
Also
https://www.reddit.com/r/Sierra/
https://www.reddit.com/r/adventuregames/
https://news.ycombinator.com/
-
Thanks both for the suggestions. I'm very tempted to remove the password form already, as I don't think there is a danger anymore in news getting out before I want it to. I thought it would be good to have at least a day beforehand with the password taken off, in case there are any issues with that.
-
Just let me know when you want me to annouce on the Sierra groups.
-
@Collector, I am happy for you to promote it on the Sierra groups as soon as it is the 10th May in your time zone, so either if you're still up at midnight, or whenever you get a free moment Friday morning.
The status is that the password has already been removed, so anyone can get to it now. I have already let someone know who maintains a weekly gamedev.js newsletter, as I thought that this would certainly be of interest to the subscribers, and that there is an issue going out tomorrow. The maintainer was able to access it and was impressed, so that is a good sign.
Regarding Let Them Eat Cake, @russdanner has now finished the conversion and has given me a ZIP that I have added to the site. I put a change in there that will force it to appear for anyone that has previously accessed the site, so all of you should be able to see it in the list of games. This is a direct link for those who want to try out the converted, fully AGI compatible build of Let Them Eat Cake:
https://agi.sierra.games/#/id/ltec
I haven't yet tried playing through it, but I plan to give it a go this evening as a final test of AGILE. It may have been a little risky to add that small change to force the inclusion of LTEC, but I wanted to make sure it was definitely going to appear.
My plan from midnight my time zone is to publish the following:
* A new blog post on my lanceewing.github.io website.
* A blog post on the Medium website (virtually identical to the one on my own github pages site).
* A post on reddit.
* A post on Hacker News.
Everyone else can feel free to share it as much and wherever they like.
-
My plan from midnight my time zone is to publish the following:
Maybe midnight my time is too early. I'm in the UK, so that is just under an hour away. Most of the US is still in the afternoon of the 9th at the moment. I guess I could wait until 6am UK time.
Whatever I decide, I'll post here after I've published the blog posts.
-
I'll announce on the Sierra Facebook groups.
@Collector, feel free to announce it in the Sierra Facebook groups any time from now.
The Medium post is published:
https://medium.com/@lance.ewing/agile-celebrating-40-years-of-kings-quest-81ff3ab89a7e
...as is the post on my own GitHub pages site:
https://lanceewing.github.io/blog/sierra/agi/agile/kq1/2024/05/10/agile-celebrating-40-years-of-kings-quest.html
I have also posted on Hacker News. I am about to post on reddit.
Edit:
I tried posting on reddit, but it is saying that the post was removed by the moderators. Not sure if that means that it is waiting for a moderator to approve, or whether it has actually been removed. I guess I'll wait a bit to find out. Maybe it is because its my first post.
Edit 2:
It looks like it was the automatic spam detection used for r/Sierra. I may have been a little too enthusiastic in my promotion. It worked fine for r/kingsquest though.
-
Congratulations Lance! You've put together an amazing app. For all of us old timers, it sure does bring us back to 'the glory days' of PC gaming. And for the younger generations, hopefully it introduces them to the history that needed to happen to get us where we are today.
Well done.
-
I think r/Sierra doesn't allow this kind of content. In my limited experience, it gets removed immediately.
-
Grats on the release. I've had a lot of fun checking out fan games because of this. #happy40th
-
Thanks all. Yeah, its been fun making it as well. Hopefully the site will live for years to come and people will use it as an easy way to play the games. The traffic to the site seems to have been steadily increasing through the day, so maybe the word has been getting around. Thanks to those who have been helping to spread the word.
-
I think r/Sierra doesn't allow this kind of content. In my limited experience, it gets removed immediately.
I can see that you managed to get a post through the spam bot detection on r/Sierra. Thanks for that! :)
-
It has been announced in the main Facebook Sierra groups this morning. There may have been a couple I missed, but the main Sierra Facebook community & Sierra alums should be aware.
-
I'm doing what I can to keep it on top for a bit. The birthday is only relevant for so long, but as long as new YouTube videos come out, etc., in my estimation, it's okay to continue to bring the subject back up without being "spammy."
-
I have noticed a definite increase in views over the past 24 hours, in fact it has been the best day so far. It looks like a lot of that is from facebook, so thank you both. I have also been promoting it in more technical places, such as the libgdx reddit, as AGILE uses libgdx, and the gamedev.js newsletter. I'm going to think of a few more like that. Maybe things like webdev and javascript on reddit, but focus more on the tech used, e.g. certain browser APIs, as a way to introduce and link to the app. - Someone in the libgdx reddit was happy to have been able to play Tetris on their phone. Not sure which of the two Tetris games that was.
Yeah, I agree that bringing the subject back up under comments, etc. in relation to something related but new is avoiding being spammy. Thanks for the efforts.
The github stars have increased from 5 to 9 since the launch, so a few people have been looking at the github page as well.
-
Regarding promoting AGILE online, I had an idea about a week ago to put the original AGI interpreter source code out there and spread the story of its discovery in a blog post. As far as I know, it isn't commonly known of outside of our community. I think we're the only ones that talk about it, and, also as far as I know, I don't think anyone had noticed it prior to NewRisingSun mentioning it here about 8 years ago.
Anyway, I was thinking of ways that I could promote AGILE and thinking about how its implementation was always cross referenced again the original AGI interpreter source to help make sure it was as accurate as possible. I started thinking that the story about how roughly 70% of the AGI interpreter source code ended up being copied onto tens/hundreds of thousands of customer copies of SQ2 would be something that people might be a lot more interested in and perhaps I could use that as a way to link to AGILE as well.
It seems to be working. I published the blog post this morning, along with a github repo containing the source. It has both the 70% of the code from the SQ2 and another 5% or so from the KQ3 disk that I mentioned in a forum post on here a while back. So there's roughly 75% of the AGI interpreter source in there.
https://lanceewing.github.io/blog/sierra/agi/sq2/2024/05/22/do-you-own-this-space-quest-2-disk.html
https://github.com/lanceewing/agi
I mentioned it on Hacker News not long after publishing the blog post and repo. I'm checking now after work and the new "agi" repo has 10 stars already and the agile-gdx repo has also been increasing today, now at 14 stars. I haven't yet mentioned it anywhere else. Well that's not quite true. I tried to mention it on r/Sierra on reddit but my post was blocked again. I'll have a think about where else to mention it. Feel free to mention it wherever you like.
-
I posted it in several pf the Sierra Facebook groups. A number of the old Sierra devs will see it.
-
I tried to mention it on r/Sierra on reddit but my post was blocked again.
I think r/Sierra auto removes posts if your karma is below some arbitrary threshold. Just message the mods and they will likely restore the post. Seems like a dumb system, but what do I know?
-
If you're quick, you'll see that it is at the top slot on Hacker News at the moment.
https://news.ycombinator.com/
Edit: I'd encourage some of you to join in on the discussions going on. Really interesting.
-
Very interesting writeup of how the code was leaked! Was the complete AGI code never leaked? Why are there by contrast so many complete leaked versions of the SCI interpreter?
-
I don't think the complete AGI code was ever leaked as such. The documentation was, the editors were, the source for a few games, but not the interpreter code, as far as I know.
I have noticed that a few people have started mentioning it on various reddit communities now, including r/Sierra.
The stars for the agi repo just went above 40, and agile-gdx is at 22 at the moment.
A lot of traffic to agi.sierra.games, the most so far, seems to have come from a French website that mentioned it.
-
just saw the post in HackerNews...
Amazing work!
-
hey, @vafada, good to see you on here again.
Are you referring to the original AGI interpreter source code on the SQ2 disk? Or the web version of AGILE? I assume the former. I can't take credit for the discovery on the SQ2 disk. That was NewRisingSun, as far as I know. There is a thread on here back in October 2016 where he mentions it. Since then, I've extracted the same code from my own copy of Space Quest II. Since then, I have also discovered a further lot of original AGI interpreter source files on a KQ3 disk. The github repo contains both. There was only a small amount of overlap.
Have you given the web version of AGILE a try yet?
-
I have received a lot of reactions on Facebook. Much more so than for what I posted about Agile-gdx.
-
hey, @vafada, good to see you on here again.
Are you referring to the original AGI interpreter source code on the SQ2 disk? Or the web version of AGILE? I assume the former. I can't take credit for the discovery on the SQ2 disk. That was NewRisingSun, as far as I know. There is a thread on here back in October 2016 where he mentions it. Since then, I've extracted the same code from my own copy of Space Quest II. Since then, I have also discovered a further lot of original AGI interpreter source files on a KQ3 disk. The github repo contains both. There was only a small amount of overlap.
Have you given the web version of AGILE a try yet?
Both!!! I read the blog post that was linked on HN about the source code hidden on the disk due to quick format (FAT not really deleting data on the disk) and at the same time stumbled upon the web version of AGILE.... and also saw the blog post regarding the 40th anniversary of KQ1!!! I was surprised to see my name!!!! (shock-face)
I've been monitoring the agile-gdx on GitHub for a while now, was able to build it locally..... It's nice to see it live in production
I tried playing the two player game but couldn't figure out the control for the second player and gave up ;D
-
Both!!! I read the blog post that was linked on HN about the source code hidden on the disk due to quick format (FAT not really deleting data on the disk) and at the same time stumbled upon the web version of AGILE.... and also saw the blog post regarding the 40th anniversary of KQ1!!! I was surprised to see my name!!!! (shock-face)
It was your version of JAGI that I started out with. I could see that you'd extended it quite a bit.
I've been monitoring the agile-gdx on GitHub for a while now, was able to build it locally..... It's nice to see it live in production
I tried playing the two player game but couldn't figure out the control for the second player and gave up ;D
Hmmm, its a bit fiddly actually. You have to use the control key with A, D, Q, W, E, Z, X, C. The problem is that the web browser uses some of those for certain things and they can't be overridden. So, for example, Ctrl-W seems to close the tab!
Did you try importing one of the original Sierra games?
-
The stars for the agi repo just went above 40, and agile-gdx is at 22 at the moment.
The activity appears to be levelling out now, as far as the upvote rate is concerned:
https://news.social-protocols.org/stats?id=40455758
The agi repo is at 64 stars now, and the agile-gdx repo at 27 stars. I doubt they'll increase much more. It was definitely a worthwhile exercise. I think the agile-gdx stars were only around 5 prior to publishing that article.
-
I've pushed this little project with AGI.js, but I think I am starting to see it hit a limit due to the bugs in that engine. I am thinking of switching this over to the web version of AGIle.
Weekend programming and AI prompt engineering fun:
https://www.youtube.com/watch?v=Lhva7yfdLFc]YT
-
I've been trying to build and deploy the app. I have no issues running it on the real site via Chrome, but I am getting this error when it's deployed locally.
(building with gradle html:war)
html-0.js:8354 Uncaught ReferenceError: SharedArrayBuffer is not defined
at com_agifans_agile_gwt_GwtUserInput_GwtUserInput__V.com_agifans_agile_gwt_GwtUserInput_GwtUserInput__Lcom_google_gwt_core_client_JavaScriptObject_2Lcom_google_gwt_core_client_JavaScriptObject_2Lcom_google_gwt_core_client_JavaScriptObject_ .....
UPDATE:
If you are running in Tomcat 10+ you will either need a servlet filter or a web server/proxy to set the following headers:
Cross-Origin-Opener-Policy same-origin;
Cross-Origin-Embedder-Policy require-corp;
Build / deployment instructions would help the README. If I get it going, I'll send a PR.
-
UPDATE:
If you are running in Tomcat 10+ you will either need a servlet filter or a web server/proxy to set the following headers:
Cross-Origin-Opener-Policy same-origin;
Cross-Origin-Embedder-Policy require-corp;
Yes, that is correct. I've set up Cloudflare Pages to set those headers in the case of the agi.sierra.games website. The SharedArrayBuffer won't work without them.
Build / deployment instructions would help the README. If I get it going, I'll send a PR.
When I wrote the README for agile-gdx, I was focusing more on the users of the agi.sierra.games website itself rather than on building and installing it on a different site. I do need to add a section that covers the latter.
I'm currently working on a similar project for emulating an old 8-bit home computer from the 80s called the Oric (I'm not sure if it is known much in the USA but it was a thing in the UK and parts of Europe). I used exactly the same approach for this emulator (called JOric) as I did for AGILE, in fact I copied some of the code from AGILE to get it working on the web, so it uses the same approach to using SharedArrayBuffers to share data between the browser UI thread and the background web worker. In this case, I did add a section to the README that covered setting up those HTTP header fields:
https://github.com/lanceewing/joric?tab=readme-ov-file#running-on-your-own-local-web-server
I'm planning to add a section like that to the agile-gdx README as well, in fact I've added a lot of additional features to this JOric emulator that I think would be useful for agile-gdx, such as loading a game from a url via a request parameter, and drag and drop, and generally lots of usability improvements, particularly with the game selection pages. I do plan to copy those improvements back to agile-gdx at some point.
-
Lance, the level of detail and effort you (always) go to is truly impressive.
-
I'm planning to add a section like that to the agile-gdx README as well, in fact I've added a lot of additional features to this JOric emulator that I think would be useful for agile-gdx, such as loading a game from a url via a request parameter, and drag and drop, and generally lots of usability improvements, particularly with the game selection pages. I do plan to copy those improvements back to agile-gdx at some point.
Welp.. I'm in a fine mess now :) I've made enough progress to ensure I'll be wasting a lot more time screwing around with this project hahaha
https://www.loom.com/share/3982a4c9f2b146ccbb635abf774e5bca
-
Here's a little video update for anyone interested. Making progress.
I seem to be getting WebGL crashes so I'll have to look into that.
https://www.loom.com/share/900e28bb7af849d593c835621f8f0de1
-
Here's a little video update for anyone interested. Making progress.
I seem to be getting WebGL crashes so I'll have to look into that.
https://www.loom.com/share/900e28bb7af849d593c835621f8f0de1
The crashes were due to some UI components I added. Easy fix. Remove them :P
-
https://www.loom.com/share/900e28bb7af849d593c835621f8f0de1
This is looking really cool. Looking forward to seeing how it progresses.
-
Here's a quick progress update.
Unfortunately, Larry didn't do anything cool for us during the recording, but I didn't want to drag it out..
https://www.loom.com/share/9030c27084044269aafad6cf664466d9