ftmap2 reads a fomatted file from the standard input and produces an interlaced GIF map of the data, according to the parameters contained within the file. ftmap does text clash management so that the labels on the map are positions for the best readability. ftmap also does sophisticated color compression so that multi-color maps can be produced within the limited 256 color palette of a GIF image.
ftmap2 -i image -f example.png < example.ft
Produces a PNG map in the file example.png using the data in the file example.ft
-d debug mode currently draws boxes for the text clash resolution system and various ugly messages
-f followed by name of the resulting PNG map file
-g add a reference grid to the map axes, this is set at 10 game units
-i followed by name of directory to search for the game object images, this allows several sets of images to be used and managed
-l draw a legend of the game objects, this can take up a lot of room and is not subject to rigorous clash detection with existing text
-r followed by name of the resource file containing color definitions for the main elements of an ftmap, *ignored* if -b specified
-t if object tracks are enabled then plot them as Real Thrust vectors, not as Full Thrust cinematic movement plots
-v verbose mode it tells you whats its doing on
-w if background image is enabled, wallpaper/tile the background image instead of stretching it to fit
OK, now for the format of ftmap's data file, Generally blank lines are not tolerated and comments etc. are not supported.
The first section defines the map parameters
<1> Title
<2> Background gif filename or '-' to use a plain background
<3> object tracks flag - 1 on, 0 off
<4> min x co-ord (in game units)
<5> min y co-ord (in game units)
<6> max x co-ord (in game units)
<7> max y co-ord (in game units)
<8> number of pixels per game unit
Numbers are reference to the fields described and should not be included in actual file
<1> FT Example Map
<2> -
<3> 1
<4> -15.0
<5> 0.0
<6> 85.0
<7> 70.0
<8> 10.0
This section has a fixed length format and thus requires no delimiter for the next section following. There next follows a section defining the available game object classes and the images to use.
If using Field <3> object tracks on, their plotting varies according to the -t program flag being supplied or not.
If using the -t option the Real Thrust object tracks is displayed as a vector along the current course (which must be specified in degrees not clock facing) with a magnitude of the current velocity, it shows where the ship will be next turn, if no thrust is applied.
This is the reverse of the cinematic movement object tracks, which shows where ship moved from for the current turn.
These maps show the way that cinematic and vector movement are drawn on the plot.
This section defines sprites to use for the map. For a series of maps these don't change much.
<1> The game sprite CLASS NAME
<2> The file name of the PNG used for the sprite (pointing in direction 12)
<3> Scale factor for displaying the sprite (normally scale down < 1.0 )
<4> Legend flag ( 1==list class in legend, 0==don't list class in legend)
Numbers are reference to the fields described and should not be included in actual file
<1> Hyperion
<2> ea_bc.gif
<3> 1.0
<4> 1
This is repeated for each sprite class, with a line containing a single * <5> indicating the end of the sprite section. There then follows a section describing each ship or other game object (fighter, missile, asteroid).
<5> *
<1> Name (can contain white space)
<2> game sprite CLASS NAME exact match to <1> in [Sprite Section])
<3> x co-ord
<4> y co-ord
<5> heading (1-12) or vector course (1-360)
<6> facing (1-12)
<7> velocity in MU
<8> change of heading delta (S=+ve, P=-ve e.g. p3 = -3, S2 = 2)
Numbers are reference to the fields described and should not be included in actual file
<1> NERGAL
<2> Hyperion
<3> 14.2
<4> 28.3
<5> 8
<6> 8
<7> 9
<8> 0 *
This is repeated for each class, with a line containing a single * indicating the end of the section.
Field <5> is in clock facing (1-12) for cinematic movement and course in degrees (1-360) for real thrust movement.
Field <8> applies to cinematic movement only and is ignored if using the Real Thrust -t flag, although a dummy value must be present in the file (use 0).
Battle of Axanar
background.png
1
0.0
0.0
100.0
100.0
20.0
Constitution
Constitution.png
0.3
1
Ares
Ares.png
0.3
1
*
USS Ares
Ares
40
20
3
3
10
0
USS Enterprise
Constitution
40
60
3
3
10
-3
*
The game object images are stored in individual PNG files. One image per file. The default orientation of the file should be with the game object facing the 12 o'clock position
Sprites can be any PNG image with a transparent background
Full color PNG images are supported where the image background is transparent.
The images can be any size but typically not too big (100x100). The images are scaled according to the scaling factor in the data file The images can be of any game object a ship, fighters, missiles, asteroids etc.
The -r file for ftmap allows the use of a separate resource file which controls the appearance of the ftmap. The resource file is made up of sections denoted by '[' ']' i.e. [Color] and within a section a resource name is allocated a value. The section and resource names are case insensitive but must be spelt correctly. A resource name has a following '=' and then its values separated by white space.
Some options can only be controlled from the resource file such as fading the background image around game objects
ftmap only supports a Color section at this time. The resource file can contain comments beginning with ';' on a separate line or the end of a line. The example shows the current colour resources and what they apply to.
;******************************************************************************
; ftmap color resource file
;
; The section identifier [Color] must be present & spelled correctly
;
; Resource names are case insensitive & must be spelled correctly
; The '=' must follow the resource names.
;
; Color values are given as red blue and green values between 0 - 255
; separated by white space
;
;******************************************************************************
;
[Color]
;------------------------------------------------------------------------------
; r g b
; 0 - 255 comments
;------------------------------------------------------------------------------
backgroundColor = 0 30 0 ; background MUST always be specified first
titleTextColor = 0 255 0 ; map title
axesColor = 0 200 0 ; x & y axes
axesgridColor = 0 100 0 ; axes grid
axesTextColor = 0 220 100 ; axes text
labelTextColor = 0 200 96 ; label text
leaderColor = 0 150 96 ; leader line from label
courseColor = 0 255 100 ; game object course tracks
locusColor = 200 255 100 ; accurate centre of game object
legendColor = 0 200 0 ; legend box
legendTextColor = 0 200 100 ; legend text
;------------------------------------------------------------------------------
; Fades background under ships, labels and legend
;
; true fade is on and next value is opacity
; false fade off
; comments
;------------------------------------------------------------------------------
fadeLegend = true 33 ; legend fade on/off opacity
fadeShips = false 10 ; ship fade on/off opacity
fadeLabels = true 90 ; label fade on/off opacity
;******************************************************************************
backgroundColor is a special resource as it MUST be the first color in the file so that the image has a fallback colour if there is no background image.
The fadeLegend etc arguments are the only way to control fading the background under objects for legibility.
The ftmap data file format is optimised for computer reading but is difficult for humans to read. Typically a game will produce reports which can be parsed and formatted into the correct data file format by tools such as ChatGPT or excel, as a last resort you can type in the data yourself.
Typically the game header section in the data file doesn't change and is stored in a separate file that the text processing filter includes into the final data file.
Typical procedure for producing a map is thus.
Edit the header file to change the turn title etc.
Edit the report file to conform to the text filter program, this may require fiddling with information so that is all looks the same. As most people seem to do this manually there are often formatting mistakes. Its a trade off between a simple text parser and a complicated one that can cope with various idiosyncrasies in the report format. This is the bit *you* have to figure out
Produce the map using ftmap2 and the data file. if it core dumps its probably a problem with the data file, so check that first.
ftmap2 -r ftmap.ini -i image -f turn2.png < turn2.ft
View the image and check for funnies, repeat from 2) to eliminate errors.
This is generated from ftmap2 its a large scaled up 2K image (download to see full resolution)
The map contains coloured sprites, name labels, a background image and a grid with axes for spatial reference.
The last turn data for each ship shows it's thrust movement and turn path.
The background is lightly masked for each ship and more so for the labels so it's easier to read.
It may be an old C program but the results are great!
If the pixel per game unit value is large (>15) images produce can break up the ship images if they are small. AFAIK this is a rounding error problem in the image library. You can produce huge maps if you use larger sprites (see above 2K example)
Problems in the data file format, if the syntax is off it will throw an error
Legend often covers up map data, don't use it in these cases or reduce the content with the flag in the data file or generate a separate legend tile for the game.
ftmap2 is vibe coded from the original version.
This program is freeware and can be distributed as long as you don't claim its yours or try to make money out of it.
PNG support
Better data file error handling
fade parameters in the resource file