Dear griffy:
Thank you for this very interesting question. As an avid game player
with an interest in game
development, this question is especially interesting to me personally.
Let me just give you a
few examples from personal experience, and then I'll provide you with
all the research I have
done for you related to swarming behavior in modern computer games.
I'm not sure how much computer games you play, so I will assume no
knowledge on your part,
just to be safe. The first thing that comes to the top of my mind when
you mention swarming
attacks would be games of the real time strategy genre, such as the
game Total Annihilation.
Here's a "small" list of these games from the Google directory:
http://directory.google.com/Top/Games/Video_Games/Strategy/Real-Time/
In most RTS, player sees a top down view of the battle field and uses
their mouse as a
controller. The swarming behavior occurs when the player selects
multiple "units"
("soldiers," "tanks" etc) on the battlefield and gives them orders.
The user selects units by
clicking and dragging a box over the desired units, which selects
them.
Depending on the game, the user may select anywhere from a few
(Starcraft - Blizzard, Inc) to
an infinite (Total Annihilation - Cavedog, Inc) number of units at
once. So, the swarm can be
anywhere from just a few units large to a veritable army of hundreds,
as in the case in games
such Total Annihilation or Shogun - Total War.
Then the user may give orders such as "attack this enemy unit" through
a click of the mouse
on the enemy unit. All of the selected units then move towards the
enemy unit and attack it.
This is much more difficult to implement in code than it sounds.
For one, each individual unit has to compute a route to the enemy
unit. If this is not done
correctly, then the unit will choose a round about route to its
destination, frustrating the
user. There maybe obstacles such as trees, streams, or walls blocking
to route. All of these
need to be handled well for good path finding. Typically, the
algorithm imployed is the A*
algorithm. Here's articles on good pathfinding coding:
"Pathfinding is a core component of most games today. Characters,
animals, and vehicles all
move in some goal-directed manner, and the program must be able to
identify a good path from
an origin to a goal, which both avoids obstacles and is the most
efficient way of getting to
the destination. The best-known algorithm for achieving this is the A*
search (pronounced "A
star"), and it is typical for a lead programmer on a project simply to
say, "We'll use A* for
pathfinding." However, AI programmers have found again and again that
the basic A* algorithm
can be woefully inadequate for achieving the kind of realistic
movement they require in their
games."
Toward More Realistic Pathfinding
http://www.gamasutra.com/features/20010314/pinter_01.htm
Smart Moves - Intelligent Path Finding
http://www.gamasutra.com/features/19990212/sm_01.htm
Secondly, the units also needs to take into account all the other
units on screen. What does
the unit do if another unit in the swarm blocks its path? This is
known as coordinated
pathfinding, and is very easy to get wrong. Some games handle it well
(Warcraft - Blizzard
Inc), some don't (Age of Empires I - Microsoft, Inc). Coordinated
pathfinding is also what contributed to the "swarm" behavior typically
seen in games with good pathfinding. Here's some articles on
"Coordinated" pathfinding:
"Figuring out how to get hundreds of units moving around a complex
game map in real time -
commonly referred to as pathfinding - is a tough task. While
pathfinding is a hot industry
buzzword, it's only half of the solution. Movement, the execution of a
given path, is the
other half of the solution. For real-time strategy games, this
movement goes hand in hand
with pathfinding. An axeman certainly needs a plan (as in, a path) for
how he's going to get
from one side of his town to the other to help stave off the enemy
invasion. If he doesn't
execute that plan using a good movement system, however, all may be
lost. "
Coordinated Unit Movement
http://www.gamasutra.com/features/19990122/movement_01.htm
Implementing Coordinated Movement
http://www.gamasutra.com/features/19990129/implementing_01.htm
Most real time strategy games are two dimensional (if not in graphics,
then in control), and
their basic unit of control is a single unit (meaning that you can
control one unit in the
swarm at a time, should you choose to). However, there are exceptions
to both of these
commonalities.
The best example of a 3D real time strategy game (that incidentally
also demonstrates
swarming behavior to a degree beyond most other RTS's) would be the
Homeworld series of
games. Here is Homeworld's homepage:
http://homeworld.sierra.com/hw/
Homeworld's basic gameplay is fundamentally similar to all other RTS
games, with the
exception of its innovative control scheme. The Homeworld game, unlike
most others, takes
place in a true 3D world with six degrees of freedom. In Homeworld,
your units are space
fighters. You can select an unlimited of units at any one time. The
real innovation comes
from your unprecedented level of control over the "swarms." By
pressing a function key, (F1 -
F12), you set the aggresiveness level of your units as well as make
them quickly form
formations for attack:
Tactics:
+Evasive: only Strike Crafts really benefits of this behaviour, as
they are the
only vessels capable of tigh maneuvers. With evasive tactics, your
units will
travel toward the opponent without keeping formation, each one using
at maximum
efficiency its engines and firing only when sure that enemy fire won't
hit.
Ideal for high-speed strafing runs on enemy Capital Ships with
anti-fighter
guns, where tight formations usually result in a single ion cannon
vaporizing a
good number of crafts. Also, when crafts using Evasive tactic reach
red and
yellow health status, they immediately return to the nearest support
ships for
repair
+Neutral: the standard behavior of new units; in Neutral mode crafts
will
attach only if attached first, and then will return to inactivity
until someone
fires against. It will be used in the single palyer (see the walkthru
below),
but I've never seen someone using it in multiplayer games
+Aggressive: units will maintain formations, and when a target is
within range,
they will fire. The drawback of this tactic is that crafts only do
strafing
runs or maintain position to have an optimal aim over the targets, and
won't
dodge any enemy projectile, missile or energy beam. Useful for Capital
vs
Capital and Fighter vs Fighter dogfights.
Formations:
+Delta: vessels will form a 2D triangle. Though it is a very classic
formation
and very useful for parades, the top craft will be the most vulnarable
to
damage, effectively broking the formation.
+Broad: an other 2D formations, but this time the vessels will form a
straight
line. Deadly for crafts, especially for big groups, as the combined
firepower
of a formation should give is centered around few elements. Quite
effective for
Capital Ships as you can use it for positioning them along the enemy's
front
and sides. I will describe this tactic later on.
+X: one of the best formations for fighters: the X formations allows
relatively
small groups (maximum 15) to concentrate fire. Drawbacks? As the
formations is
compact, enemy turrets will enjoy in destroying your fighters.
+Claw: the best formations for fighters, and if you have some
Frigates, even
for them. Recomended for maximum 15 crafts, like X formation, the Claw
maximizes the effects of concentrated fire of an X formation while
reducing the
compactness of the formation.
+Wall: ideal for large groups of ships and every Capital Ship
formation, the
wall creates a...wall (¬_¬...) of ships, maximizing firepower. If you
have
large fighter formations (10+) or at least 4/6 Frigates, the Wall will
be THE
choice.
+Sphere: though I use this formation mainly for defensive purposes, I
know that
someone uses it for single Capital Ships with large Fighter escorts.
In a
Sphere formation, the bigger ship will be the center of the sphere,
while the
lighter ones will produce a defensive bubble around it. When usued
cleverly,
this formation will break any defense line and/or assault.
+Military Parade: the only way to use this formation is to include
Carriers.
Any kind of formation including such ships will be changed in a
Military Parade
formation, a roughly rectangular formation where the Carriers are at
the
lateral edges, Strike Crafts at the "frontal" edge and the Capital
Ships at the
"rear" edge. Useless during combat (friendly fire) but good if you
want to snap
few screenshots.
Source: The Homeworld FAQ
http://db.gamefaqs.com/computer/doswin/file/homeworld_d.txt
The formations are truly an impressive feature to watch. Imagine a
swarm of bees flying
around your house and on command, they form an X (press F7) pattern in
mid air. On another
command, they form a perfect sphere (press F10). That's exactly how
the formations in the
Homeworld work. Simply by pressing a key, the swarm very quickly
morphs from one formation to another. Depending on the aggresiveness
level and the formation, the ships dodge enemy
fire as well other ships, working together as a cohesive group. The
swarming behavior in
Homeworld is truly unique and I do recommend you purchase the game or
download the demo at
its homepage to get an idea of what it is like.
The other exception to most real time strategy games I mentioned is
the basic unit control.
In Homeworld and pretty much most every other real time strategy game,
the most basic unit
you can control is one. This means that although you can give an order
to say, 100 soldiers
to move and attack north, you can also select just one of the soldiers
and tell it to move
and attack south.
However, in Shogun - Total War (http://www.totalwar.com), the
fundamental unit of control is
a whole battallion of units. This means that you cannot control the
movement of a single
soldier in the battallion, instead you must give orders to the entire
battalion at once. You
can change the formation of the battalion through a click and drag. So
for example you can
actually change the formation from a square grouping of men and make
them all stand in a
single file line. This is mostly done from the mouse.
Once two opposing battalions engage in battle, the neat rows and files
that make up a
battallion disperses and the two sides merge in a big, bloody battle.
The control of the game
play is rather deep (but not necessarily complex), so I recommend that
you download the demo
version from the above website and see for yourself how it works. The
battles are a sight to
behold, as thousands of unit engage in melee battle at once while
archers fire away from the
hills.
The game Ground Control is the only other RTS game I know of that
implements multiple units
as the fundamental unit of control, but it is not a good example of
swarming as it has at
most a dozen soldiers in a unit, while Shogun up to 250.
http://www.sierrastudios.com/games/groundcontrol/
Finally, this is probably the best example of swarming as a
fundamental gameplay concept in
any game available today, but as it is a N64 game, I have saved it for
last. It is called
"Pikmin."
http://www.nintendo.com/games/gamepage/description.jsp?gameId=588#about
"Unlike most strategy games, the basic controls in Pikmin are very
simple. Mr. Miyamoto has
made excellent use of the new Nintendo GameCube Controller. The main
Control Stick controls
Captain Olimar, while the C-Stick controls the swarming mass of
Pikmin. While you're moving
Olimar in one direction, you're free to move the Pikmin in any
direction you'd like. Simple
one-button action commands are used to control your Pikmin."
I don't actually own an N64, so I can't say much about the game play.
From what I have seen
though, the game play involves controlling a swarm of little aliens to
do your bidding. You
control the swarm using a joystick, but you can't actually control any
of themselves.
Finally, as a fun extra, here are some small programs that demonstrate
swarming behavior:
http://www.aridolan.com/ad/Alife.html
Google Search Strategy:
swarming behavior games
://www.google.com/search?
hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&q=swarming+behavior+games&btnG=Google+Search
I hope this was what you were looking for! If you need any
clarifications, please don't
hesitate to ask. I would be more than happy to assist you further.
Best Regards,
blader-ga |
Clarification of Answer by
blader-ga
on
31 Jul 2002 21:55 PDT
Doh! Sorry about the word wrapping. Here it is again, if you didn't
burn your eyes already. =)
Dear griffy:
Thank you for this very interesting question. As an avid game player
with an interest in game development, this question is especially
interesting to me personally. Let me just give you a few examples from
personal experience, and then I'll provide you with all the research I
have done for you related to swarming behavior in modern computer
games.
I'm not sure how much computer games you play, so I will assume no
knowledge on your part, just to be safe. The first thing that comes to
the top of my mind when you mention swarming attacks would be games of
the real time strategy genre, such as the game Total Annihilation.
Here's a "small" list of these games from the Google directory:
http://directory.google.com/Top/Games/Video_Games/Strategy/Real-Time/
In most RTS, player sees a top down view of the battle field and uses
their mouse as a controller. The swarming behavior occurs when the
player selects multiple "units" ("soldiers," "tanks" etc) on the
battlefield and gives them orders. The user selects units by clicking
and dragging a box over the desired units, which selects them.
Depending on the game, the user may select anywhere from a few
(Starcraft - Blizzard, Inc) to an infinite (Total Annihilation -
Cavedog, Inc) number of units at once. So, the swarm can be anywhere
from just a few units large to a veritable army of hundreds, as in the
case in games such Total Annihilation or Shogun - Total War.
Then the user may give orders such as "attack this enemy unit" through
a click of the mouse on the enemy unit. All of the selected units then
move towards the enemy unit and attack it. This is much more difficult
to implement in code than it sounds.
For one, each individual unit has to compute a route to the enemy
unit. If this is not done correctly, then the unit will choose a round
about route to its destination, frustrating the user. There maybe
obstacles such as trees, streams, or walls blocking to route. All of
these need to be handled well for good path finding. Typically, the
algorithm imployed is the A* algorithm. Here's articles on good
pathfinding coding:
"Pathfinding is a core component of most games today. Characters,
animals, and vehicles all move in some goal-directed manner, and the
program must be able to identify a good path from an origin to a goal,
which both avoids obstacles and is the most efficient way of getting
to the destination. The best-known algorithm for achieving this is the
A* search (pronounced "A star"), and it is typical for a lead
programmer on a project simply to say, "We'll use A* for pathfinding."
However, AI programmers have found again and again that the basic A*
algorithm can be woefully inadequate for achieving the kind of
realistic movement they require in their games."
Toward More Realistic Pathfinding
http://www.gamasutra.com/features/20010314/pinter_01.htm
Smart Moves - Intelligent Path Finding
http://www.gamasutra.com/features/19990212/sm_01.htm
Secondly, the units also needs to take into account all the other
units on screen. What does the unit do if another unit in the swarm
blocks its path? This is known as coordinated pathfinding, and is very
easy to get wrong. Some games handle it well (Warcraft - Blizzard
Inc), some don't (Age of Empires I - Microsoft, Inc). Coordinated
pathfinding is also what contributed to the "swarm" behavior typically
seen in games with good pathfinding. Here's some articles on
"Coordinated" pathfinding:
"Figuring out how to get hundreds of units moving around a complex
game map in real time - commonly referred to as pathfinding - is a
tough task. While pathfinding is a hot industry buzzword, it's only
half of the solution. Movement, the execution of a given path, is the
other half of the solution. For real-time strategy games, this
movement goes hand in hand with pathfinding. An axeman certainly needs
a plan (as in, a path) for how he's going to get from one side of his
town to the other to help stave off the enemy invasion. If he doesn't
execute that plan using a good movement system, however, all may be
lost. "
Coordinated Unit Movement
http://www.gamasutra.com/features/19990122/movement_01.htm
Implementing Coordinated Movement
http://www.gamasutra.com/features/19990129/implementing_01.htm
Most real time strategy games are two dimensional (if not in graphics,
then in control), and their basic unit of control is a single unit
(meaning that you can control one unit in the swarm at a time, should
you choose to). However, there are exceptions to both of these
commonalities.
The best example of a 3D real time strategy game (that incidentally
also demonstrates swarming behavior to a degree beyond most other
RTS's) would be the Homeworld series of games. Here is Homeworld's
homepage:
http://homeworld.sierra.com/hw/
Homeworld's basic gameplay is fundamentally similar to all other RTS
games, with the exception of its innovative control scheme. The
Homeworld game, unlike most others, takes place in a true 3D world
with six degrees of freedom. In Homeworld, your units are space
fighters. You can select an unlimited of units at any one time. The
real innovation comes from your unprecedented level of control over
the "swarms." By pressing a function key, (F1 - F12), you set the
aggresiveness level of your units as well as make them quickly form
formations for attack:
Tactics:
+Evasive: only Strike Crafts really benefits of this behaviour, as
they are the
only vessels capable of tigh maneuvers. With evasive tactics, your
units will
travel toward the opponent without keeping formation, each one using
at maximum
efficiency its engines and firing only when sure that enemy fire won't
hit.
Ideal for high-speed strafing runs on enemy Capital Ships with
anti-fighter
guns, where tight formations usually result in a single ion cannon
vaporizing a
good number of crafts. Also, when crafts using Evasive tactic reach
red and
yellow health status, they immediately return to the nearest support
ships for
repair
+Neutral: the standard behavior of new units; in Neutral mode crafts
will
attach only if attached first, and then will return to inactivity
until someone
fires against. It will be used in the single palyer (see the walkthru
below),
but I've never seen someone using it in multiplayer games
+Aggressive: units will maintain formations, and when a target is
within range,
they will fire. The drawback of this tactic is that crafts only do
strafing
runs or maintain position to have an optimal aim over the targets, and
won't
dodge any enemy projectile, missile or energy beam. Useful for Capital
vs
Capital and Fighter vs Fighter dogfights.
Formations:
+Delta: vessels will form a 2D triangle. Though it is a very classic
formation
and very useful for parades, the top craft will be the most vulnarable
to
damage, effectively broking the formation.
+Broad: an other 2D formations, but this time the vessels will form a
straight
line. Deadly for crafts, especially for big groups, as the combined
firepower
of a formation should give is centered around few elements. Quite
effective for
Capital Ships as you can use it for positioning them along the enemy's
front
and sides. I will describe this tactic later on.
+X: one of the best formations for fighters: the X formations allows
relatively
small groups (maximum 15) to concentrate fire. Drawbacks? As the
formations is
compact, enemy turrets will enjoy in destroying your fighters.
+Claw: the best formations for fighters, and if you have some
Frigates, even
for them. Recomended for maximum 15 crafts, like X formation, the Claw
maximizes the effects of concentrated fire of an X formation while
reducing the
compactness of the formation.
+Wall: ideal for large groups of ships and every Capital Ship
formation, the
wall creates a...wall (¬_¬...) of ships, maximizing firepower. If you
have
large fighter formations (10+) or at least 4/6 Frigates, the Wall will
be THE
choice.
+Sphere: though I use this formation mainly for defensive purposes, I
know that
someone uses it for single Capital Ships with large Fighter escorts.
In a
Sphere formation, the bigger ship will be the center of the sphere,
while the
lighter ones will produce a defensive bubble around it. When usued
cleverly,
this formation will break any defense line and/or assault.
+Military Parade: the only way to use this formation is to include
Carriers.
Any kind of formation including such ships will be changed in a
Military Parade
formation, a roughly rectangular formation where the Carriers are at
the
lateral edges, Strike Crafts at the "frontal" edge and the Capital
Ships at the
"rear" edge. Useless during combat (friendly fire) but good if you
want to snap
few screenshots.
Source: The Homeworld FAQ
http://db.gamefaqs.com/computer/doswin/file/homeworld_d.txt
The formations are truly an impressive feature to watch. Imagine a
swarm of bees flying around your house and on command, they form an X
(press F7) pattern in mid air. On another command, they form a perfect
sphere (press F10). That's exactly how the formations in the Homeworld
work. Simply by pressing a key, the swarm very quickly morphs from one
formation to another. Depending on the aggresiveness level and the
formation, the ships dodge enemy fire as well other ships, working
together as a cohesive group. The swarming behavior in Homeworld is
truly unique and I do recommend you purchase the game or download the
demo at its homepage to get an idea of what it is like.
The other exception to most real time strategy games I mentioned is
the basic unit control. In Homeworld and pretty much most every other
real time strategy game, the most basic unit you can control is one.
This means that although you can give an order to say, 100 soldiers to
move and attack north, you can also select just one of the soldiers
and tell it to move and attack south.
However, in Shogun - Total War (http://www.totalwar.com), the
fundamental unit of control is a whole battallion of units. This means
that you cannot control the movement of a single soldier in the
battallion, instead you must give orders to the entire battalion at
once. You can change the formation of the battalion through a click
and drag. So for example you can actually change the formation from a
square grouping of men and make them all stand in a single file line.
This is mostly done from the mouse.
Once two opposing battalions engage in battle, the neat rows and files
that make up a battallion disperses and the two sides merge in a big,
bloody battle. The control of the game play is rather deep (but not
necessarily complex), so I recommend that you download the demo
version from the above website and see for yourself how it works. The
battles are a sight to behold, as thousands of unit engage in melee
battle at once while archers fire away from the hills.
The game Ground Control is the only other RTS game I know of that
implements multiple units as the fundamental unit of control, but it
is not a good example of swarming as it has at most a dozen soldiers
in a unit, while Shogun up to 250.
http://www.sierrastudios.com/games/groundcontrol/
Finally, this is probably the best example of swarming as a
fundamental gameplay concept in any game available today, but as it is
a N64 game, I have saved it for last. It is called "Pikmin."
http://www.nintendo.com/games/gamepage/description.jsp?gameId=588#about
"Unlike most strategy games, the basic controls in Pikmin are very
simple. Mr. Miyamoto has made excellent use of the new Nintendo
GameCube Controller. The main Control Stick controls Captain Olimar,
while the C-Stick controls the swarming mass of Pikmin. While you're
moving Olimar in one direction, you're free to move the Pikmin in any
direction you'd like. Simple one-button action commands are used to
control your Pikmin."
I don't actually own an N64, so I can't say much about the game play.
From what I have seen though, the game play involves controlling a
swarm of little aliens to do your bidding. You control the swarm using
a joystick, but you can't actually control any of themselves.
Finally, as a fun extra, here are some small programs that demonstrate
swarming behavior:
http://www.aridolan.com/ad/Alife.html
Google Search Strategy:
swarming behavior games
://www.google.com/search?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&q=swarming+behavior+games&btnG=Google+Search
I hope this was what you were looking for! If you need any
clarifications, please don't hesitate to ask. I would be more than
happy to assist you further.
Best Regards,
blader-ga
|