O'Reilly logo

Unity 3 Game Development HOTSHOT by Jate Wittayabundit

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 6. Create Smart AI

Creating AI can be the most difficult and complex task in the development of a game because we have to calculate every possible way to make it as smart as a human brain. Most games need the AI for the enemy to be able to react to the player. The AI will run towards and attack the player, or when the player hits the wall, he or she will jump or walk avoiding the obstacles, and so on.

However, we have to be careful with the balance between making the AI smart and the performance speed to get the best moves. To get the best moves means more calculation, so it might cause a problem with performance slowing down.

We can use A* Algorithm for the pathfinder or Minimax Algorithm to calculate the best move, but these algorithms ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required