AGI for Newbies Chapter 2 - Nuts and Bolts

From AGI Wiki
Revision as of 00:36, 16 December 2013 by Andrew Branscom (talk | contribs)
Jump to navigationJump to search

Tutorials Table of Contents

AGI for Newbies

By Nat Budin and Dark Fiber

Chapter 2

Nuts and Bolts


Page: 1 [ 2 ] 3

 

 
A peek into an AGI game directory


Agistudio.png
AGI Studio version 1.31

If you look into the folder of an AGI game, you'll see a lot of files with strange names. "WORDS.TOK?" "LOGDIR?" What the heck is that?

Nearly all of the files you'll find are directly used by AGI during the game. Not all of them, however, are actually parts of the game itself. Let's go through the files one-by-one.

  • Saved Games -- These files have names like "SG.3," "KQ3SG.1" or "SQSG.5". (Basically, if it ends in "SG." followed by a number, it's a saved game.) These files are very small (although their actual size depends on the length of the game), and are not part of the game itself.
  • OVL Files -- These files are binary code used by the game. Some OVL files are graphics drivers, such as "HGC_GRAF.OVL" or "EGA_GRAF.OVL". Others are drivers for other internal functions, such as "IBM_OBJS.OVL". One of the files, "AGIDATA.OVL" contains some basic AGI code and copy-protection data. None of these files are part of the game itself.
  • HGC_FONT -- This file is the font used by AGI with the Hercules Graphics Card. It's not part of the game.
  • AGI -- This file contains most of the code for the interpreter. It can be modified to change how the interpreter works. For example, the AGISB patch adds Sound Blaster support to AGI by modifying this file. The "AGI" file is not part of the game.
  • SIERRA.COM -- Sometimes the name of this file is changed to match the name of the game, such as "KQ3.COM". However, it is still the same file. This program is the "loader" for the game, and is the only executable file in the game's directory (unless you've installed AGIHack or some other utility). This file is not part of the game.
  • OBJECT -- This file contains all the names of the items that the player can pick up. It is part of the game itself.
  • WORDS.TOK -- This file contains all the words the game's parser will understand. It is part of the game.
  • VOL Files -- These files ("VOL.0", "VOL.1", etc) contain the "meat" of the game: its graphics, sound, and programming.
  • VIEWDIR, PICDIR, SNDDIR, LOGDIR -- These files point the interpreter to the places in the VOL files where the game's resources are stored. It categorizes resources by number.
  • BAT Files -- These files are neither part of the game nor part of the interpreter. They can be safely ignored or deleted.


File:Caution.gifIf your game is on a floppy disk rather than on your hard drive, DO NOT DELETE OR OVERWRITE ANY FILES. Doing so may cause the game to stop working. To modify the game, first copy the files to your hard drive.


A closer look at the VOL files

The VOL files, as mentioned above, contain most of the game's data. These files contain four different types of game resources:

  • VIEW -- The on-screen animated objects are all stored in VIEW resources. A VIEW resource can contain various "cels," all arranged in "loops." We'll discuss VIEWs more in depth later.
  • PIC -- The PIC resources provide the visual background for rooms in AGI games. They also tell the interpreter which objects go behind other objects, and where moving objects are allowed to go.
  • SOUND -- SOUND resources are capable of storing three synchronized musical voices, and one synchronized noise voice. The SOUND format is highly optimized for the IBM PCjr's sound chip, the TI-SN76496A, but can be played on other sound cards, such as the Sound Blaster.
  • LOGIC -- LOGIC resources are the actual programming of the game. LOGIC resources will be discussed much more later.

Here's a metaphor you can picture: think of your AGI game as a Broadway-style musical production. The VIEW resources are your actors and props, the PIC resources your set. The SOUND resources are your orchestra pit, and the LOGIC resources are your technical crew.

A brief introduction to AGI Studio

If you haven't already done so, grab a copy of AGI Studio from the AGI Filedump at http://agidump.cjb.net/. It requires Windows 95 or Windows NT and an unzip program such as PKUNZIP or WinZip.

To install AGI Studio, follow these steps:

  • Make a new directory on your hard disk called "AGI Studio".
  • Unzip the file you downloaded (usually agistudio.zip) to the new directory. Use an unzip program for Windows, such as WinZIP or NetZIP, to preserve long file names.
  • Start the program "AGI Studio.exe" in your new directory.
  • If you want, make a shortcut to AGI Studio on your Start Menu.

Now you're in AGI Studio. Right now it will look like just a big empty window with a toolbar on the top and some menus. Let's start a new project.

To start a new AGI game project in AGI Studio, follow these steps:

  • From the Game menu, select New/From Template. This will start a new project using the AGI Template that comes with AGI Studio. (We could also create a completely blank game, but using the Template is easier and quicker. Throughout this tutorial, we'll be using the Template.)
  • Using the dialog box that popped up, create a directory for your new game. Select the directory and press OK.
  • After a short delay, while AGI Studio prepares your new directory, two windows will appear. One is called "Resources" and the other is called "Preview." The Resources window displays all the resources (VIEWs, PICs, SOUNDs, and LOGICs) in your game's VOL files. Currently it should be displaying VIEWs. To change that, use the drop-down box that says "VIEW" to select another resource type.

The Preview window displays a preview of the currently selected resource in the Resources window. Some resources can't be previewed, such as the SOUND and LOGIC resources. (This may change in a future version of AGI Studio.) Let's try previewing a resource.

* Using the Resources window, select "VIEW.000". * Notice that a picture of loop 0, cel 0 of VIEW.000 appears in the Preview window. This picture should be a man in a blue shirt. * Use the cel forward/back buttons to change cels. Notice that the man appears to walk. This is because each cel holds an image of the man in a different walking position. * Click the loop forward button. Now cycle through the cels using the cel forward button. Notice that the man appears to walk in a different direction. This is because each loop holds cels of the man in different walking positions. Each loop is a different direction.

To run the game, there must be an interpreter in the game's directory. To copy in an interpreter, we'll need an AGI game. Demo Pack 1, 2, or 3 from the AGI Filedump (http://agidump.cjb.net) will do.

  • Download Demo Pack 1, 2, or 3 from the AGI Filedump. Make a new directory, then unzip the demo pack into it.
  • Make a new directory called "interp". Copy the following files from the demo pack into the new "interp" directory:
    • SIERRA.COM
    • AGI
    • HGC_FONT
    • all OVL files (files ending in .OVL)
  • Copy everything in the "interp" directory into your project's directory.

Now, let's run the game.

  • On the AGI Studio toolbar, click the icon that looks like a red, running stick figure.
  • A dialog will pop up asking you to select your game's executable. Click OK.
  • Select the file SIERRA.COM in the dialog box. Click OK.
  • Now your game will run.

You'll only have to select the executable file the first time you run any game project. After that, clicking on the running man will run the game immediately.

What's up next

In the next chapter, we'll begin to create an AGI game called "DORK: An Interactive AGI Tutorial." Stay tuned for more AGI For Newbies, coming soon to a theater near you.

Page: 1 [ 2 ] 3

 

Tutorials Table of Contents

< Previous: Chapter 1Next: >