Game Development Reference
In-Depth Information
Range is the maximum distance at which a weapon can deliver damage. Some
units have only hand-to-hand combat weapons and can attack only adjacent units,
so the range of their weapons is small. A few long-range weapons, such as long-
bows, are useless in hand-to-hand combat, and so may also need a minimum range
rating below which they are not functional. Fixed units such as gun emplacements
cannot always point in all directions; if that is the case, you will need to define a
traverse arc for the unit, two numbers that indicate the starting and ending bear-
ings. All the bearings between these two constitute an arc through which the
weapon may be traversed. A traverse arc of 0 to 90 degrees means the unit can fire
in any direction between due north and due east.
Small projectiles such as bullets and arrows should hit only one enemy unit
each, but if your game includes large, solid projectiles like cannonballs, you will
have to define the shot mass and shot velocity of each. Their kinetic energy is great
enough to let them completely destroy small units and continue onward. The amount
of damage they can do is reduced in proportion to the mass of the units that they
have already hit, until they finally stop. Explosive projectiles, on the other hand,
require a blast radius , a measure of the distance from their landing point to the far-
thest point that the explosion can affect; any unit takes damage if it is within the
blast radius. In principle, the amount of damage done to enemy units within the
blast radius should be reduced by the inverse square law—that is, the shot power of
the projectile is reduced in proportion to the square of the target unit's distance from
the center of the blast; however, you may not wish to compute to that level of detail.
Accuracy is a measure of the chance that a given weapon will hit the point at
which it is aimed, expressed as a real number between 0 (never hits) and 1 (always
hits). Note that this is accuracy of aiming at a point, not hitting a unit; if a projec-
tile is slow, the unit may not be there when the projectile arrives, even if the
weapon is highly accurate. Theoretical accuracy is the average accuracy of a weapon
under all conditions, but you may also add to or subtract from the theoretical accu-
racy to compute the practical accuracy based on the prevailing conditions when the
weapon is used, such as the distance to the target, whether it's daytime or night-
time, and so on.
Defensive dodging is a unit's ability to successfully dodge an enemy shot; you may
want to restrict its meaning to dodging solid projectiles such as bullets, not blast
effects. Like accuracy, it should be expressed as a real number between 0 (never dodges)
and 1 (always dodges). If your physics model is complex enough to include the velocity
of shots, then defensive dodging should be less effective against faster-moving shots.
Units that move have a speed at which they are currently moving and a maximum
speed that represents the fastest they can move over unrestricted terrain such as a
road. Their actual speed at a given time degrades because of the difficulty of the ter-
rain through which they are passing (a terrain attribute); difficulty is expressed as a
real number between 0 (prohibits passage entirely) and 1 (allows maximum speed,
like a road). Speed should also degrade by moving uphill; the altitude of each point
in the landscape is another terrain attribute, and the relative altitudes of two adjacent
Search WWH ::




Custom Search