small ai logo

Adventure International

Game File Format

Game File Format

A game consists of a header of 14 values each apparently 16 bit

Line Offset Usage
0Unknown
1Number of items
2Number of actions
3Number of Nouns and Verbs (one list is padded)
4Number of rooms
5Maximum a player can carry
6Starting Room
7Total Treasures (*)
8Word Length (only seen 3,4 or 5)
9Time light source lasts. This counts down every time item 9 is in game. Brian Howarths games allow -1 for never run down. When it runs out the light item (9) is dumped in room 0 and a look done. Messages vary between interpreters and include things like 'Your light is flickering and dying' as well as 'Light runs out in %d turns'.
10Number of Messages
11Room you must put treasure in to score points. Not all games use the treasure system for scoring
12Unknown

All the number of something values are the last item to be read counting from 0. Thus 3 messages, means messages 0, 1, 2 and 3.

(*) This can be calculated in game. What happens if the number is wrong I don't know. I've found no games that it occurs in.

A game has 16 (maybe more) binary flags, and 8 (maybe more counters). A few later games seem to have 2 (maybe more) values to store location numbers in temporarily - eg Yoho spell in Claymorgue.

Following the header is a list of game actions. Each is of the form:

150*verb+noun
5 repeats of condition+20*value
150*action1+action2
150*action3+action4

Conditions

Condition Usage
1Item <arg> carried
2Item <arg> in room with player
3Item <arg> carried or in room with player
4In room <arg>
5Item <arg> not in room with player
6Item <arg> not carried
7Not in room <arg>
8BitFlag <arg> is set.
9BitFlag <arg> is cleared
10Something carried (arg unused)
11Nothing carried (arg unused)
12Item <arg> not carried nor in room with player
13Item <arg> is in game [not in room 0]
14Item <arg> is not in game [in room 0]
15CurrentCounter <= <arg>
16CurrentCounter >= <arg>
17Object still in initial room
18Object not in initial room
19CurrentCounter = <arg>

Actions

Action Usage
0Does nothing
1-51Print message 0-50. Some drivers add a space some add a newline.
52Get item <arg>. Checks if you can carry it first
53Drops item <arg>
54Moves to room <arg>
55Item <arg> is removed from the game (put in room 0)
56The darkness flag is set
57The darkness flag is cleared
58Bitflag <arg> is set
59The same as 55 (it seems - I'm cautious about this)
60BitFlag <arg> is cleared
61Death. Dark flag cleared, player moved to last room
62Item <arg> put in room <arg>
63Game over.
64Describe room
65Score
66Inventory
67BitFlag 0 is set
68BitFlag 0 is cleared
69Refill lamp (?)
70Screen is cleared. This varies by driver from no effect upwards
71Saves the game. Choices of filename etc depend on the driver alone.
72Swap item and item locations
73Continue with next line (the next line starts verb 0 noun 0)
74Take item <arg> - no check is done too see if it can be carried.
75Put item with item - Not certain seems to do this from examination of Claymorgue
76Look (same as 64 ?? - check)
77Decrement current counter. Will not go below 0
78Print current counter value. Some drivers only cope with 0-99 apparently
79Set current counter value
80Swap location with current location-swap flag
81Select a counter. Current counter is swapped with backup counter <arg>
82Add <arg> to current counter
83Subtract <arg> from current counter
84Echo noun player typed without CR
85Echo the noun the player typed
86CR
87Swap current location value with backup location-swap value <arg>
88Wait 2 seconds
89SAGA - draw picture <n> (actually <n+number of rooms>, as each Look() draws picture <room number> automatically)
Older spectrum driver - crashes
Spectrum Seas of Blood - seems to start Fighting Fantasy combat mode
90-101Unused
102+Print message 51-99

This is followed by the words with verbs and nouns interleaved. A word with a * at the beginning is a synonym for the word above. Verb 1 is GO, verb 10 is GET, verb 18 is DROP (always). Nouns 1-6 are directions.

This is followed by the rooms. Each room is 6 exits (north south east west up down) followed by a text string.

Then come the messages, stored as a list of strings.

Next come the items in the format item text then location. Item text may end with /TEXT/. This text is not printed but means that an automatic get/drop will be done for 'GET/DROP TEXT' on this item. Item names beginning with '*' are treasures. The '*' is printed. If you put all treasures in the treasure room (in the header) and 'SCORE' the game finishes with a well done message. Item location -1 is the inventory (255 on C64 and Spectrum tape games) and 0 means not in play in every game I've looked at. The lamp (always object 9) behaviour supports this belief.

A set of strings follow this. In order they match to each line of verb/noun actions, and are comments. The Spectrum and C64 tape system where the database is compiled into the program has no comments.

Finally three values follow which are version, adventure number and an unknown magic number.