.

Computer Attacks Archive

From Amit's Game Programming Page
Attacking in Strength (was Terra Nova Demo) Index


1 Top   Down: 2   4   
From: Joe Bostic
Subject: Attacking in Strength (was Terra Nova Demo)
Date: Wed, 01 May 1996 02:42:21 GMT
Organization: Westwood Studios
Swoodcoc@cris.com (Steven Woodcock) wrote:
>   Some ideas of varying quality:          
>
>      1.)  You could use a database of pre-built attack forces of 
>           varying size.  When the AI determines it wants to send
>           out an attack force, it randomly picks one of these
>           configurations (perhaps based on whatever knowledge it
>           has of the defenses), gathers and/or builds the units,
>           and sends them out.  The problem with this approach is
>           you're not dynamically designing the forces, just 
>           selecting menu options, and you have to have some
>           AI to handle cases where you just *can't* build a given
>           unit type for the selected force.
>
>      2.)  You could simply sum up the known defensive/offensive
>           capabilities of the area/units you plan to attack and 
>           gather enough attack strength to meet some criteria
>           (2:1, 3:1, whatever).  The problem with *that* is that
>           not all attack points are created equally; a flamethrower
>           in C&C, for example, is worth more than 3 machine gunners.
>
>      3.)  You could analyze the force you're going up against (again,
>           based on your best info), find the best "anti" units to use
>           against each one, and send two of each.  This is cheap but
>           probably pretty effective.
>   That's it off the top of my head.  
>Steven

These are all good ideas. Red Alert uses all of these strategies (to
one degree or another). The first strategy gives the scenario
designers more control (they pick the particular groups rather than
letting the computer do so). The second and third strategies are more
suitable for end-game and multi player (with AI players) battles.
However, there are other factors to consider. 

Distance to enemy force: 
	The greater the distance the more options the computer has. That
is, it can (with more safety) delay building combatants in order to
build infrastructure.

Mobility of enemy force:
	The computer must also know how the player is able to travel. With
the threat of airborne assault, the defense posture and force
composition is greatly affected. The computer must make a 'best guess'
with regard to this threat by examining the player's assets and past
behavior.

Pattern of enemy attacks:
	The computer remembers the patterns of attack the player uses.
Human players have a fortunate (for the computer) tendency to use the
same strategy over and over. A defense tailored to meet a particular
attack strategy can be very effective.

Expert System 'AI':
	The computer has the advantage of leveraging all the most
successful skills and strategies discovered during testing. These give
the computer a 'bag of tricks' to use when the situation warrants.

Memory of past success and failure:
	The computer must also remember the success and failure rates of
the various strategies at its disposal. Some players are better suited
to defend against particular strategies than others. It is also
presumed that all players will become better at the game, and so the
computer must be able to compensate for successful defense strategies.

Megahertz:
	Finally, the computer is just plain faster at analyzing numbers
than a human is. This is the basic theory behind chess programs --
they aren't necessary smarter than the grand masters, they just look
more moves ahead. The computer can assess threats with much better
speed and accuracy than the human player. Combine this with its
lightning fast response time (and the above strategies), and the
computer becomes a formidable opponent.

Joe B.


2 Top Up Down: 3   5   
From: Eric Dybsand
Subject: Attacking in Strength (was Terra Nova Demo)
Date: 1 May 1996 13:29:53 GMT
Organization: Netcom
In <1> joebwan@anv.net (Joe Bostic)
writes: 
>
>Swoodcoc@cris.com (Steven Woodcock) wrote:
>>   Some ideas of varying quality:          
>>

