<sect1 id="xsokoban-format">
<title id="xsokoban-format.title">The XSokoban format</title>
<para>
The maps of the levels are stored in XSokoban format, which consists of the following
elements:
</para>
<informaltable>
<tgroup cols="2">
<thead>
<row><entry>Character</entry><entry>Meaning</entry></row>
</thead>
<tbody>
<row><entry>#</entry><entry>Wall</entry></row>
<row><entry><emphasis>(space)</emphasis></entry><entry>Empty square</entry></row>
<row><entry>.</entry><entry>Goal square</entry></row>
<row><entry>$</entry><entry>Gem on an empty square</entry></row>
<row><entry>*</entry><entry>Gem on a goal square</entry></row>
<row><entry>@</entry><entry>Start position of the keeper on an empty square</entry></row>
<row><entry>+</entry><entry>Start position of the keeper on a goal square</entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
Here you see an example, which is the first level of the Microban collection:
</para>
<para>
<screen>
####
# .#
#  ###
#*@  #
#  $ #
#  ###
####
</screen>
</para>
<para>
After the map additional information about the map may follow (which are not
part of the original XSokoban format).
Note that all keywords are not case sensitive.
The author of the map can be specified, by adding a line beginning with
<quote>Author: </quote> and the the name of the author.
An email address of the author may be added after the authors name, enclosed in
<quote>&lt;</quote> and <quote>&gt;</quote> or <quote>(</quote> and <quote>)</quote>.
There must be at least one space between the author's name and the email address.
If more than one author wrote the level, other authors are added by separating them
with a comma.
An example would be:
</para>
<para>
<screen>
Author: Green W. Gem &lt;gem@sokoban.gem&gt;, Blue Stone (stone@sokoban.gem)
</screen>
</para>
<para>
You can also specify the homepage, where the level can be downloaded.
Just add a line beginning with <quote>Homepage: </quote> after the map and
add the address of the homepage:
</para>
<para>
<screen>
Homepage: http://www.sokoban.gem/~gem/level.html
</screen>
</para>
<para>
Analog a copyright message can be added, by starting a line with <quote>Copyright: </quote>
</para>
<para>
<screen>
Copyright: (C) 1998
</screen>
</para>
<para>
A difficulty can also be specified, by by starting a line with <quote>Difficulty: </quote>.
The value given must be in the range 0 to 10.
The meaning of the value is:
</para>
<informaltable>
<tgroup cols="2">
<thead>
<row><entry>Difficulty</entry><entry>Meaning</entry></row>
</thead>
<tbody>
<row><entry>0</entry><entry>Trivial</entry></row>
<row><entry>1</entry><entry>Very easy</entry></row>
<row><entry>2</entry><entry>Easy</entry></row>
<row><entry>3</entry><entry>Easy to medium</entry></row>
<row><entry>4</entry><entry>Medium</entry></row>
<row><entry>5</entry><entry>Medium to hard</entry></row>
<row><entry>6</entry><entry>Hard</entry></row>
<row><entry>7</entry><entry>Very hard</entry></row>
<row><entry>8</entry><entry>Very hard to nearly impossible</entry></row>
<row><entry>9</entry><entry>Nearly impossible</entry></row>
<row><entry>10</entry><entry>Impossible</entry></row>
</tbody>
</tgroup>
</informaltable>
<para>
If the specific map has a name, it will be given in a line starting with <quote>Name: </quote>.
</para>
<para>
<screen>
Name: A wonderful map
</screen>
</para>
<para>
You can add additional information by adding lines starting with <quote>Info: </quote>.
There can be more than one info line.
Lines which are not recognized are simply ignored.
Lets look at a complete example:
</para>
<para>
<screen>
####  
# .#  
#  ###
#*@  #
#  $ #
#  ###
####  
Author: David W. Skinner &lt;sasquatch@bentonrea.com&gt;
Homepage: http://users.bentonrea.com/~sasquatch/sokoban/
Copyright: (C) 2000
Name: Level 1 of 155 from collection Microban
Difficulty: 5
Info: The first information.
Info: The second information.
This line will just be ignored.
And so will this.
</screen>
</para>
</sect1>
