Difference between revisions of "AGI for Newbies Chapter 2 - Nuts and Bolts"

From AGI Wiki
Jump to navigationJump to search
 
(27 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[AGI Tutorials|Tutorials Table of Contents]]<br />
+
[[Tutorials and Guides|Tutorials and Guides Table of Contents]]<br />
 +
[[AGI for Newbies|AGI for Newbies Index]]
  
<div align="center"><span style="font-size: 22pt">AGI for Newbies</span><br />
+
<div align="center">
''By [[Nat Budin]] and [[Dark Fiber]]''<br />
+
Page:  
Chapter 2<br />
+
[[AGI for Newbies Chapter 1 - Introducing AGI|1]] |
Nuts and Bolts</div>
+
[[AGI for Newbies Chapter 2 - Nuts and Bolts|2]] |
 +
[[AGI for Newbies Chapter 3 - An Introduction to Logic|3]]
 +
</div>
  
Page: [[AGI for Newbies - Introducing AGI|Chapter 1]] '''[ 2 ]''' [[AGI for Newbies Chapter 3 - An Introduction to LOGIC|Chapter 3]]<br />
+
&nbsp;
  
&nbsp;
+
<div align="center"><span style="font-size: 22pt">Chapter 2 - Nuts and Bolts</span><br />
 +
''By [[Nat Budin]] and [[Dark Fiber]]''</div>
 +
 
 +
===<br /> A peek into an AGI game directory ===
  
=== &nbsp;<br />A peek into an AGI game directory ===
+
<div align="center">[[File:agistudio.png]]<br /> AGI Studio version 1.31</div><br />
  
<div style=&quot;text-align: center&quot;><br />[[File:agistudio.png]]<br /> AGI Studio version 1.31<br /></div>
 
  
 
If you look into the folder of an AGI game, you'll see a lot of files with strange names.  &quot;WORDS.TOK?&quot;  &quot;LOGDIR?&quot;  What the heck is that?
 
If you look into the folder of an AGI game, you'll see a lot of files with strange names.  &quot;WORDS.TOK?&quot;  &quot;LOGDIR?&quot;  What the heck is that?
Line 29: Line 34:
 
* '''BAT Files''' -- These files are neither part of the game nor part of the interpreter.  They can be safely ignored or deleted.
 
* '''BAT Files''' -- These files are neither part of the game nor part of the interpreter.  They can be safely ignored or deleted.
  
<br />[[Image:caution.gif]]If 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.
 
  
<br />
+
{| align="left" valign="top"
 +
|[[Image:caution.png]]
 +
|}
 +
If 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 ===
+
===<br /> 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:<br />
 
The VOL files, as mentioned above, contain most of the game's data.  These files contain four different types of game resources:<br />
  
