Sierra's Adventure Game Interpreter (AGI)
In 1984, Sierra Online created King's Quest: Quest for the Crown, to be marketed alongside IBM's then new PCjr computer. Since the game design was so complex, Sierra decided to write an engine that the game data would then be driven by. They called this engine, AGI, or Adventure Game Interpreter.
AGI was forward-thinking, as it allowed Sierra to be able to build adventures more quickly, with a consistent look and feel, and be portable across multiple platforms.
In its original form, it had these basic capabilities:
- Up to 16-colour graphics in 320 x 200 resolution
- a mix of graphics and text with a text-input parser
- player movement using either the cursor keys or joystick
- support for Tandy and PCjr 3-voice sound
AGI was able to read and interpret a game's logic, display background pictures, show sprites and animations, and play sound. It held game data in "resource" files that contain these objects, and an 'interpreter' could recognize these objects and game logic. AGI was ported to several other platforms including the Apple II, Atari ST, Commodore Amiga, and the Tandy TRS-80. This meant an AGI game's files could be ported very quickly to any of these other platforms. The focus of this article is on the PC and Tandy/PCjr platforms.
The operating mode for AGI games was that you would move the player character from screen to screen and to locations within the current screen using the cursor keys or optionally, a joystick, and interact with objects and non-player characters by inputting commands using the keyboard. When a command is input, the interpreter's parser would check the words that have been submitted against its known vocabulary (in the WORDS.TOK file) and if recognised process the command.
Screen backgrounds were created using vectors (point-to-point line drawing with fills).
There were 3 main versions of AGI during its lifetime, called AGI1, AGI2, and AGI3, though before AGI1 the first three versions of King's Quest are referred to as 'AGI0' titles - these comprised the original game created for the IBM PCjr, the port for the IBM PC and in 1985 the port for the Tandy 1000.
AGI1 (1984-1985)
All AGI1 games were 'PC Booters' (not requiring DOS to be loaded first). They did not have the white status bar along the top that showed the player's score, there were no dropdown menus and you could only save a game to a blank floppy disk (though you could format a floppy disk from within the game using a special command).
AGI1 games support IBM PC and Tandy, and many will run on the IBM PCjr too - these all have built-in auto-detection of PC and Tandy/PCjr so the game could setup the graphics and sound modes properly based on the hardware found. Only the AGI0 graphics modes are supported by AGI1 - this means 320 x 200 resolution in either 4-colour CGA using the red/green/brown pallete, or 16-colour composite. Strictly-speaking, the horizontal resolution of all AGI games is 160 x 200, but the horizontal pixels are doubled-up, resulting in 320 pixels wide. This is evident when text is displayed on the screen, as it uses 40 columns of 8x8 text blocks. Sound capabilities were also the same as for AGI0: either the single tone PC speaker or the 3-voice sound of the Tandy/PCjr.
AGI2 (1986-1987)
Sierra upgraded AGI around 1986, adding support for the EGA graphics standard (games used EGA's 320 x 200 resolution in 16 colours), a dropdown menu bar and the ability to select different animation speeds. From interpreter version 2.4xx and onward, Hercules monochrome graphics was also supported as well as MCGA which was a short-lived standard introduced with the first IBM PS/2 Model 25 and Model 30. AGI2 titles used "key disk" copy protection (this meant you had to insert the original floppy disk to be able to play the game - copies would not work). Later versions of AGI2 would also add support for VGA graphics.
(From top-left clockwise) The Black Cauldron, King's Quest: Quest for the Crown,
Police Quest: In Pursuit of the Death Angel, and Space Quest: The Sarien Encounter
All AGI0 and AGI1 games were eventually re-released with an AGI2 interpreter.
AGI3 (1988-1989)
AGI3 titles got rid of the "key disk" copy protection, instead moving to manual-based, where the user was asked to look up a specific word on a page in the game manual.
(From top-left clockwise): Manhunter: New York, King's Quest IV: The Perils of Rosella,
Manhunter: San Francisco, and Gold Rush!
You can see which AGI version was used for each game in this table (years reflect the DOS release):
Game | Year | AGI Version | Notes* |
---|---|---|---|
King's Quest: Quest for the Crown | 1987 | AGI1 | Later versions used AGI2 (interpreter versions 2.411 and 2.426). |
King's Quest II: Romancing the Throne | 1987 | AGI1 | Only the PC Booter version of KQ2 used AGI1. Others used AGI2 (interpreter versions 2.411 and 2.426 and 2.917) |
The Black Cauldron | 1986 | AGI1 | Interpreter version 1.12 |
Donald Duck's Playground | 1986 | AGI2 | Interpreter version 2.001 |
King's Quest III: To Heir Is Human | 1988 | AGI2 | Interpreter versions 2.272, 2.411, 2.426 and 2.917 |
Space Quest: The Sarien Encounter | 1986 | AGI2 | Interpreter versions 2.272, 2.912, 2.915, 2.917 and 2.936 |
Leisure Suit Larry in the Land of the Lounge Lizards | 1987 | AGI2 | Interpreter versions 2.440 and 2.917 |
Mixed Up Mother Goose | 1987 | AGI2 | Interpreter version 2.915 |
Police Quest: In Pursuit of the Death Angel | 1987 | AGI2 | Interpreter versions 2.903, 2.911, 2.915 and 2.917 |
Space Quest II: Vohaul's Revenge | 1987 | AGI2 | Interpreter versions 2.912, 2.915, 2.917 and 2.936 |
Gold Rush! | 1988 | AGI3 | Interpreter version 3.002.149 |
Manhunter: New York | 1988 | AGI3 | Interpreter version 3.002.102 |
King's Quest IV: The Perils of Rosella | 1988 | AGI3 | Interpreter version 3.002.086 |
Manhunter 2: San Francisco | 1989 | AGI3 | Interpreter version 3.002.149 |
*Numerous minor interpreter versions were created, usually to fix bugs in earlier versions.
AGI games are all rather speed-sensitive - as you would no doubt expect, they were designed to be best run on representative machines of the day when they were released. Sierra did have commands to allow you to set your walking speed, 'slow', 'normal' and 'fast' (there might have also been 'slowest' and 'fastest' as well, I don't recall), but this doesn't slow down the game's internal clock so running on hardware that's out of period for the game may cause issues with events being missed or happening too fast. Running such games today on more modern retro PCs such as 486DX2 or Pentium-class computers will require caches to be disabled or a slowdown utility to run the game successfully.
Post-AGI Era
The last game written using AGI was Manhunter 2: San Francisco, released in 1989.
Recognising the aging limitations of AGI, in 1987 Sierra began working on a successor with higher-resolution graphics, better sound and enhanced features. The new game engine was called SCI, or "SCript Interpreter", and later stood for "Sierra Creative Interpreter".
Head over to my separate SCI article to read more.
Fan-Made AGI Games and Sierra Remakes
There have been many AGI games produced by fans over the years. Click here to download a single zip file that contains 160 of them (it's 24 MB in size).
AGD Interactive released remakes of the first three King's Quest AGI games with approval from Sierra.
King's Quest I: Quest for the Crown
AGD Interactive released King's Quest I: Quest for the Crown in August 2001. Since then it has had a number of updates, the latest being v4.1 Enhanced Edition in September 2010 which also includes the earlier digital music and speech pack add-ons. It runs on Windows ME, 2000, XP, Vista or 7, and requires a Pentium 233 or higher processor, 16 MB RAM, 32-bit SVGA card with 2 MB of video memory, DirectX 5.0 or above, and 139 MB of free disk space. You can download the 102 MB installer for free here or visit the AGDI website for the game.
King's Quest II: Romancing the Stones
AGD Interactive released King's Quest II: Romancing the Stones back in 2002. Since then it has had a number of updates, the latest being v3.1 Enhanced Edition in September 2010 which also includes the earlier digital music and speech pack add-ons. It runs on Windows ME, 2000, XP, Vista or 7, and requires a Pentium 233 or higher processor, 16 MB RAM, 32-bit SVGA card with 2 MB of video memory, DirectX 5.0 or above, and 410 MB of free disk space. You can download the 309 MB installer for free here or visit the AGDI website for the game.
King's Quest III: To Heir Is Human
Runs on Windows XP, Vista or 7, and requires a Pentium 300 or higher processor, 64 MB RAM, 32-bit SVGA card with 16 MB of video memory, DirectX 5.0 or above, and 345 MB of free disk space. You can download it for free here or visit the AGDI website for the game..
AGI Tools
In 1996 an adventure game fan Peter Kelly began work on understanding and documenting the many aspects of AGI and in September 1997 started to work on a tool to be able to edit and view all of the resources in AGI games. This he called AGI Studio. AGI Studio could also be used to create entirely new adventure games from scratch. The last version by Peter is 1.31a, runs in Windows 95, 98 or NT 4.0, and comes with a template AGI 2 project to act as a starter for a new game. Peter also released the Borland Delphi source code for AGI Studio which can be downloaded here.
Coupled with AGI Studio, on his Sierra Classics website (now no longer available), Peter provided a number of pages to act as useful information or tutorials for those interested in developing AGI games. These can be found here:
- Data used by AGI (info)
- Defines (info)
- Basic structure of a room (info)
- Items that the player can pick up (tutorial)
- Doors (tutorial)
Sadly, Peter was unable to continue developing AGI Studio due to other personal commitments. However, the project was picked up by a few others and enhanced further in subsequent years:
- Nailhead AGI Studio v1.38b - A continuation off Peter Kelly's original source code. Supports logic, view, dictionary editing. Comes with template game. Recommended. NOTE: if you encounter strange view editing bugs (like sprites being saved as black and white), try AGI Studio v1.34. The source code for v1.37 is available. Developed by Nailhead from 2001 (nailhead.org, no longer online), headed up by Eric Fullerton, who along with a team was developing a new AGI game entitled "Nailhedz".
- Nailhead AGI Studio v1.34 - For people who encounter the view saving bug. Developed by Nailhead (nailhead.org, no longer online).
A number of interpreters are available- an interpreter is required to run your AGI game, even if it's the Sierra original:
- NAGI v2.06 - New Adventure Game Interpreter written by Nick Sonneveld. This has excellent game compatibility with most games, supports full channel music, mouse, all versions of the interpreter, save games and checksum identification. It also runs great under Windows 95, 98, ME, 2000 and XP. Based upon the SDL Library, which you will need installed in the same directory as NAGI. Nick also provided the source code.
- Sarien - an open source, portable implementation of the AGI Interpreter from Sierra. It is necessary to also download the CYGWIN runtime and rename the Sarien executable to "sarien.exe" to execute Sarien under Windows. Source code is also available.
- Sierra Original Interpreter -There are a few different versions of the interpreter, but the main one you will want is the latest v2 interpreter.
There are a number of picture editors, converters, and tools listed here:
- PCX2PIC - converts .PCX files to AGI picture resources. Written by Eskil Blomfeldt.
- PicEdit - create and edit AGI picture resources. The source code is also available. Written by Lance Ewing.
- Vector v1.4 - converts bitmap images in .BMP, .PCX or .TGA format and converts them into vectors. Use this to help you in creating background picture resources for your AGI game. Written by Eric Agsjo.
- AGI Picture Repeat v1.02b - A useful tool to help you create a repeating graphical pattern. Written by Joel McCormick.
- Room Generator - another utility by Joel McCormick that creates very simple AGI picture resources that are intended to help you create basic cube-shaped indoor rooms.
Listed below are some tools to help you build logic for AGI games:
- Logic Wizard - help you create template logic files. All you have to do is enter in things such as a 'look' description, and let Logic Wizard do the rest for you. It is a very basic template for each room, but at least it's a start.
- AGI Base Logic Generator v2 - A much more advanced template generator. Similar to Logic Wizard but allows the developer to exercise much more control over where the ego appears, the comments and defines. The source code is also available.
And some sound utilities:
- AGI Visual Sound Editor beta8 - A fragment of the entire Visual AGI suite. A very nice sound editor that is similar in operation to the trackers that the MOD community used to use. Written by Joakim Möller and Gustaf Wennerholm.
- AGI Sound Edit - A DOS tool for editing sounds for the AGI sound format. Written by Ronnie Harpaz.
- Sound Script Utils v1.0 - A set of tools that enable you to manipulate user-editable script files that represent the AGI sound format. You can convert AGI sound resources into this format for easy editing, or compile your script into a sound resource to be played on an AGI interpreter. Source is available with the package. Written by Nick Sonneveld (agidev.com)
- AGI Play - DOS tools to play AGI sounds.
- MIDI2ROL v1.1 - Converts MIDI files to ROL format.
- ROL2AGI - Converts ROL files to AGI sound format.
- Merge Sound v0.3 - Merge AGI sounds together into a resource file.
Other Non-Sierra Patches
AGI games natively only support the PC speaker and Tandy 3-voice sound. There are two utilities written by Anders M Olsson that allow the Tandy 3-voice audio to work in standard PCs equipped with a Sound Blaster- or MIDI-compatible audio device called AGISB and AGI-MIDI respectively. AGISB requires game interpreter version 2.911 or higher, so if the game you are playing has an interpreter version older than this, you can copy a later interpreter into your game directory and the patch should then work just fine. AGI-MIDI works with both a Roland MT-32 and SC-55 (and other SC models) - it sounds better with an SC MIDI unit.