Prev: Re: Full Traveller Next: Re: Starting from the ground up

Re: [FT] PBeM

From: Tony Francis <tony@g...>
Date: Thu, 28 Oct 1999 14:09:53 +0100
Subject: Re: [FT] PBeM

colin.plummer@theplanet.net wrote:

>   My initial plan was to have each weapon list targets in order of
preference,
> (with 'closest' being a valid target).   Then the targets are assigned
based
> on how many firecons the ship has.  However - this is a bit of a
coding muddle.
>
>   I could continue using this idea.  But I was kind of hoping that
those of
> you with a little more 'command experience' might give me some ideas
on how
> to handle target designation.
>

First point - picking the nearest target doesn't often work too well
since you end
up with two fleets both annihilating the enemies' point ship and
ignoring the rest
of the ships. Targets must be prioritised by threat to both the firing
ship and
also to any ships that it is escorting. The way to do this is to
generate a
perceived threat value (ie a number) for every target out there and then
sort these
into order. Factors to look at when generating this number include :

1) Is he targeting me ("Captain, they've locked onto us") ?
2) Is he targeting any ship I'm supposed to be protecting ("Sir, they're
targeting
the Invincible ") ?
3) Is he in range ("Out of effective torpedo range, Captain") ?
4) If so, what range band is he in (ie how effective would my fire be) ?
5) How much of a threat are they (ie how much damage can they do to me)
?

Things get complicated when dealing with fleet target assignments.
Calculating and
assigning targets for each ship individually tends to result in most or
all of one
side's ships targeting the same enemy vessel. One way round this is to
subtract a
fixed amount from the target's threat value for each ship of your side
that is
already targeting it. In this case you'll probably need to assign
targets to the
biggest ships first and then let the cruisers and escorts pick over
what's left.

One tip which I've learnt when programming AI for various games - make
your
calculations simple. Don't try to introduce sliding scales that generate
fractional
numbers based on the square of the distance to the target (or whatever).
If the
target is in range band one assign it three threat points, range band
two two
points and band three one point. Similarly determine a threat as being
Very
Threatening (three points), Threatening (two points), Minor Threat (one
point) or
No Threat (zero points). This will make it much easier to balance these
threat
point values out and tweak the workings of your algorithm (I speak from
long
experience here - KISS).

There's plenty more I could write on this topic but unfortunately I have
to get
back to work ... hope this helps a little.

Tony

Prev: Re: Full Traveller Next: Re: Starting from the ground up