< Adventure language Index Tools and actions >

Game Header

Each game has one game header described by the Game item, which must be the first item in each adventure code. It has no name, which is indicated by writing Game <>.

Game

Item typeGame
DescriptionThis item contains information that is relevant for the whole game. Mainly, it describes how the game interface looks like.
Action-
Condition-

KeyTypeDefaultDescription
header[byte][41 44 56]The header to identify adventure game files. Never change!
versionbyte03The grammar version number. Never change!
namestringThe name of the game. It is displayed as the main window title.
authorstring""The author of the game. It is displayed in the info window.
copyrightstring""Copyright info for the game. It is displayed in the info window.
infostring""Additional info for the game. It is displayed in the info window.
iconfile""File name of the game icon. It is used as the main window icon.
lookfile""The look used for the game.
languagestring""The language used in the game.
buttonSizepoint(32,32)The image size of menu buttons and of tool cursors. (see also Looks)
menuSceneScenes<>A scene that is used as menu.
toolShortbytesThe style of the scene toolbar; see definitions for values.
toolRowsint1The number of rows of buttons in the toolbars.
sizepointThe size of the scene window.
textLinesintThe number of lines for the text window.
sceneInfoText<>Position, size, style and font to display the region information inside of the scene. (other keys of the Text item are ignored)
sceneTextText<>Position, size, style and font to display textual information inside of the scene. (other keys of the Text item are ignored)
sceneBackcolour(0,0,0)The default background colour of the scene window.
inventoryBackcolour(0,0,0)The background colour of the inventory window.
objectSizepoint(0,0)The maximum size of objects in the inventory. If one value is 0, no inventory is used.
objectBorderpoint(0,0)Size of border around objects in the inventory.
inventoryBorderpoint(0,0)Size of border around all objects in the inventory.
objectToolbarpoint(0,0)The maximum size of the selected object in the toolbar. If one value is 0, the value of objectSize is used. If one is less than 0, no object window is used.
dialogBorderpoint(0,0)Size of border around the dialog view.
dialogTextBorderpoint(12,12)Size of border around the text in dialog view.
dialogLineSpaceint6Space between lines in the dialog view.
dialogAnswerAlignbyte1The alignment of answers in the dialog view; see definitions for values.
maxPointsint0The maximum number of points. The points are displayed in the toolbar. If 0, no points are used.
imageBufferint0The size of the image buffer.
imagePath[file][]List of directories to load images from.
mediaPath[file][]List of directories to load media files from.
palettefile""The palette file with the colours for the game.
resources[file][]The resource files containing resources for the game.
textMaps[file][]The text mappings to resolve abbreviated text.
timerResolutionint0Resolution of the central timer in ms.
sceneScrollpoint(50,50)The minimal distance between scene border and character border in percent that causes the scene to scroll if necessary.
fontFiles[file][]Names of font files to be installed during the game.
dialogNamestring"You"The default name displayed in the dialog view for the player.
inventoryImageImages<>A background image for the inventory.
dialogImageImages<>The image that is displayed in the dialog window representing the player. This image is changed by the ChangeFile action.
dialogImageTopboolFAlignment of the images in the dialog window. True for top or else for side.
tools[Tools][]The tools for the scene window.
inventoryTools[Tools][]The tools for the inventory window.
inventoryObjects[Objects][]The objects that are in the inventory when the game starts.
firstSceneScenesThe scene the game starts with.
initActionActions<>An action that is executed once when the game starts. May be used for initialisation.
eachActionActions<>An action to execute after each action the player causes by a mouse click. Be careful, this action is executed quite often!

Locating Data Files

Files for images and media used in an adventure game are stored in the file system. There are three kinds to refer to a data file:

  1. absolute: If the file name starts with a drive letter followed by a colon, this path is used to load the file. (This is unusual, but permitted.)
  2. relative: If the file name is not absolute, it is appended to the image or media path, depending on the file type. If the path is not set, the directory of the adv-file is used.
  3. absolute on a CD: If the file name is absolute and the drive letter is a wildcard (*), the wildcard is replaced by the letter of a CD-drive. If there are several CD-drives, all are searched for the file.
These three kinds of locating data files can be arbitrary mixed in a game. The image and the media path can also be of any of these kinds.

Other files like resource files, text mappings, fonts, and looks are searched in the game directory or by an absolute path including CD-drives. Fonts and looks may also be located in the application directory.

Images and text mappings may be stored in resource files. When locating these files, the resource files are searched before the file system.

Text Mappings

Instead of writing the text for a game in the main code, abbreviations may be used for all item keys of the type string. An abbreviation is distinguished from a normal string by starting with an @ sign. The meaning of an abbreviation is defined in a text mapping. Unlike defines, these abbreviations are expanded at run-time, not at compile-time.

Abbreviations keep the source code more clear, make it easier to create different language versions for a game, and allow to use the same text at different places without retyping it. In addition, the text mappings may be stored and compressed in resource files.

A text mapping is a simple text file with the file extension adm. Each line is one mapping from an abbreviation (without @) to a string. The abbreviation is separated from the string by an arbitrary number of spaces and/or tabs.

Timers

ADePT uses a central timer with a global time resolution that is defined in the Game item. If the time resolution is 0, no timer is used. The Timer items and the animation timings may use any time interval, but time events only happen according to the global timer resolution. Nonetheless the timing will be overall synchronous. This means if e.g. the time resolution is 200ms and the timing is 250ms, the time events will occur 4 times a second but at one interval of 400ms and three of 200ms. Time intervals may not be smaller than the time resolution. If the timer resolution is 200ms, but the timing is 100ms, only five time events occur per second. A time resolution of 1ms guarantees accurate timing (if the system supports this timer resolution) but may consume more system ressources. A resolution of 40ms (25Hz) or 50ms (20Hz) is most common for animations. Games with language version 1 or 2 use 25ms as time resolution.

Colour Palette

The adventure engine is designed for true colour resolutions that don't need explicit colour handling. It has only a very simple support for lower resolutions like 256 colours.

If you want your game to support 256 colours, you should use only the windows system colours in the look of the game. In addition, all images for scenes, regions, and objects must use colours from a 256 colour palette (but can use different palettes, e.g. their own 16 colour palettes). This 256 colour palette has to be defined in a 256 colour bitmap, which is specified as the palette key in the Game item. Like all image files, the bitmap with the palette will be looked for in the image directory.