Home and Links
 Your PC and Security
 Server NAS
 DVD making
 Raspberry Pi
 PIC projects
 Other projects
 Next >>

Crimson Fields battle file definitions

CF file defn.


Each battle is (almost) totally defined by it's map file (.lev = 'level'). The 'lev files are 'compiled' versions of the ASCII map definition .src file. You can directly edit a .lev using the COMET utility.

COMET even allows you to 'save as' .src -- HOWEVER CoMET can't actually open or edit a .src file !
To 'compile' a map.src to a (playable) .lev you use the cfed command line tool, along with the (combat) Unit and (terrain) Tile definitions files. eg :-
cfed {map_name}.src --tiles ..\default.tiles --units ..\default.units
NOTE: If an 'error' (as opposed to a Warning) is encountered by cfed when compiling the .src, no .lev is generated !
CoMET will let you edit a .lev in a way that will generate a .src with an error, however CoMET will still let you save the modified .lev (and 'export' to an erroneous .src).

The units and tile files are in turn compiled versions of the Unit / Tile definitions file, together with the relevant .bmp icon file eg:-

mkunitset my_units.usrc my_units.units (path to bmp's)
(path to bmp's) is only needed if the icon files are not in the same folder as the source)
mktileset my_tiles.usrc my_tiles.tiles (path to bmp's)
(path to bmp's) is only needed if the icon files are not in the same folder as the source)

Modifying and adding, units and terrain

By modifying the units and terrain tile definitions, you have a huge range of options - indeed, a 'World War 1' terrain and unit set (together with appropriate maps) already exists

You can, in fact, add to the existing units (say to define a dozen or so different 'missile' types) as well as modify existing ones (fix the 'mines' which are simply stationary (or floating) rocks and stop trains moving faster than helicopters)   The same applies to the terrain tiles = you can add your own beach and dessert tiles etc. as well as adjusting the movement 'allowances' (eg giving some advantage to using 'dirt tracks' whilst reducing the massive speed advantage of using roads).   By modifying the units and terrain definitions you can 'fix' many of CF's 'sillies' (like tanks can't cross barbed wire, but (AA) tanks can climb mountains :-) )

You can 'recompile' the existing maps to use your modified units and terrain definitions and thus change how the game plays without needing to touch one line of C code !

Tweaking how the battle plays

The map.src contains an ASCII 'list' of the units, where they are and the terrain tiles. It also contains a list of the 'Events' for that battle.

CF Events is an extremely powerful system that allows a huge number of 'clever tricks' to be built into a map.
Whilst Events is typically just used for assigning reinforcements and 'victory points' (you need 100 to win and Events controls how you gain points - for example 100 for capturing the enemy HQ), it's actually able to 'watch' specific positions on the map and 'take action' (such as swapping one terrain tile - eg a building - for another - eg a destroyed building).
Events can 'award' you points for capturing (or holding onto) not just a building but in fact ANY tile - so 'occupy (the 5 tiles of) Stalingrad to win' is quite possible (Events would just award you 20 pts. for each tile one of your units (currently) occupies)

For details on how the Units, Tiles, Maps (and Events) are defined, see my following pages

The pages in this topic are :-

  + CF Unit icons

  + CF Terrain tiles

  + CF Maps - (definitions)

  + CF Events system - (definitions) == Latest changes (modified 2nd Jan 2018 17:10.)

Next page :- CF Unit icons