This is the mail archive of the xconq7@sourceware.cygnus.com mailing list for the Xconq project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Supply


The supply rules have evolved in my head into this over the weekend:

Supply Rules Draft #2

Supply lines of limited and unlimited length. Distribution of
supplies takes place in material-specific _supply zones_, areas of
suitable, contiguous cells over and into which supply can be traced.
Supply zones are established by establishing supply lines outwards
into surrounding terrain from all units with a non-zero
supply-strength property. Hostile terrain, enemy units or enemy
control of a cell can cause a supply line to deteriorate to the point
of being cut. Any number of units can share supplies in a supply
zone.

GDL Keywords

Table: supply-out-threshold u m -> n

If unit u has more than n of material m it can act as a supply source
in a supply zone, the excess materials being distributed among the
consumers, if any. Defaults to -1 which disables supplying. Note that
a unit can be both a producer and a consumer in a supply zone.

Table: supply-out-max u m -> n

The maximum amount of material m that a unit of type u can give out
to other units in its supply zone in a given turn. Defaults to -1
which means an unlimited amount.

Table: supply-out-weight u m -> n

If there is less demand than supply for material m in a supply zone,
these relative weights are used to determine how much a producer of
type u should give out material of type m. Defaults to 1.

Table: supply-strength u m -> n

The minimum strength of a supply line of material m when it is traced
from or through a cell containing a unit of type u. Supply-strength
means the ability to establish supply lines. This property applies
equally to producers and consumers (since there is no real
distinction between the two). Supply-strengths of multiple units
never reinforce each other; the maximum is used. Nearby enemy units,
or enemy control of the cell the unit is in, have no effect on this
value. Defaults to 0.

Table: supply-strength-terrain-effect u t -> n%

The effect of terrain of type t on the supply-strengths of a unit of
type u. Defaults to 100.

Table: supply-capacity-threshold u m -> n
Table: supply-capacity-deterioration u m -> n%

If a unit of type u is in a cell where the calculated supply zone
strength is less than n, the maximum amount of material m that can be
transferred to/from it in a given turn will diminish according to
supply-capacity-deterioration. If the supply strength of the cell is 0,
the relevant supply-in-max and supply-out-max values are multiplied
by n%; if the supply zone strength equals supply-strength-threshold,
they are unchanged, with a linear distribution in between. The former
defaults to 0; the latter to 100.

Table: occupant-supply-strength u1 u2 -> n%

The effect on the supply-strengths of a unit of type u1 when an
occupant in a unit of type u2. Defaults to 0 which means that an
occupant has no supply-strength.

Table: supply-in-threshold u m -> n

If unit u has less than n of material m it can receive supplies from
supply sources in the unit's supply zone, but only up to the
threshold. Defaults to 0. Large values are clipped to the relevant
unit-storage-x.

Table: supply-in-max u m -> n

The maximum amount of material m that a unit of type u can receive
from its supply zone in a given turn. Defaults to -1 which means an
unlimited amount.

Table: supply-in-weight u m -> n
Table: supply-starve-weight u m -> n

The relative supply weight of unit type u with respect to material m.
The actual supply weight of a unit is linearly interpolated between
supply-starve-weight and supply-in-weight according to the amount of
material m the unit has before supply distribution: 0 produces
supply-starve-weight, while supply-in-threshold produces
supply-in-weight. A unit whose supply weight is twice as high as
another unit's receives twice as much of material type m if in the
same supply zone, assuming both have an equal capacity for receiving
material m. Both default to 1 which translates to an equal
distribution of supplies among all consumers.

Table: supply-deterioration t m -> n

The amount by which a supply line for material type m deteriorates
when traced into, across or along terrain of type t. t can be a cell,
border or connection type, respectively. A supply line is cut or ends
if its strength reaches zero. Defaults to 0 which translates to
supply lines of unlimited length.

Table: supply-enemy-deterioration t m -> n

The amount by which enemy control of a cell of type t deteriorates a
supply line of material type m traced through or into it. Defaults to
0.

Table: supply-neutral-deterioration t m -> n

The amount by which an uncontrolled cell or a cell controlled by a
neutral side causes a supply line traced through or into it to
deteriorate. Defaults to 0.

Table: supply-deterioration-at u t -> n
Table: supply-deterioration-at-for-material u m -> n%

The amount by which an enemy unit of type u, in terrain of type t,
can cause a supply line of material m to deteriorate. t should be a
cell type. The former defaults to 0; the latter to 100.

Table: supply-deterioration-adjacent u t -> n
Table: supply-deterioration-adjacent-for-material u m -> n%

The amount by which an enemy unit of type u, adjacent to a supply
line for material type m traced through/into terrain of type t, can
cause the supply line to deteriorate. The former defaults to 0; the
latter to 100.

Things To Consider

-Prettier/better names for some of the tables.
-Material wastage? Is it needed?

Notes

The last four tables should really be two 3-D tables (u t m -> n).
The same goes for supply-strength.

This is probably the best I can do and still keep the algorithm
relatively fast and simple. The number of tables has been tripled
from the previous proposal, but most of them are optional.

A more formal definition of a supply zone would be "a set of
connected cells with a positive, non-zero supply strength". Supply
zones are now material-specific.

The algorithm has two intrinsic shortcomings:

-Supply line deterioration _between_ a producer and a consumer
 doesn't reduce the quantity of materials that may be traced to or
 from a unit.
-There is no limit to the distance supplies can travel.

On the other hand, the supply properties have a predictable outcome -
distribution is always optimal, as each cell can still belong to only
one supply zone. Overlapping supply zones would lead to some serious
fudging.

I've already begun writing the new scheme. In the meantime, someone
should add the ability to display the cell control layer. Maybe
replace/augment the people display with control display? And use a
side's color instead of white for displaying the control boundaries.
Supply zones could be displayed by giving a color encoded supply zone
strength for each cell?

If I could have a few bits from the Unit structure I could use them
thusly:

-Isolated bit; this is set if there was no supply source in the
 unit's supply zone in the current turn.
-Unsupplied bit: this is set if the unit received no supplies from
 its supply zone in the current turn.
-Partly supplied bit: this is set if the unit received any supplies.
-Fully supplied bit: this is set if the unit received all the
 supplies that it "requested".

"Supply source" could be added as a unit type property, and isolated
units could be displayed by painting a suitable icon next to them;
but that is just a matter of convenience. Of course, in games that
rely heavily on logistics (A3R springs to mind: in that game being
isolated is a rather grave condition) it's nice to know if your units
are out of reach of any supply sources (even if they happened to
share supplies between themselves in the same turn). What do you
think?

Other supply information could be displayed in the unit's status
window.

Example

(table supply-strength
    ; Supply lines are traced from supply depots.
    (depot m* 20)
    )
    
(table supply-out-threshold
    ; A supply depot exists only to supply other units, so it can
    ; dole out all that it has.
    (depot m* 0)
    )

(table supply-in-threshold
    ; Infantry needs supplies to stay healthy.
    (infantry m* 9999)
    )

(table supply-enemy-deterioration
    ; Supply can be traced through neutral territory, but not through
    ; enemy-controlled cells.
    (t* m* 99)
    )

(table supply-deterioration
    ; Normally, supply lines extend 9 hexes out from supply depots.
    (t* m* 2)
    ; But up to 19 hexes if traced via navigable rivers.
    (river m* 1)
    ; Cannot trace supplies into or through forests or mountains.
    ((forest mountains) m* 99)
    )

-- 
Sami Perttu                       "Flower chase the sunshine"
perttu@cc.helsinki.fi


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]