Map

Map structure and file format.

Table of Contents


This is the initial map design. It is very limited and may require redesigning at a later date after discussion of the map features to be supported.

Wrapping

If a map does not wrap, a player may fly off the edge of the map. When this happens, they fly back on a second or so later as per REQ_MAP_NOWRAP.

Map File Format

Most of the map is defined in a single text file as per REQ_MAP_TEXT. This text file defines the layout and properties in an easily editable manner. This way, no special software is required by the end user to make their own maps.

Lines beginning with a semicolon are comments in the map settings file and are ignored by the program.

Map File Sections

The settings file is separated into sections as illustrated by the Example Map Settings File.

Map Sections
Name Definition
(global) Global settings affecting the map. Name, author, version, players supported, wrapping.
layout ASCII representation of the map using 1 character per tile. Each character used is mapped to a type with some associated settings in the key section. The layout end is signified by a blank line.
key Maps ASCII characters to logical types and may set some miscellaneous properties such as whether or not the tile is able to be damaged.

Map File Keywords

Within each section settings and properties are defined by a simple keyword value syntax. The first word of each line is the keyword and the value is interpreted depending upon what the keyword is.

Map Keywords
Name Section Definition
name (global) The name of the map. Maps are displayed by name in a list to the user when they are selecting one.
author (global) The name of the author or authors. This should include contact details.
version (global) The version string. There is no particular format required. This is more for the benefit of the author to quickly identify the version of the file.
players (global) The number of players this map supports. This can be a range of the form min-max (i.e. two numbers separated by a dash).
wrap (global) A boolean defining whether or not the map is intended to be wrapped end-to-end when played. See Wrapping.
character key Sets the character as the context for the next set of properties to be read.
behaviour key Sets the behaviour of this tile to one of a predefined set which includes underground, surface, water, hanger, base and gun.
graphics key The string defining the static image or animation to be used by this tile. This is the stem of an image file or set of image files in the a game subdirectory.
explodable key Designates this tile as able to be exploded (e.g. with a bomb). Exploding a tile completely destroys it, removing it from the map. Depending on the type of tile, others around it may be affected (e.g. they might become rocky slopes down to the smouldering pit). This behaviour is defined by the behaviour keyword.
damagable key Designates this tile as able to be cosmetically damaged (e.g. by machine gun fire). There should be several 'damaged' versions of this tile's graphics defined. When this tile is damaged, its graphic will be replaced by one of the damaged versions.
owner key Sets who owns a particular resource. Hangers, bases and guns are examples of things which can be owned. A value of 1 means player 1, 2 means player 2, etc.
direction key

Example Map Settings File

; File format version 0.1

name     The Valley of DOOM!
author   Greg McIntyre <greg@puyo.cjb.net>
version  1

players  2
wrap     false

[layout]
..........................................................................................
..........................................................................................
..........................................................................................
.............................................................................G....B....H..
.h....b...g...................g...............................G........./^^^^^^^^^^^^===^^
^===^^^^^^^^^^^\...g......../^^^\......[+++++++++++]......./^^^^^^^^^^^###################
################^^^^^^^^^^^^#####^^^^^^^\....|..../^^^^^^^^###############################
#########################################~~~~~~~~~########################################
##########################################################################################
##########################################################################################

[key]

character #
behaviour underground
graphics grass-underground

character ^
behaviour surface
graphics grass-flat
explodable
damagable

character /
behaviour surface
graphics grass-slope-left
explodable
damagable

character \
behaviour surface
graphics grass-slope-right
explodable
damagable

character ~
behaviour water
graphics water-surface

character |
graphics bridge-support

character +
graphics bridge-segment
explodable
damagable

character [
graphics bridge-slope-left
explodable
damagable

character ]
graphics bridge-slope-right
explodable
damagable

character =
graphics runway

character h
behaviour hanger
graphics hanger-left
owner 1
direction left

character b
behaviour base
graphics base
owner 1

character g
behaviour gun
graphics aa-gun
owner 1

character H
behaviour hanger
graphics hanger-right
owner 2
direction right

character B
behaviour base
graphics base
owner 2

character G
behaviour gun
graphics gun
owner 2

Copyright (c) 2002-2003, Greg McIntyre
SourceForge