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
Practical Game AI Programming

You're reading from   Practical Game AI Programming Unleash the power of Artificial Intelligence to your game

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher Packt
ISBN-13 9781787122819
Length 348 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Micael DaGraça Micael DaGraça
Author Profile Icon Micael DaGraça
Micael DaGraça
Arrow right icon
View More author details
Toc

Animation state machines

We have already talked about behavior states, where we define the possible actions of a character and how to link them. Animation state machines is a very similar process, but instead of defining the actions, we define the animations of a character. While developing the character and creating the behavior states, we could assign the animations in the action code, defining at which point the character starts to run, and once that happens, the walk animation stops and the run animation starts playing. This way of integrating the animations with the gameplay code looks like an easier approach to do it, but it's not the best way and it gets complicated if we want to update the code later on.

The solution to this problem is to create a separate state machine just for the animations. This will allow us to have better control of the animations without worrying...

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 €18.99/month. Cancel anytime