|
|
map_name.csv
|
Each
map has it's own csv file that defines the map. Just like all
other csv files, this can be overriden. You just create a maps
directory under you scenario folder and place the map_name.csv
file there. You replace 'map_name' with the name of the map. All
maps have two versions, one high res and one low. The low versions
have all 3D objects removed unless they are historically significant.
For examples just look in the SDK folder on your CDRom and then
in the maps directory.
The
map csv file is based on the grayscale map the comes with every
map. The grayscale map is just a bit map with a value between
0-255 for each pixel. The maps are 2048x2048 pixels. The map designer
creates the grayscale and then takes all of the values that they
used and puts them in the map csv file to define them. It is a
good idea to seperate the values by at least 5 because we put
some oops code in to fix the values as the grayscale is loaded
in. If you can be perfect, you don't have to worry about this.
Since you can easily modify the grayscale and the csv files, you
can redefine the maps that shipped with the game. You can move
forests, although the terrain image will not move, you can redefine
defensive bonuses and movement speeds across different terrain
types. You can rename terrain. This does not give the freedom
of a map editor, but it's a start.
The
map_name.csv file is broken into four pieces. The first is the
map definition, basically defining all of the colors used in the
grayscale. The second is the ambient sounds. To do an ambient
sound we just place a terrain sprite at a specific location and
attach a sound file to it. Since this file is broken into two
pieces, there can't be any blank lines in either table. When the
first blank line is found, the engine assumes that the next table
has started. The next piece is the list of possible objective
sites, with the last piece being the start locations.
Column |
Explanation |
A:
Terrain |
This is the name that will show up in the toolbar
when a unit is on this grayscale value. It will be filled
in the $terrain variable. |
B:
Grayscale |
This is the value between 0-255 that this line
pertains to. |
C:
Move Rate |
This value is added to the formation movement
rate modifier and then multiplied by the base movement rate
of the unit to provide their current in game movement rate. |
D:
Density |
This defines how to fill in this grayscale value
with terrain sprites. All of our terrain features are filled
in dynamically during level load. The lower this number is,
the more dense the foliage will be filled in, the higher number
will be less dense. Basically you can think of this as a random
number. Every time a grayscale of this color is found, the
computer will pick a number between 1 and this number on how
many pixels to skip before it places another terrain sprite. |
E:
Visibility |
This is the distance in yards that you can see
through this terrain type. For example we have woods at 40.
That means that you can see 40 yards into the woods. Any units
more than 40 yards away would not be visible. |
F:
Def Bonus |
This is the defensive bonus that this terrain
gives to units on this terrain type. An entire unit is defined
as being on the terrain as the flag bearer. This is because
it would be crazy to calculate seperately for every man. It
would just use up too much cpu time. The defensive bonus is
a random number between 1 and 100. If that random number is
more than this def bonus number, a hit is made. If it is equal
to or less than, the target is missed. So the greater the
number here, the higher the defensive bonus. A value of 0
is no bonus. |
G:
Fatigue |
Every so many ticks (defined in tables.csv),
a fatigue check is made. When that check is made, if the unit
is marching, they will lose this many fatigue points. The
point system is defined in levels.csv. If the unit is running,
the fatigue penalty is taken from tables.csv. These are negative
numbers and are added to the fatigue value. If you want a
unit to get rested while marching over certain terrain, you
could put a positive number in here. |
H:
Can't Halt |
This defines those terrain types that units
are not allowed to stop on. A value of 1 means that units
cannot stop on this terrain. We use this for rivers and streams.
A value of 0 means that stopping is allowed. |
I-J:Sprite1-6
|
If the density value is filled in, then these
are the types of sprites that the level loader will use to
fill in the terrain. You can have up to 6 different types
to add some variety. These names come from the sprites.csv
file. |
K:
Draw Distance |
This value is in yards and defines how close
the camera has to be to this location to draw this sprite.
If you leave this blank the engine will handle this for you.
I don't believe we use this in any of our csv files, but the
code is still there if you wanted to use it. |
Sound
Table
Column |
Explanation |
A:
loc X |
This is the X coordinate of the sprite location. |
B:
loc Y |
This is the Y coordinate of the sprite location |
C:
dir X |
This is the X value of the direction unit vector. |
D:
dir Y |
This is the Y value of the direction unit vector. |
E:
Sprite |
This is the sprite name from the sprites.csv file. |
F:
Sound File |
This is the terrain sound to play at this sprite location.
This is how we do the ambient terrain sounds. This sound will
be constantly played at this location. This sound is from
the gamesounds.csv file. |
G:
Terrain |
This column is used for reference only and is not read in
by the game. |
Objectives
Table
When this map is used for OpenPlay, the game will randomly
choose between these locations for it's objective sites. Try to
place them at crossroads and in open fields, never in the woods.
Column |
Explanation |
A:
ID Names |
This is the name that will be displayed for this objective |
B:
X |
This is the X coordinate of the objective site. |
C:
Y |
This is the Y coordinate of the objective site. |
Start
Locations Table
When this map is used for OpenPlay, the game will randomly
choose between these locations for it's starting positions. You
need to create them around the 8 points of the compass and sometimes
in the center of the map. The game will randomly choose them.
Column |
Explanation |
A:
location |
This is the compass point that this location represents.
Valid values are (N,NW,W,SW,S,SE,E,NE,C), you can have more
than 1 for a specific point. Try to fill in as many compass
points as possible. |
B:
X |
This is the X coordinate of the objective site. |
C:
Y |
This is the Y coordinate of the objective site. |
|
|