* '''VIEW''' -- The on-screen animated objects are all stored in VIEW resources.  A VIEW resource can contain various &quot;cels,&quot; all arranged in &quot;loops.&quot;  We'll discuss VIEWs more in depth later.
+
* '''[[View Resource (AGI)|View]]''' -- The on-screen animated objects are all stored in [[View Resource (AGI)|View resources]].  A View resource can contain various &quot;cels,&quot; all arranged in &quot;loops.&quot;  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.
+
* '''[[Picture Resource (AGI)|Picture]]''' -- The Picture 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.
+
* '''[[AGI Sound Resource|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.
+
* '''[[AGI Logic Resource|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.
+
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 Picture resources your set.  The SOUND resources are your orchestra pit, and the Logic resources are your technical crew.
  
=== A brief introduction to AGI Studio ===
+
===<br /> 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.
+
If you haven't already done so, grab a copy of [[AGI Studio]]. It requires Windows.
  
To install AGI Studio, follow these steps:<br />
+
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.
 
 
* '''Make a new directory on your hard disk called &quot;AGI Studio&quot;.'''
 
* '''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 &quot;AGI Studio.exe&quot; 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:<br />
 
To start a new AGI game project in AGI Studio, follow these steps:<br />
  
* '''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.)'''
+
* '''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.'''
+
* '''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 &quot;Resources&quot; and the other is called &quot;Preview.&quot;  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 &quot;VIEW&quot; to select another resource type.'''<br />
+
* '''After a short delay, while AGI Studio prepares your new directory, two windows will appear. One is called &quot;Resources&quot; and the other is called &quot;Preview.&quot;  The Resources window displays all the resources (Views, Pictures, 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 &quot;View&quot; to select another resource type.'''<br />
  
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.<br />
+
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.<br />
  
''' * Using the Resources window, select &quot;VIEW.000&quot;. * 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.'''
+
''' * Using the Resources window, select &quot;VIEW.000&quot;. * 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.<br />
+
To run the game, there must be an interpreter in the game's directory. If your template game did not include one, you can copy it from another AGI game, such as on of the [[AGI Demo Packs]] or one of the [[Fan Release List|fan games]]. Copy the following files into your project's directory:'''
  
* '''Download Demo Pack 1, 2, or 3 from the AGI Filedump.  Make a new directory, then unzip the demo pack into it.'''
+
* SIERRA.COM
* '''Make a new directory called &quot;interp&quot;.  Copy the following files from the demo pack into the new &quot;interp&quot; directory:'''
+
* AGI
** SIERRA.COM
+
* HGC_FONT
** AGI
+
* all OVL files (files ending in .OVL)
** HGC_FONT
 
** all OVL files (files ending in .OVL)
 
* '''Copy everything in the &quot;interp&quot; directory into your project's directory.'''<br />
 
  
 
Now, let's run the game.<br />
 
Now, let's run the game.<br />
  
 
* '''On the AGI Studio toolbar, click the icon that looks like a red, running stick figure.'''
 
* '''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.'''
+
* '''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.'''
+
* '''Select the file SIERRA.COM in the dialog box. Click OK.'''
 
* '''Now your game will run.'''<br />
 
* '''Now your game will run.'''<br />
  
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.
+
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.
 +
 
 +
&nbsp;
  
 
=== What's up next ===
 
=== What's up next ===
Line 90: Line 89:
 
In the next chapter, we'll begin to create an AGI game called &quot;DORK: An Interactive AGI Tutorial.&quot;  Stay tuned for more AGI For Newbies, coming soon to a theater near you.
 
In the next chapter, we'll begin to create an AGI game called &quot;DORK: An Interactive AGI Tutorial.&quot;  Stay tuned for more AGI For Newbies, coming soon to a theater near you.
  
Page: [[AGI for Newbies - Introducing AGI|1]] '''[ 2 ]''' [[AGI for Newbies Chapter 3 - |3]]
+
&nbsp;
  
&nbsp;
+
<div align="center">
 +
Page:
 +
[[AGI for Newbies Chapter 1 - Introducing AGI|1]] |
 +
[[AGI for Newbies Chapter 2 - Nuts and Bolts|2]] |
 +
[[AGI for Newbies Chapter 3 - An Introduction to Logic|3]]
 +
</div>
  
[[AGI Tutorials|Tutorials Table of Contents]]
+
[[Tutorials and Guides|Tutorials and Guides Table of Contents]]<br />
 +
[[AGI for Newbies|AGI for Newbies Index]]
  
<span style="float: left">[[AGI for Newbies - Introducing AGI|&lt; Previous: Chapter 1]]</span><span style="float: right">[[AGI for Newbies Chapter 3 - An Introduction to LOGIC|Next: &gt;]]</span>
+
<span style="float: left">[[AGI for Newbies Chapter 1 - Introducing AGI|&lt; Previous: Chapter 1]]</span><span style="float: right">[[AGI for Newbies Chapter 3 - An Introduction to Logic|Next: Chapter 3 - An Introduction to Logic &gt;]]</span>
  
 
&nbsp;
 
&nbsp;
  
 
[[Category:Tutorials]]
 
[[Category:Tutorials]]

Latest revision as of 17:37, 14 April 2019

Tutorials and Guides Table of Contents
AGI for Newbies Index

Page: 1 | 2 | 3

 

Chapter 2 - Nuts and Bolts
By Nat Budin and Dark Fiber


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.


Caution.png

If 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.
  • Picture -- The Picture 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 Picture 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. It requires Windows.

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, Pictures, 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. If your template game did not include one, you can copy it from another AGI game, such as on of the AGI Demo Packs or one of the fan games. Copy the following files into your project's directory:

  • SIERRA.COM
  • AGI
  • HGC_FONT
  • all OVL files (files ending in .OVL)

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 and Guides Table of Contents
AGI for Newbies Index

< Previous: Chapter 1Next: Chapter 3 - An Introduction to Logic >