[Steve's interesting ideas snipped and saved off to disk]

>
>These are all good ideas. Red Alert uses all of these strategies (to
>one degree or another). The first strategy gives the scenario
>designers more control (they pick the particular groups rather than
>letting the computer do so). The second and third strategies are more
>suitable for end-game and multi player (with AI players) battles.
>However, there are other factors to consider. 
>

[some of Joe's factors snipped and saved too]

>
>Pattern of enemy attacks:
>	The computer remembers the patterns of attack the player uses.
>Human players have a fortunate (for the computer) tendency to use the
>same strategy over and over. A defense tailored to meet a particular
>attack strategy can be very effective.
>

This is another favorite area of interest of mine, and that being
what data values actually provide a representation of the "pattern
of attack the player uses"?

Over the years, I've tried several combinations which IMO, worked 
to some degree, to a mediocre level at best, in accurately protraying
the actual "pattern" the player demonstrates.

In my attempts at attack pattern tracking, I've saved items such as:

Timing of attack - early in the game vs. later in the game
Direction of attack - compass directions only
Style of attack - single front vs. multiple fronts
Quantity of units - how many were used
Quality of units - what experience level was for units
Unit mix - what kind of units used by opfor and AI player
Attack Rating - number of AI units destroyed + objectives captured

My point is that the "patterns" I've generated and observed, were
incredibly subtle, if they existed at all.  And those attacks with
the same high rating, were often completely different.

So, while I agree that such a goal (the computer remembers the
patterns) is desirable, I'm curious as to what you and others think
are the data elements that are critical for demonstrating the "actual
pattern of attack" as employed by a human player.


>
>Memory of past success and failure:
>	The computer must also remember the success and failure rates of
>the various strategies at its disposal. Some players are better suited
>to defend against particular strategies than others. It is also
>presumed that all players will become better at the game, and so the
>computer must be able to compensate for successful defense strategies.
>

Once again, I agree with the goal, but I'm curious if the ratings
applied to the various strategies, are able to actually evaluate
whether the given strategy was succussful or a failure.

If one simply rates a strategy based on whether it "won" the game
or scenario, then that rating would be the same (in my mind) as 
that applied to another, completely different strategy that also
was used to "win" the game.  There needs to be some way to provide
a differenitation of the ratings, and that (in my mind) would need
an assortment of data history by which a given strategy could be
rated.  It is the applicability of the selected data, that leaves
me wondering what makes for the most accurate rating of a strategy?

Regards,

Eric Dybsand
Glacier Edge Technology
Glendale, Colorado, USA


3 Top Up  
From: Jan Schrage
Subject: Attacking in Strength (was Terra Nova Demo)
Date: 3 May 1996 16:15:35 GMT
Organization: Unix-AG, University of Kaiserslautern, Germany
On 1 May 1996 13:29:53 GMT, Eric Dybsand <edybs@ix.netcom.com> wrote:
[snip]
>
>In my attempts at attack pattern tracking, I've saved items such as:
>
>Timing of attack - early in the game vs. later in the game
>Direction of attack - compass directions only
>Style of attack - single front vs. multiple fronts
>Quantity of units - how many were used
>Quality of units - what experience level was for units
>Unit mix - what kind of units used by opfor and AI player
>Attack Rating - number of AI units destroyed + objectives captured
>
>My point is that the "patterns" I've generated and observed, were
>incredibly subtle, if they existed at all.  And those attacks with
>the same high rating, were often completely different.
>
>So, while I agree that such a goal (the computer remembers the
>patterns) is desirable, I'm curious as to what you and others think
>are the data elements that are critical for demonstrating the "actual
>pattern of attack" as employed by a human player.
>
I think that depends  very much on the game. One of my  preferred  attack
patterns is (in games that allow this sort of  thing) keep the  enemy  at
with long range  weapons, load effective short range weapons onto fast
trucks, move in and start the killoff (very effective against long range
weapons in my exp). Now this is extremely easy to spot (for  humans), but
none of your criteria matches it and  I frankly can't think  of a method
for an AI to spot it, that is, simple criteria that do not require this
pattern to be known beforehand. You criteria (as I understand them) would 
not spot it  since it is always a small  group of units on a larger front
and will  probably disappear in the 'noise'.
I've heard  that  Dungeon Keeper  employs some sort of 'behavioural
matching' which simulates player strategies in that
way, I can't remember the  reference. There seem to be ways though.
 
[snip]
>
>Once again, I agree with the goal, but I'm curious if the ratings
>applied to the various strategies, are able to actually evaluate
>whether the given strategy was succussful or a failure.
>
Simple  suggestion: Ratio of Units lost/enemy units destroyed, maybe
weighted  by the power of  the units. This is  fairly easy to do.
I am  not sure whether this is always appropriate (or at all).
 
Regards,
 
-jan
..... .. .. . .. .... ...... ...... .. . . ... .. ..... ... . ... . .... ..
  Jan Schrage           j.schrage@astro.cf.ac.uk, schrage@cardiff.ac.uk
                        http://www.unix-ag.uni-kl.de/~schrage/
  PGP Public Key ID:    finger ugjs@carina.astro.cf.ac.uk



5 Top Up  
From: Sunir Shah
Subject: Attacking in Strength (bloody long)
Date: 6 May 1996 04:51:36 GMT
Organization: Bell Global Solutions
Subject: Re: Attacking in Strength (bloody long)

To: Edybs@ix.netcom.com
Subject: Re: Attacking in Strength (bloody long)

I'm very annoyed.  I was in the middle of my relatively long post
discussing player analysis and my sister (who came back yesterday
>from uni) blew the bloody fuse because she didn't think that
eight light bulbs were enough ... noooooooo, she wanted a halogen
too. (the fact that she left her stereo on for three months
before I caught it shows how much she understands the concept of
electricity).

AHHHHHHHHHHHHh.....

And the CD was on a good song to boot.

Ofc, she couldn't get off her butt and fix the fuse.. Noo.. that
requires complex motor control.

Oh well, that should teach me... when chaos theory (read: my
sister) reigns supreme, save frequently.

I hate everyone.

[I'm going to be very curt now.  Suffer :)]

I'm going to outline what I'd do for a game like Warcraft...

 Ed> This is another favorite area of interest of mine, and that being
 Ed> what data values actually provide a representation of the "pattern
 Ed> of attack the player uses"?

Player analysis, IOW, which isn't necessarily limited to
conflict, but what the hell.

 Ed> In my attempts at attack pattern tracking, I've saved items such as:
 Ed> Timing of attack - early in the game vs. later in the game
 Ed> Direction of attack - compass directions only
 Ed> Style of attack - single front vs. multiple fronts
 Ed> Quantity of units - how many were used
 Ed> Quality of units - what experience level was for units
 Ed> Unit mix - what kind of units used by opfor and AI player
 Ed> Attack Rating - number of AI units destroyed + objectives captured

You aren't measuring that relative to the computer's state.  You
have one point in space (7-D space with the above criteria, but
space nonetheless), which is relative to everything.  With two
points (computer's state), it becomes more obvious because you
have a point and a vector.

[Hands up who can tell I've been learning about vectors for the
last four months? :)]

I mean, it's all well and good to know what the player does, but
you need to know *why*.

 Ed> patterns) is desirable, I'm curious as to what you and others think
 Ed> are the data elements that are critical for demonstrating the "actual
 Ed> pattern of attack" as employed by a human player.
 
Well, you'd need to measure the player relative to the computer, but not only
that (and y'all missed my page long thinking process getting to this... aww..)
but you need to keep in mind other landmarks and concerns in the scenario.

Here's a cheesy map (and now I have to redraw it):

t...............ttt.............tt  .     meadow (normal terrain)
.===.==.t.tt......t.ttt....tt...tt  t     tree
.===.==.t......MM...t..t.....t....  M     Mine
....A.....t.t..MM.ttt.....t.......  =, *  Building
.==.==.==.tttt..t.......tt....MM..
.==.==.==....t.....t..ttt.....MM..
..................t.tttt.....ttt.t
...t..t....t.................ttt..
tt..tt.t..tt..ttttt........t.....t
..t.t...t..t...ttt..t..t..t.**.**.
.t..t...tt..t.tt....tttt.t..**.**.
.t...tt..t......t...ttt......B....
....tt...ttt.t........t...***.***.
....t.....ttt...t...t...t.***.***.
.tt...tt...ttt..ttttt..tt.....***.
.................................t

With that map, I can see several strategies for player (A):

- Direct attack .. head for B
- Flank - go around the outsides
- Ambush - sprinkle units around and wait for B
    [This is impossible for the player as humans can only
    concentrate on so many things at once. so..]

- Ambush II - Find somewhere the computer is likely to go through
    or does go through often and stick troops there
- Fan - send troops out in as many paths as possible
- Attack the mine first
- etc.

None of which you are even predicting, Eric, I don't think.

And then there are tactics:

- Long-range units in back guarded by short-range in front (WC
    classic)
- Run like cowards
- micro-flanking .. vs. global flanking, you just flank a little
    bit within the local conflict
- Attack from the rear
- Chasing
- Run in, attack, run out
- etc.

I can't think of every possible strategy, you can't .. nobody
can.  Everyone is different.  So, what we need is a solution that
is independant of knowing various strategies and tactics.

Ok, once again, your criteria, Eric, are limited to the player's
attacking units' state.  You can add on the victim units' state,
such as the following stats:

- Strength
- recent actions
- distance to player
- direction of motion
- etc.

But still, that means nothing because the conflict isn't an
isolated event.  It's all related to things like the motion of
the bases, mines (other important landmarks), other conflicts,
movement of units (both sides) and other stuff (help me out on
this one, folks ... I'm not SuperGeneralGuy)

I was just thinking, the player is clueless at the beginning.
He generally experiments a bit.  I suggest you do the same with
the computer.  Place units around the map, esp. around important
landmarks.

Anyway, to determine preference to landmarks, I suggest what you
do is for each landmark in the list (which you'll premake for the
map, I s'pose.. which is fair, considering the player can do
this, esp. with save games), you compare its distance to the
conflict.. for the landmark that is closest to the conflict, add
one to its conflict counter.

BTW, because we're just using relative distances, you can leave
the distances squared... saves time instead of having to do a
square root.

Compare each *type* of landmark's (sum the various landmarks that are
of each type) count and assign guards based on that information.

Now, it's assumed there is some sort of goal.  If it's something
as straightforward as destroying the computer's base, you can do
something like for each conflict, average the vectors from the
it to the base.  Ofc, for flanking manouvres it'll look the same
as direct attacks... or, you can use a quantinization algorithm
on the vectors to find out the more popular directions.

Now, I wouldn't leave it at that because it isn't general enough
to use later on in the game ... You need to make that more
abstract.  Measure the degrees away from the direct vector from
base A to base B for each cluster and use that later on.

You made a good point, Eric, about the time of attack... All I
can say is for the graph of attacks vs. time, quantinize it so
you know when the highest number of attacks occur so you can
defend yourself.  You can also extrapolate that the player isn't
going to be ready during the low ebbs right after high peaks
(she's expended her resources).

If the goal was something different, such as eradicating all
units, you'll need other criteria.. hmm... there are only a few
strategies for this, mostly the same as for destroying the base.

That's just strategy (barely).  Now you have tactics.

Direction of attack:  for each attack, take the direction and
then take the difference between that direction and the direction
to the player base.  Average those differences over time, which
should give you the expectation of attack direction.

Strength:  Average the ratios of attack strength to victim
strength AND the magnitude of attack strength AND the magnitude
of victim strength.  If the average ratio is not close to the
ratio between avg. attack and avg. victim strength, you can
assume that the player doesn't take into consideration how much
strength the computer has.  In that case, you should group units
together with at least twice as much strength as the player's
attack magnitude.  Elsewise, 'pulse' groups of units so there are
backups ready.  Of course, the player will compensate for this,
and the algorithm will compensate again and again.  Recalculate
this at the end of each scenario.

Unit mix:  Another great idea.  You can couple this with the
player units that you got to first.  That way, you can prepare to
kill those quickly to get to the ones in back (such as long-range
units).  On the other hand, you can also prepare to take out the
ones in back while you take out the ones in front.  The latter
would simply mean ALWAYS sending out short-range and long-range
units together.  So much for caring about unit mix

Style of attack:  We can break this down into organization and
not organization :).

The organization is really accounted for in the unit mix, so
we'll skip that.

As for not-organization, all I can think of is running in,
attacking, running out vs fighting vs running away vs running
away after awhile.

Hmm.. measure the number of units on each side that are destroyed
in each conflict as a percentage.  Measure how many times you see
the same unit in conflict compared to the strength ratios and its
health (strong, high-stamina, healthy units can last longer than
weak units).  That way you can figure out bravery and
berserkiness of the player.

I just realized it'll be pretty hard to understand what groups of
units are... I suggest you use a fuzzy, recursive fill algorithm.
Pick an opposing unit (and a computer unit if you don't know your
group configurations) and recursively search out from there in
all directions.  Keep going until you're something like three
tiles away without slamming into a unit of your own creed. [just
made that up now.. <G>]

And anything else you figure out in play testing!

[Rating strategies' success/failure]
 Ed> Once again, I agree with the goal, but I'm curious if the ratings
 Ed> applied to the various strategies, are able to actually evaluate
 Ed> whether the given strategy was succussful or a failure.
[... Both strats win game = same rating?]
 Ed> was used to "win" the game.  There needs to be some way to provide
 Ed> a differenitation of the ratings, and that (in my mind) would need

What you need is something like client evaluation, and if WASTE
had a worthwhile client evaluation article yet, I'd point you to
it.  As it is, we threw out the old one because the correct
strategy was for both sides to retreat as fast as possible. :-)

What you need to do is assess what you consider good in the game
and what you consider bad.  Then evaluate based on those
criteria.  For example, killing the player quickly could be good,
or destroying all its units.. winning is a good thing too.
Having your units killed is bad.  Losing quickly is bad too.
Losing slowly is probably much better than winning quickly, and
slightly worse (or better?) than winning slowly (entertainment
value). Etc.

 Ed> me wondering what makes for the most accurate rating of a strategy?

IMHO, "depends."

:-)

This is like 257 'cording to QEdit.. yeesh.

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                  Sunir Shah (sshah@intranet.ca)                   '
'  http://intranet.ca/~sshah    ftp://ftp.intranet.ca/usr/synapsis  '
'   Fidonet: 1:241/11   BBS: The Open Fire BBS  +1 (613) 584-1606   '
'                                                                   '
'  By the WEB:  Vanity: http://intranet.ca/~sshah/                  '
'               The Programmers' Booklist         booklist.html     '
'  ~`-,._.,-'~  Synapsis Entertainment            synapsis.html     '
'  _.,-`~'-,._  WASTE (Warfare AI Contest)        waste/waste.html  '
'                                                                   '
' comp.ai.games FAQ: ftp://ftp.intranet.ca/usr/synapsis/cagfaq?.txt '
' The Game Development Echo:  Areafix GAMEDEV from Zone 1 (Fido)    '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
___ Blue Wave/QWK v2.12

>> Slipstream Jet - The QWK solution for Usenets #UNREGISTERED


4 Top Up  
From: Sunir Shah
Subject: Attacking in Strength (was Terra Nova Demo)
Date: 5 May 1996 23:50:19 GMT
Organization: Bell Global Solutions
To: Joebwan@anv.net
Subject: Re: Attacking in Strength

 Jo> Distance to enemy force: 
 Jo> The greater the distance the more options the computer has. That

I'd use a gravity-type formula ... concern is directly
proportional to the inverse squared distance * enemy strength /
player strength.  Why inverse distance squared?  In theory, the
player is concerned just as much, so you get to multiply the
distances... or something.

 Jo> The computer must also know how the player is able to travel. With

Perhaps consider the attack range too... if you 'remember'
position of unit x at t = 0, t = a and t = 2a (a is a number you
make up) and average those vectors you can determine vaguely how
long the unit will take to get to you. However, like Len
Maxwell's 'destination predictor' (from another thread in
comp.ai.games) this has major accuracy problems especially with
complex terrain.

So... you could measure the distances between the enemy and
player's closest unit for t and t = t-a and average that in with
the current velocity vector estimation .. if the distance is
coming towards you, try to extrapolate how long it will take to
get to you (distance / speed).. or even better (distance - attack
range / speed).. it doesn't have to be on top of you to attack
you.

Concern should increase geometrically/exponentionally as t
lessens (fear?  well, it just make sense ... as it gets closer,
there's a bigger concern it'll kill you).

 Jo> Pattern of enemy attacks:
 Jo> Human players have a fortunate (for the computer) tendency to use the
 Jo> same strategy over and over. A defense tailored to meet a particular

Player analysis would do it, non?

 Jo> Expert System 'AI':
 Jo> The computer has the advantage of leveraging all the most
 Jo> successful skills and strategies discovered during testing. These give
 Jo> the computer a 'bag of tricks' to use when the situation warrants.

This is a very good idea.

 Jo> Memory of past success and failure:
 Jo> The computer must also remember the success and failure rates of
 Jo> the various strategies at its disposal. Some players are better suited

How about some reinforcement learning?

Have some values for each technique you can alter to alter the
'style' you use.  For instance, if last time you used this
technique you attack from the left and you select the technique
again, you can approach from the right.  Just a thought.

Or every time you use a strategy, lower it's chance of being
selected w.r.o the other techniques.  This tries to limit
predictability.

 Jo> Finally, the computer is just plain faster at analyzing numbers
[...]
 Jo> more moves ahead. The computer can assess threats with much better
 Jo> speed and accuracy than the human player. Combine this with its

Well, that's not necessarily true.  What you're trying to say is
that computers are better tacticians.  Strategy is where they get
blown to bits.

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                  Sunir Shah (sshah@intranet.ca)                   '
'  http://intranet.ca/~sshah    ftp://ftp.intranet.ca/usr/synapsis  '
'   Fidonet: 1:241/11   BBS: The Open Fire BBS  +1 (613) 584-1606   '
'                                                                   '
'  By the WEB:  Vanity: http://intranet.ca/~sshah/                  '
'               The Programmers' Booklist         booklist.html     '
'  ~`-,._.,-'~  Synapsis Entertainment            synapsis.html     '
'  _.,-`~'-,._  WASTE (Warfare AI Contest)        waste/waste.html  '
'                                                                   '
' comp.ai.games FAQ: ftp://ftp.intranet.ca/usr/synapsis/cagfaq?.txt '
' The Game Development Echo:  Areafix GAMEDEV from Zone 1 (Fido)    '
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
___ Blue Wave/QWK v2.12

>> Slipstream Jet - The QWK solution for Usenets #UNREGISTERED