Mapfile Syntax
The mapfile format is used to define the size and layout of a table for the UltraPool game. The first line gives some information about the file and the rest of the file is the map drawn out in specially formatted ASCII art.
The first line:
numRows numCols resolution
numRows is the number of rows in the map specified by the file.
numCols is the number of columns in the map specified by the file.
resolution is the width and height in pixels of the block represented by each character.
The rest of the file:
This is the part of the file that contains the map itself. The map is surrounded by a border of * characters and these are not included in the number of rows or columns defined on the first line of the file. Blank locations in the map are denoted by a _ character. It is often easiest to use the number of rows and columns to make a box of _ characters surrounded by * characters and then modify it to contain some of the other allowed characters. The following are allowed characters:
- 'P' - represents a Pocket at that location.
- 'R' - represents a Reflecter at that location.
- 'B' - represents a Bumper at that location.
- 'G' - represents a Gravity Well at that locaton.
- 'g' - represents a Repulser at that locaton.
- '+' - represents an Enlarger at that location.
- '-' - represents a Shrinker at that location.
- '1' through '9' - represent a ball at that location for the corresponding player.
Many of the symbols can be combined in blocks to form larger versions of the same thing; these include Pockets and the status effects (Reflecters, Gravity Wels, Enlargers, and Shrinkers). For instance, a 2x2 block of the symbol 'R' would represent a single Reflecter that takes up that entire 2x2 space on the board. Balls (that is, symbols '1' through '9') cannot be made into blocks this way and are instead treated as many individual balls placed next to each other. If you define more players in the mapfile than the config file or vice versa, the smaller of two numbers will be used.
Example:
8 8 16
**********
*PP______*
*PP______*
*________*
*_______R*
*___G____*
*________*
*_______2*
*1______2*
**********
Would look like: