更新时间:2021-06-10 18:58:16
coverpage
Title Page
Dedication
About Packt
Why subscribe?
Packt.com
Contributors
About the authors
About the reviewer
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Introduction to AI
Artificial Intelligence (AI)
AI in games
AI techniques
Finite State Machines (FSMs)
Random and probability in AI
The sensor system
Polling
The messaging system
Flocking swarming and herding
Path following and steering
A* pathfinding
A navigation mesh
The behavior trees
Locomotion
Summary
Finite State Machines
The player's tank
Initialization
Shooting bullet
Controlling the tank
The Bullet class
Setting up waypoints
The abstract FSM class
The enemy tank AI
The Patrol state
The Chase state
The Attack state
The Dead state
Taking damage
Using an FSM framework
The AdvanceFSM class
The FSMState class
The state classes
The PatrolState class
The NPCTankController class
Randomness and Probability
Randomness in games
Randomness in computer science
The Unity Random class
Simple random dice game
Definitions of probability
Independent and related events
Conditional probability
Loaded dice
Character personalities
FSM with probability
Dynamic AI
Demo slot machine
Random slot machine
Weighted probability
Near miss
Further reading
Implementing Sensors
Basic sensory systems
Scene setup
The player's tank and the aspect class
Aspect
AI characters
Sense
Sight
Touch
Testing
Flocking
Basic flocking behavior
Individual behavior
Controller
Alternative implementation
FlockController
Path-Following and Steering Behaviors
Following a path
Path script
Path-following agents
Avoiding obstacles
Adding a custom layer
Obstacle avoidance