Tables.csv
is where we threw everything that didn't have another home. We
really tried not to hardcode any values. We didn't do too bad
a job, but there are a lot of hardcoded values in the game. A
lot of times when we had something new to code, we created a table
in tables.csv. This prevented us from hardcoding the values and
also provided a place to test the game with different sets of
numbers.
The
very first thing to notice of any table is the table name. That
is on the first row of the table in the first column. I will list
the tables in order here, but the program loads in the tables
by the table name, not by the order.
Note:
You can place comments between tables by not fill in the first
column. This goes for most csv files. As long as the first column
remains blank, the game will skip that line.
Table:
Morale
The
morale table defines how much morale is lost when 1 man is killed.
This morale loss only happens at certain percentages. Those percentages
are listed on the left side of the table. So morale is not lost
EVERY time a man is killed. Morale is only lost when a man is
killed and by that death the total percentage of men dead (vs.
the starting strength) falls to be equal to one of the percentages
listed in the left column.
Where |
Explanation |
Left
most column |
This is the percentage dead. This
is figured by taking the total dead and dividing by the total
starting strength of the regiment. This column should be in
ascending order. In the default table the first value is 5.
This means that when the reg has lost 5 percent of it men,
it will receive the first morale penalty from this table. |
Top
rows |
There are 2 top rows. The first
row is the experience value, the second row is the experience
label. These rows are not read by the game. What is important
to remember is that if you add new experience levels to the
game by modifying the levels.csv file, you must add
an equal number of columns here to reflect your change. |
Value
(min-max) |
By referencing the percent dead, then the experience
level of the regiment, you will find a value of type (min-max).
This is the min and max morale penalty that will be taken.
The game will pick a random number between and including these
values. |
Table:
Fatigue
The
fatigue table defines how, when, and how often a unit loses or
gains fatigue. Fatigue figures into numerous calculations throughout
the game, and it all starts here. It is important to note that
the base fatigue of Marching does not get the fatigue penalty
from this table, but from the map_name.csv file where it
takes into account the terrain that you are marching on. It is
interesting to note that only marching fatigue is affected by
terrain, if there unit is not marching, their fatigue is not directly
affected by terrain. How they are affected, for example running,
is that they are slowed down and therefore their already high
penalties for fatigue will come into play more often.
Where |
Explanation |
Left
most column |
These are the unit states, you should
never modify these because they cannot be changed by the modder.
They are hardcoded in the game and their order is as important
as their quantity. |
Points |
These are the number of points that
will be added to the fatigue value of the regiment. You can
put positive or negative numbers here, depending on how you
want this activity to affect fatigue. |
Seconds |
Every x seconds, the fatigue will be modified. |
Table:
Fatigue Run
The
fatigue run table defines the movement penalty associated with
running or charging at certain fatigue levels. It is important
to note that if you add new fatigue levels to the levels.csv
file, you must add those fatigue levels to this table.
Where |
Explanation |
Left
most column |
These are the fatigue levels, in
the exact order and with the exact name as found in the
levels.csv file. |
Effect |
This is the movement penalty that
will be applied to the movement speed of the unit while trying
to run or charge at the left fatigue level. |
Table:
Unit Morale Bonus
The
Unit Morale Bonus table defines how many morale bonus points one
unit gives another by being near that unit. Units (regiments)
feel much more secure by being around other units. No one wants
to be left alone. The radius, or the proximity, that one unit
has to be in relation to another unit is defined in the levels.csv
file. If the units are close enough, or within the radius, then
this table defines how many bonus points they receive. The morale
bonus is based on experience and the number of men.
Where |
Explanation |
Left
most column |
This defines the number of men in
the regiment giving the bonus. Any amount up to and including
the number on the left of the row, will use this row for the
bonus. |
Top
Rows |
There are 2 top rows. The first
row is the experience value, the second row is the experience
label. These rows are not read by the game. What is important
to remember is that if you add new experience levels to the
game by modifying the levels.csv file, you must add
an equal number of columns here to reflect your change. |
Values |
These are the number of points that
this unit gives as a morale bonus. Look up the number of men
on the left and the experience across the top to find the
correct bonus. |
Table:
Grades
The
grades table defines all of the grades that can be won by a unit.
The only grades that this does not include are those won by taking
objectives. When a unit causes another unit to reach the state
defined in the left column, they are awarded the points to their
grade and the morale bonus. The unit that is caused to be in that
state will lose the points in the grade column. Do not change
the left most column, the order is defined in the game.
Where |
Explanation |
Left
most column |
This defines the different states
that a unit can reach. One or more units will cause another
unit to reach this state. Do not change the order or names
of this column, as the order is defined in the game and is
expected to be as presented here. |
Grade |
These are the number of points that
will be awarded to the victorious units and taken away from
the defeated unit for reaching the state defined on the left.
Note that if more than one unit causes the defeatred unit
to reach that state, the points will be divided among all
the units that have a kill in the defeated unit. |
Morale |
This is the morale bonus that will
be received by the victorious units. Each unit causing the
state will receive the full morale bonus. |
Table:
Retreat
The
retreat table defines the percent chance that a regimental commander
will get scared and order a retreat on their own. If the reg commander
orders the retreat on their own, their officer will lose points
for not watching his men closely enough. If the brigade commander
calls a retreat before the regimental commander does, they will
not lose points.
Where |
Explanation |
Left
most column |
The are all of the morale levels
from the levels.csv file. If you modify the levels.csv file
and add or take away morale levels, then you must also add
or take them away from this column. |
Top
Rows |
There are 2 top rows. The first
row shows some comments, the second row is the experience
label. These rows are not read by the game. What is important
to remember is that if you add new experience levels to the
game by modifying the levels.csv file, you must add
an equal number of columns here to reflect your change. |
Value |
These values are the percent chance
out of 100 that the regimental commander will call a retreat
when that regiment FIRST reaches that morale level. There
will be one check that occurs whenever a unit changes morale
levels. |
Table:
Fallback
The
fallback table defines the percent chance that a regimental commander
will get scared and order a fallback on their own. If the reg
commander orders the fallback on their own, their officer will
lose points for not watching his men closely enough. If the brigade
commander calls a fallback before the regimental commander does,
they will not lose points.
Where |
Explanation |
Left
most column |
The are all of the morale levels
from the levels.csv file. If you modify the levels.csv file
and add or take away morale levels, then you must also add
or take them away from this column. |
Top
Rows |
There are 2 top rows. The first
row shows some comments, the second row is the experience
label. These rows are not read by the game. What is important
to remember is that if you add new experience levels to the
game by modifying the levels.csv file, you must add
an equal number of columns here to reflect your change. |
Value |
These values are the percent chance
out of 100 that the regimental commander will call a fallback
when that regiment FIRST reaches that morale level. There
will be one check that occurs whenever a unit changes morale
levels. |
Table:
Elevation
The
elevation table defines accuracy bonuses for units that are at
a higher elevation and accuracy penalties for units that are at
a lower elevation. These values are added to whatever other accuracy
bonuses or penalties they may have.
Major
note: Right below the table name (Elevation) is the number of
(rows-cols). If you change either of these values, you must change
this value to reflect the correct amount, otherwise the game will
not read in all of the data.
Where |
Explanation |
Left
most column |
This is the elevation difference
in yards. This column is ascending so that the smallest difference
is at the top. |
Top
Rows |
Across the top is the distance the
targets are away from each other in yards. |
Values
(bonus-penalty) |
The values show the bonus and penalty
for each elevation difference and distance combination. This
value is added to or subtracted from whatever the current
accuracy value is. The higher unit will get the bonus while
the lower unit will get the penalty. |
Table:
Area Mod
This
table is used by the AI to determine where they want to attack.
It is used by the Corps and Army Commanders to evaluate the field
of battle during the initial strategy planning.
It is broken into different sections for each type of evaluation
and each type of commander style.
Where |
Explanation |
Left
most column |
These are the commander styles.
If you add new styles to the levels.csv file, then
you must also add them here. In the base table 0 is the most
cautious personality and 4 is the most daring. |
Top
Rows |
The top row list the different types
of situations that the AI will evaluate. Do not change this
row at all, as it is expected in this format by the game. |
Values
(min-max) |
These values represent the range
of getting a random number. This random result will determine
how many subordinate units this commander will commit to the
particular rows type of attack. |
Table:
Capture
I
must say that it is to my surprise that this table is not used
in the game anywhere. I just did a search on the code and it's
just not used. I guess that we did this some other way. How about
that :)