Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Unity AI Programming Essentials

You're reading from   Unity AI Programming Essentials Use Unity3D, a popular game development ecosystem, to add realistic AI to your games quickly and effortlessly

Arrow left icon
Product type Paperback
Published in Dec 2014
Publisher
ISBN-13 9781783553556
Length 162 pages
Edition 1st Edition
Tools
Arrow right icon
Author (1):
Arrow left icon
Curtis Bennett Curtis Bennett
Author Profile Icon Curtis Bennett
Curtis Bennett
Arrow right icon
View More author details
Toc

Group attacks


We spent Chapter 4, Crowd Chaos, and Chapter 5, Crowd Control, looking at group behaviors, and we won't go through a full demo of attacking in groups here, but we should discuss a few main points. With the demo in this chapter, we can add more ships and they will attack in a fairly believable manner. However, there are ways to make it better by considering other enemy positions.

When the enemy ships choose a cover position, a simple method for a group is to track each position if an enemy is already there. Then, when selecting a cover position, each enemy won't go to one that is occupied, making the enemies more diverse in their attacks.

Similarly, when attacking the player, instead of just going as close as possible, the attack pattern can be coordinated. Instead of just going directly to the player, a set of points can be defined radially around the player, so enemies surround and attack it. The key to these group behaviors is enemies taking into account the behavior of other...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime