small ai logo

Adventure International

Gfx File Format (recent)

Gfx File Format

The Gfx file format is a very simple format, designed to easily be ripped from the original files, to easily be parsed by the interpreter and also to be human readable as much as possible!

The file is a list of drawing commands with parameters. Each command is seperated by a newline.

Blank lines and lines starting with a '#' should be ignored!

The Commands are:

PICTURE <n>
Defines the start of picture <n>. The picture data runs until the next PICTURE command or the end of the file (whichever comes first!)
BGROUND <colour>
This command should immediately follow a PICTURE command. Sets the background colour to <colour>
MOVE <x>,<y>
Moves the graphics pointer to co-ordinates <x>,<y>.
DRAW <x>,<y>
Draws from the graphics pointer to co-ordinates <x>,<y>.
FILL <colour>,<x>,<y>
Flood fills with colour <colour>, starting from co-ordinates <x>,<y>.

In an attempt to modernise the ScottFree interpreters, there is an XML version of the above, it is very similar in design, An example from The Golden Baton:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE game SYSTEM "game.dtd">
<game name="The Golden Baton">
<picture id="1" bground="black" fground="white">
    <move x="22" y="191"/>
    <draw x="24" y="173"/>
    <draw x="26" y="158"/>
    <draw x="26" y="134"/>
    <draw x="22" y="119"/>
    <draw x="25" y="115"/>
    <draw x="34" y="116"/>
    <draw x="42" y="113"/>
    <draw x="48" y="114"/>
    <draw x="52" y="116"/>
    ...
</picture>
</game>

The DTD for the XML format is:

<!ELEMENT game (picture)>
<!ATTLIST game name CDATA #REQUIRED>
<!ELEMENT picture (move,fill,draw+)>
<!ATTLIST picture id ID #REQUIRED>
<!ATTLIST picture bground CDATA #REQUIRED>
<!ELEMENT move (EMPTY)>
<!ATTLIST move x CDATA #REQUIRED>
<!ATTLIST move y CDATA #REQUIRED>
<!ELEMENT fill (EMPTY)>
<!ATTLIST fill c CDATA #REQUIRED>
<!ATTLIST fill x CDATA #REQUIRED>
<!ATTLIST fill y CDATA #REQUIRED>
<!ELEMENT draw (EMPTY)>
<!ATTLIST draw x CDATA #REQUIRED>
<!ATTLIST draw y CDATA #REQUIRED>