Difference between revisions of "AGI/Specifications/Other"

Jump to navigation Jump to search
2,861 bytes removed ,  03:05, 23 January 2011
m
behaviour -> behavior
(Added link to AGI Picture Tools.)
m (behaviour -> behavior)
 
(19 intermediate revisions by 4 users not shown)
Line 54: Line 54:
* Command name determines the data type it operates on, the nature of its operation, and the result. For example, consider assignment commands: assignn 10, 2 means store the value 2 into the variable number 10; assignv 10, 2 means store the value of variable 2 into the variable 10; set 10 mean set flag 10 to 1. Most often you will have to memorize what each command does and the type of its operands.
* Command name determines the data type it operates on, the nature of its operation, and the result. For example, consider assignment commands: assignn 10, 2 means store the value 2 into the variable number 10; assignv 10, 2 means store the value of variable 2 into the variable 10; set 10 mean set flag 10 to 1. Most often you will have to memorize what each command does and the type of its operands.
* Small internal interpreter memory occasionally overflows. This is annoying because there may be lots of free RAM at the same time.
* Small internal interpreter memory occasionally overflows. This is annoying because there may be lots of free RAM at the same time.
* There are powerful commands new_room and new_room_v used to completely change the program behaviour.
* There are powerful commands new_room and new_room_v used to completely change the program behavior.
* There are many test commands which allow not only to check the state of variables and flags, but also the position of objects one relative to another, or relative to some special lines and areas drawn on the background (for example, control barriers or water surface). The result of tests determines the progress of the game according to the design.
* There are many test commands which allow not only to check the state of variables and flags, but also the position of objects one relative to another, or relative to some special lines and areas drawn on the background (for example, control barriers or water surface). The result of tests determines the progress of the game according to the design.
* The ability to fairly easily animate objects on the screen. Note that all the images programmatically associated with objects the interpreter or the user can control, have to be first created using the VIM utility, as well as the background created using PM utility. That is, creating an animation is a two-stage process: drawing a frame-by-frame animated sequence of the object (a human figure walking but not moving) and programmatic movement of the object for which the animation is played (this creates a walking figure). We shall later discuss the interaction between the designer, the artist and the programmer.
* The ability to fairly easily animate objects on the screen. Note that all the images programmatically associated with objects the interpreter or the user can control, have to be first created using the VIM utility, as well as the background created using PM utility. That is, creating an animation is a two-stage process: drawing a frame-by-frame animated sequence of the object (a human figure walking but not moving) and programmatic movement of the object for which the animation is played (this creates a walking figure). We shall later discuss the interaction between the designer, the artist and the programmer.
Line 127: Line 127:
Logic 0 (unlike all other logics) always stays in the interpreter's memory and determines all the interpreter's actions relevant to the overall game control. This is why I decided it has to store the description of actions common to all logics of the future program (how many logics there will be I knew only approximately). These actions, I decided, would first of all include the tests if the keys I have reserved for certain actions (help, turning sound on or off, restarting the program, etc.) are pressed (see log0.asm). Besides, it should include one-time actions that show the program title screen and perform initial initializations. (Initialization code is in logic 1, log01.asm).
Logic 0 (unlike all other logics) always stays in the interpreter's memory and determines all the interpreter's actions relevant to the overall game control. This is why I decided it has to store the description of actions common to all logics of the future program (how many logics there will be I knew only approximately). These actions, I decided, would first of all include the tests if the keys I have reserved for certain actions (help, turning sound on or off, restarting the program, etc.) are pressed (see log0.asm). Besides, it should include one-time actions that show the program title screen and perform initial initializations. (Initialization code is in logic 1, log01.asm).


Initialization code is executed only once and contains the commands that change the cursor shape, built-in debugger parameters, character colour, maximum score, and assign certain numeric codes to the keys I have chosen (set_key command), to be used later by the controller command to determine the state (pressed/released) of these keys.
Initialization code is executed only once and contains the commands that change the cursor shape, built-in debugger parameters, character color, maximum score, and assign certain numeric codes to the keys I have chosen (set_key command), to be used later by the controller command to determine the state (pressed/released) of these keys.


Because logic 0 is so important, here is its block diagram:
Because logic 0 is so important, here is its block diagram:
Line 432: Line 432:
* Don't "bloat" the cels, make them just large enough to fit the image. If possible, create loops of cels of variable size to make them as small as possible. Note that Thunderstorm view resources are not an example in this respect.
* Don't "bloat" the cels, make them just large enough to fit the image. If possible, create loops of cels of variable size to make them as small as possible. Note that Thunderstorm view resources are not an example in this respect.
* When you create a VIEW resource, the first command line argument is the number of loops in the resource. It may happen that you have to change the number of loops in the resource as you work on a program. To do that you will have to save all cels using the S command (issued for each individual cel because it saves the cels in separate files under automatically generated names), then create a new VIEW with the required number of loops and load all cels back using L command. See VIM manual how the cel file names are generated.
* When you create a VIEW resource, the first command line argument is the number of loops in the resource. It may happen that you have to change the number of loops in the resource as you work on a program. To do that you will have to save all cels using the S command (issued for each individual cel because it saves the cels in separate files under automatically generated names), then create a new VIEW with the required number of loops and load all cels back using L command. See VIM manual how the cel file names are generated.
* Drawing an animation, use colour reference points in each cel. Use the fact that as cels are changed the cursor stays where it was in the previous cel. (He means changing cels in the editor, not during playback by the interpreter. --VM)
* Drawing an animation, use color reference points in each cel. Use the fact that as cels are changed the cursor stays where it was in the previous cel. (He means changing cels in the editor, not during playback by the interpreter. --VM)
* Do not create animations with more than 23--24 cels. The editor may crash, at least the version we have.
* Do not create animations with more than 23--24 cels. The editor may crash, at least the version we have.
* The best advisor is your experience.
* The best advisor is your experience.
Line 478: Line 478:


===MEKA===
===MEKA===
MEKA stands for "Möller, Ewing and Kelly Adventure" and has been developed by AGI hackers Joakim Möller, Lance Ewing and Peter Kelly using DJGPP and the Allegro library to run under MS-DOS. It has support for both v2 and v3 games, and some routines from MEKA have been reused in Sarien, specifcally the LZW decompression routines and modified picture decoding routines.
MEKA stands for "Möller, Ewing and Kelly Adventure" and has been developed by AGI hackers Joakim Möller, Lance Ewing and Peter Kelly using DJGPP and the Allegro library to run under MS-DOS. It has support for both v2 and v3 games, and some routines from MEKA have been reused in Sarien, specifcally the LZW decompression routines and modified picture decoding routines.


===JAGI===
===JAGI===
Line 490: Line 490:


<span id="Extensions"></span>
<span id="Extensions"></span>
=Fan-Made Extensions=
==AGIPAL==
AGIPAL uses the shake.screen command to call an external file which changes the palette. The range of palette files is 101-109.
<pre>shake.screen(101)</pre>
That command would use the palette in pal.101, instead of shaking the screen 101 times under the AGIPAL interpreter.
===pal.* Format===
There are always eight 24-byte chunks, so the file is always 192 bytes.
<pre>
Chunk0 Holds RGB palette data for the first 8 colors
Chunk1 Same as Chunk0
Chunk2 Holds RGB palette data for the second 8 colors
Chunk3 Same as Chunk2
Chunk4-Chunk7 Same as Chunk0-Chunk3
</pre>
==AGI256==
AGI256 is a hack to AGI interpreter v2.936 to add 256-color picture resource support.
The AGI256 hack was originally made by Dark Minister.
AGI256 uses the unknown170(v) a.k.a. set_simple(v) command to load 256-color
picture resources. The parameter v is the variable's number that holds the
picture resource's number.
Example of use:
<pre>
v123 = 10
unknown170(v123)
</pre>
That would load the picture resource number 10 as a 256-color picture resource.
Any variable can be used with unknown170, v123 was just chosen for this example.
===256-color picture resource format===
<pre>
Data    : Simply a raw 256-color 160x168 size picture, one byte per pixel.
Length  : Always 160*168*1 = 26880 bytes.
Palette : Isn't saved in the file. Uses the default VGA palette.
</pre>
As AGI256 was hacked to a v2.936 AGI interpreter no compression is used on
the picture resource data (Only v3 AGI interpreters use compression).
===Links===
[http://agisci.classicgaming.gamespy.com/agi256.shtml How to use AGI256]<br>
[http://dl.fileplanet.com/dl/dl.asp?ClassicGaming/agisci/agi-256c.zip The AGI256 demo]<br>
[http://agisci.classicgaming.gamespy.com/agiutil.shtml#PictureTools AGI Picture Tools (Some support AGI256)]<br>
==AGI256-2==
AGI256-2 is an extension to AGI256 to further add 256-color view support.
The AGI256-2 hack was originally made by Brian Provinciano.
AGI256-2 uses a modified cel blitting routine so that it can handle view data
that isn't run length encoded and has 256 colors.
AGI256-2 uses the same palette as AGI256 i.e. the default VGA palette.
===256-color view resource format===
Like the v2 AGI view resources but with the following differences:
* Starts with bytes 0x0F, 0xF0
** Can be used for detecting 256-color view resources
* Doesn't support mirroring
** Mirroring/Transparency byte is used solely for choosing the transparent color
* Cel data is not run length encoded
** Cel data is raw 256-color data, one byte per pixel
*** NOTE though that 0x00 for a new line is still supported
===Links===
[http://dl.fileplanet.com/dl/dl.asp?ClassicGaming/agisci/agi256-2.zip The AGI256-2 demo]<br>
[http://agisci.classicgaming.gamespy.com/agiutil.shtml#ViewTools AGI View Tools (Some support AGI256-2)]<br>
2,051

edits

Navigation menu