Mission Files for Trieres.
Introduction
Each mission in the Trieres game is defined by a 'mission' file (typically with the extension ".mis").
These are simple text files that are stored in the 'missions' directory.
Syntax
A mission file consists of a number of 'records'. Each record consists
of a keyword followed by a bracketed set of commands - one to a line.
eg. This is an enemy ship record:
ENEMY
{
NAME "1st Athenian Squadron"
SHIP_TYPE "Fast Athenian Trieres"
NUM_SHIPS 30
FORMATION LINE_ABREAST
POSITION 0 0
HEADING 180
RIGGING DOWN
}
To aid readability, you can use blank lines and have comments that
start with a '#' character. All symbols can be in upper, lower or
mixed case (although for clarity, they are always in UPPERCASE throughout
this document).
You can have as many of each kind of record as you like (although in the
case of the 'EYEPOINT' record, only the last one in the file will be used).
There are currently four kinds of record:
- ENEMY -- Sets up a formation of enemy ships.
- FRIEND -- Sets up a formation of friendly ships.
- ISLAND -- Places an island, reef or sand-bar.
- EYEPOINT -- Sets up the initial camera position for the mission.
- PERFORMANCE_DATA -- Use this if you want to use non-default
ship's performance data.
ENEMY and FRIEND records.
Both kinds of record consist of the same set of commands:
- NAME "{string}" -- sets the name of the formation. This can be used
in the game to select or view all of these ships at once.
- SHIP_TYPE "{string}" -- sets the type ship used in this formation. This
string has to match the one in the performance data file used for
this mission. If you omit this record then the "default" performance
data will be used for this ship type.
- NUM_SHIPS {integer} -- sets the number of ships in the formation.
Default is just one ship.
- FORMATION {type} -- sets up the formation that the ships are initially
in. Can be one of:
- LINE_ABREAST -- The ships are set up side-by-side.
- LINE_AHEAD -- The ships are set up nose-to-tail.
- CIRCLE -- The ships are in a defensive circle, facing outwards.
- BLOCK -- The ships set up in a roughly square formation.
- ARROWHEAD -- The ships set up in an arrow head formation.
Default is line abreast.
- HEADING {angle} -- The direction the formation of ships is facing.
Default is due North (0 degrees).
- POSITION {float} {float} -- The (X,Y) coordinate of the center of the
formation (in meters).
Default is due (0,0).
- SPAN {float} -- The distance between ships in formation.
Default is to pack them at a 'sensible' distance for that formation.
- RIGGING {type} -- Determines how the ships have their rigging set up.
The alternatives are:
- DOWN -- The mast is down and there is no sail (this is the default).
- UP -- The mast is up but the sail is furled.
- SAIL -- The mast is up and the sail is unfurled.
ISLAND records.
Each record positions a single island or other landscape feature.
Commands allowed within this record are:
- MODEL "{filename}" -- The name of the 3D model (from the 'models'
directory) - note that the filename is in
double-quotes. Default is "island.ac".
- HEADING {angle} -- The direction the island is "facing" (or the
amount by which the model is rotated before
we place it). Default is due North (0 degrees).
- POSITION {float} {float} -- The (X,Y) coordinate of the center of the
island model (in meters). Default is due (0,0).
EYEPOINT record.
This record tells the game where to place your eyepoint (the 'camera')
at the start of the mission.
Commands allowed within this record are:
- HEIGHT {float} -- The height of the eyepoint above the ocean.
Default is 400m.
- POSITION {float} {float} -- The (X,Y) coordinate of the eyepoint
(in meters). Default is (0,0).
- LOOKAT {float} {float} -- The (X,Y) coordinate of a point on the
ocean where the eye is looking initially (in meters).
Default is (0,-400).
PERFORMANCE_DATA record.
Use this record if you want to use ship performance data other than
the default settings.
There is only one command allowed in this record:
Starting a Mission.
Normally, you start Trieres with the 'trieres' command and pick missions
from the menu. However, for testing, it's more convenient to use the
underlying 'start_trieres' command with the name of the mission file on
the command line.
start_trieres my_mission.mis
Alternatively, you can add your mission to the mission menu by appending
it's name to the 'missions/missions.dat' file. This consists of nothing
more than a list of filenames and a description of the mission as a single
line of text in double-quotes:
eg:
my_mission.mis "A mission I just wrote"
naupactus2.mis "The Battle of Naupactus II"
cyzicus_A.mis "The Defense of Cyzicus (you play Mindarus)"
cyzicus_B.mis "The Defense of Cyzicus (you play Alcibiades)"