I've just done decompilations of some of the AGI demos. When attempting to import DEMOPAC1 (Helicopter, PQ, Thexder, SQ2, Mother Goose, LSL), I get the following error: "Property or method not available until object is loaded".
Dang it! I thought I fixed all that... ugh!
That game has 8 invalid logics (81, and 101 through 107) that all have directory entries pointing to a non-existent VOL.3 file. For some reason, I commented out the code that checks for that error (which would continue loading the game, and then inform you of the invalid logics), so now the loader just craps out. I have no idea why I did that.
I uncommented out that code, and the game loads, just as it should.
And when attempting to import either the AGI3 demo pack (Gold Rush, Manhunter, Mother Goose, PQ, SQ2, LSL) or the KQ4 demo, it complains about invalid sound resources.
The AGI3 demo pack imports just fine for me. I don't get any errors. But the KQ4 demo has some MAJOR issues- the DIR file is not valid; it appears to be two DIR files mashed together (it's a version 3 game). The sound DIR section starts at 0x2D5. If there were 256 sounds in the game, then the file should end at 0x5D5. But the total file length is 0xA96! When you look at it in a hex editor, it's pretty obvious that there are four more directory 'chunks' at the end of that file.
WinAGI tries to load 256 sounds because there's too much data, and it's tripping on the first invalid sound (198). (Again, I thought I fixed that; it's supposed to note the error, and continue loading resources; it's fixed now.) As it turns out, because of the bad DIR file, there are actually 16 invalid sounds (198, 221, 222-236).
The game runs fine though, because Siera's interpreter never tries to access any of the bad data in the DIR file.
And if you examine the bad DIR file, you will see that sound198 has the same location (vol 0, offset 0x778) as picture1 (which is what's actually at that location). The rest of the invalid sound entries, as well as all the other invalid DIR entries added to the end of the file don't even point to the start of an actual resource. It appears the extra data are a fragment of a DIR file from some other game.
If you open this game in AGI Studio, you will see these errors as well. But because AGI Studio doesn't let you open/edit sounds, it doesn't tell you the sounds are bad unless you try to export them.
Fundamentally, AGI Studio acts more like the original interpreter - it mostly just ignores things that it can't handle or that don't conform to file/resource standards. When I made WinAGI, I tried to add as much error checking as I could, thinking it would be helpful to know when game files and resources didn't conform to standards, because I just assumed games with bad data wouldn't run in AGI. It's been a real bitch trying to make that work though, because there are just so many bad game files and bad resources that exist in original Sierra games, and their interpreter happily processes bad data, mostly by ignoring it.
I will get an update out that will be able to handle all these errors. The new approach will be similar to original interpreter, in that WinAGI will do everything it can to get a game loaded; invalid data will be ignored/skipped as much as possible, with only a warning provided that explains any bad data that are encountered.