Another year, another Quest for Glory game. A number of years ago, AGD Interactive released their excellent VGA fan remake of Quest for Glory II: Trial By Fire. While I have a fondness for both the official EGA and VGA versions of Quest for Glory I (originally titled Hero's Quest), I have not held the same level of nostalgia for the EGA version of QFG2 and have not gone back to replay this version since the AGDI version was released — it is just that good. However, there has been one major issue with me being able to replay the Mac version of QFG2 VGA — it hasn't worked on modern Macs for many years. I can fire up my 2007 MacBook Pro and run it under Mac OS X Snow Leopard, but I'd prefer to have a method where the game can run on more modern Macs, including those with the newer Apple Silicon processors.
AGDI used Adventure Game Studio to develop their four Sierra remakes, so this was encouraging to me that I might be able to make a modern Mac build of QFG2. Inspecting the original app bundle revealed that Wine was used to create the Mac port of the game. According to the Get Info panel of the original Mac version of QFG2, it was ported using Wineskin. The Version info mentions http://wineskin.doh123.com/, but that site is now defunct, but there is still an archive of the site for those who are curious. For more modern resources about using Wine, head over to https://www.winehq.org.
With a little more knowledge about how the Mac port was constructed, this gives additional details on why this old build won't launch on newer versions of macOS for several reasons:
- The Wineskin implementation is incompatbile with newer versions of macOS.
- The builds were made in the 2009-2011 time frame, so they would have been built as 32-bit apps, but starting with macOS 10.15 Catalina, all apps need to have a 64-bit build, which excluded a lot of older products.
- Even if this did happen to work, it is an Intel build, which would eventually fail once Apple stops supporting Intel (x86) binaries from running on macOS and requires Apple Silicon (arm64) builds.
Before I learned how to create Mac ports of AGS games, Wineskin might have been a viable option, but the newer porting method is a far better approach. It supports more modern Mac operating systems and hardware and creates much smaller app bundles.
One of the major problems with using Wine is that it includes a lot of extra files to emulate Windows support and really bloats the app size. I've converted games built with Adventure Game Studio that originally used Wineskin, and the size reduction was amazing. The original Mac version of Stair Quest started at a hefty 271MB, and after the conversion I trimmed the downloadable file down to a svelt 22MB. Once unzipped, the original 2.0.0 version was 597,224,964 bytes in size (606.9MB) whereas my version was 57MB (57,576,094 bytes) in size.). That alone reduced it down to less than a tenth of the original app size. As another experiment, I also did an update for AGDI's King's Quest III Redux, which reduced it from 685MB to 360MB (the speech file alone is 123MB, with another 57MB for other audio), a reduction of 325MB.
The Conversion
To begin the conversion process, I followed my standard steps I use for creating a Mac port for an AGS game. The structure of a Wineskin app bundle is unusual, and the files I was searching for were buried in the Quest for Glory II.app/Contents/Resources/drive_c/Program Files/AGD Interactive/Quest for Glory II/
folder. I copied over the typical files (such as the app icon, acsetup.cfg, audio.vox, and the Qfg2vga.exe executable) into a modern AGS shell.
I then made the other necessary configurations to the Info.plist and then code signed the application. I double-clicked on the app and...
Crash!
Well....huh. I had ported numerous AGS games over to the Mac, but this was a new type of crash to me. I then tried to launch the game from the Terminal to see what type of error messages I could glean.
[Quest For Glory II.app/Contents/MacOS] % ./AGS
Adventure Game Studio v3.4 Interpreter
Copyright (c) 1999-2011 Chris Jones and 2011-2019 others
ACI version 3.4.4.0
Initializing allegro
Initializing game data
Located game data file: /Applications/Quest For Glory II/Quest For Glory II.app/Contents/Resources/ac2game.dat
Opened game data file: game28.dta
Game data version: 42
Compiled with: 3.2.0
Setting up game configuration
Setting up window
Initializing TTF renderer
Initializing mouse: number of buttons reported is 1
Checking memory
Data directory: /Applications/Quest For Glory II/Quest For Glory II.app/Contents/Resources
Voice pack found and initialized.
audio.vox found and initialized.
Initializing keyboard
Install timer
Sound settings: digital driver ID: 'Auto' (0xffffffff), MIDI driver ID: 'Auto' (0xffffffff)
Installed digital driver ID: 'DCA ' (0x44434120), MIDI driver ID: 'MCA ' (0x4d434120)
Install exit handler
Initialize path finder library
Game GUI version: 115
Game title: 'Quest for Glory II'
Checking for disk space
Initializing MOD/XM player
Game native resolution: 320 x 200 (32 bit)
Graphic settings: driver: Software, windowed: no, screen def: max, screen size: 0 x 0, match device ratio: yes, game scale: proportional
Mouse control: off, base: 1.000000, speed: 1.000000
Initialize sprites
Could not load sprite set file ACSPRSET.SPR
This means that the file is missing or there is not enough free
system memory to load the file.
Since this game was developed around 2009, I decided to look for an older version of the AGS shell. The oldest version I had used before was AGS 3.4.4, but for this case I needed something even earlier. The Terminal output mentioned that the game had been developed using AGS 3.2.0. I came across version 3.2.1 of the AGS engine for Mac OS X, created by a familiar name in the adventure gaming community: Sonneveld.
I tried using the 3.2.1 engine, but it didn't work quite properly with QFG2. It launched, but the screen was tiny (not full screen), anything that moved (animations, the mouse cursor) had a light magenta color behind it, and it didn't allow keyboard input. So, that didn't work. One thing I noticed is different is that the UNIX executable is named EngineMac, instead of AGS. The Windows executable file is just named Game.exe in the Resource file, instead of renaming to ac2game.dat
or game.ags
. I did check some other older demos which may have used the 3.2 AGS engine and compared them to what I was trying to accomplish, but nothing stood out why I was encountering this crash.
After being mired in the digital weeds for too long, I decided to start over. I downloaded the Windows version of QFG2 VGA, copied over the .exe file and other resources into an AGS shell, but still encountered the same crash. Looking at another Wineskin port I had previously done, I noticed that my updated King's Quest III Mac port had a bunch of extra Kq3Redux.xxx
files. I then saw similar files (Qfg2vga.001 through Qfg2vga.009) in the QFG2 Windows directory. Once I copied those over into the app bundle's Resources folder, code signed again, then launched, and it finally worked! The missing sprite files were contained within the missing Qfg2vga.xxx
files. This might be some difference with the AGS 3.2 engine, where newer games seem to be able to combine everything into the ac2game.dat
file.
AGS Shells:
I've used a variety of AGS shell applications when porting games to the Mac. Here is a collection of the files:
Importing a Character from QFG1/HQ:
One of the unique aspects to the Quest for Glory series is the ability to transfer the character between each of the games. The way that the QFG2 remake was configured, it searches inside the Mac's app bundle Resources folder for a .sav
file. This might have worked fine when the game originally was released and code signing wasn't quite as prominent. The issue now would be that trying to copy your exported character's save file into the Resources folder of the app bundle would break any existing code signing, and then the game would likely not launch after that.
The way I developed to work around this issue is to create a soft link to a known location. Inside the QFG2 app bundle's Resource folder, I created a soft link to the file HERO1.SAV
in the ~/Library/Application Support/Quest For Glory II/
folder, which is where the save games are also stored.
[Quest For Glory II.app/Contents/Resources] % ln -s ~/Library/Application\ Support/Quest\ for\ Glory\ II/HERO1.SAV ./HERO1.SAV
[Quest For Glory II.app/Contents/Resources] % ls -la *.SAV
lrwxr-xr-x 1 chad staff 69 Jan 26 12:47 HERO1.SAV -> /Users/chad/Library/Application Support/Quest for Glory II/HERO1.SAV
Then take the exported character save from Quest for Glory 1 (or Hero's Quest), rename it to HERO1.SAV
and move the file to ~/Library/Application Support/Quest for Glory II/
. Create the folder Quest for Glory II
if it does not already exist.
Exporting a Character
Upon completing the game, one can save out their character to be imported into a later QFG game. When I saved out my game, I had a difficult time finding where it had been saved. I first looked in the location where the save games were being stored (~/Library/Application Support/Quest for Glory II/
), but they weren't there. I then inspected inside the app bundle (perhaps in the Resources folder), but it wasn't there, either. I did a search across my system for the save file (axel2.sav
), but Spotlight wasn't finding it. I was worried that my character wasn't exporting properly. I started the game up from the Terminal to watch for any errors or other logs, but after exporting the character, I didn't see any suspicious messages.
Spotlight isn't always the best to find files which might be lurking in the user's Library directory, so I ran the Terminal command: find . -name axel2.sav
After a couple of minutes, the save game was found:
~/Library/Application Support/uk.co.adventuregamestudio/Quest for Glory II/
Ah, ha! I had done a cursory search in the ~/Library
and ~/Library/Application Support/
folders for the save file, but it was the uk.co.adventuregamestudio
folder I needed to dig into. This folder also had game folders for other AGS games and any particular settings/data which they might have saved out to that location.
Conclusion
This process was primarily done so I could play this great game on modern Macs, although it ended up being more complicated than I had originally expected. I've heard that ScummVM can also run AGS games, but my attempts to run the original AGDI versions of QFG2 didn't seem to load into ScummVM, or perhaps it just doesn't work with Mac AGS games.
Ultimately, this process was another interesting exercise in porting an AGS game. Even though I have become fairly experienced with these ports, there's always something which can make the process difficult or challenging, whether it be creating a Universal Binary or getting Steam achievements to work. I hope this article gives some good insights on an alternative to using Wine when it comes to games which have been built using Adventure Game Studio.