Game Development Reference
In-Depth Information
Chapter 5. Enemy and Friendly AIs
Artificial Intelligence , also known as AI , is something that you'll see in every video
game that you play. First-person shooter, real-time strategy, simulation, role playing
games, sports, puzzles, and so on, all have various forms of AI in both large and small
systems. In this chapter, we'll be going over several topics that involve creating AI,
including techniques, actions, pathfinding, animations, and the AI manager. Then, fi-
nally, we'll put it all together to create an AI package of our own.
In this chapter, you will learn:
• What a finite state machine is
• What a behavior tree is
• How to combine two AI techniques for complex AI
• How to deal with internal and external actions
• How to handle outside actions that affect the AI
• How to play character animations
• What is pathfinding?
• How to use a waypoint system
• How to use Unity's NavMesh pathfinding system
• How to combine waypoints and NavMesh for complete pathfinding
AI techniques
There are two very common techniques used to create AI: the finite state machine
and the behavior tree. Depending on the game that you are making and the complex-
ity of the AI that you want, the technique you use will vary. In this chapter, we'll utilize
both the techniques in our AI script to maximize the potential of our AI.
Finite state machines
Finite state machines are one of the most common AI systems used throughout com-
puter programming. To define the term itself, a finite state machine breaks down to a
system, which controls an object that has a limited number of states to exist in. Some
real-world examples of a finite state machine are traffic lights, television, and a com-
puter. Let's look at an example of a computer finite state machine to get a better un-
derstanding.
Search WWH ::




Custom Search