OBJECT File

From AGI Wiki
Jump to: navigation, search

Note: this section includes technical details about the object file format. Game authors generally do not need to know this information.

 


Introduction

The object file stores two bits of information about the inventory items used in an AGI game. The starting room location and the name of the inventory item. It also has a byte that determines the maximum number of Animated Objects.

 

Format of the object file

The file encryption

The first obstacle to overcome is the fact that most object files are encrypted. I say most because some of the earlier AGI games were not, in which case you can skip to the next section. Those that are encrypted are done so with the string "Avis Durgan" (or, in case of AGDS games, "Alex Simkin"). The process of unencrypting the file is to simply taken every eleven bytes from the file and XOR each element of those eleven bytes with the corresponding element in the string "Avis Durgan". This sort of encryption is very easy to crack if you know what you are doing and is simply meant to act as a shield so as not to encourage cheating. In some games, however, the object names are clearly visible in the saved game files even when the object file is encrypted, so it's not a very effective shield.

 

File format

Byte  Meaning
 ----- -----------------------------------------------------------
  0-1  Offset of the start of inventory item names
   2   Maximum number of Animated Objects
 ----- -----------------------------------------------------------
 

Following the first three bytes as a section containing a three byte entry for each inventory item all of which conform to the following format:

Byte  Meaning
 ----- -----------------------------------------------------------
  0-1  Offset of inventory item name i
   2   Starting room number for inventory item i or 255 carried
 ----- -----------------------------------------------------------
 

where i is the entry number starting at 0. All offsets are taken from the start of entry for inventory item 0 (not the start of the file).

Then comes the textual names themselves. This is simply a list of NULL terminated strings. The offsets mentioned in the above section point to the first character in the string and the last character is the one before the 0x00.

 

Sources

 

See Also