Book Image

Unity Artificial Intelligence Programming - Fourth Edition

By : Dr. Davide Aversa, Aung Sithu Kyaw, Clifford Peters
Book Image

Unity Artificial Intelligence Programming - Fourth Edition

By: Dr. Davide Aversa, Aung Sithu Kyaw, Clifford Peters

Overview of this book

Developing Artificial Intelligence (AI) for game characters in Unity 2018 has never been easier. Unity provides game and app developers with a variety of tools to implement AI, from the basic techniques to cutting-edge machine learning-powered agents. Leveraging these tools via Unity's API or built-in features allows limitless possibilities when it comes to creating your game's worlds and characters. This fourth edition with Unity will help you break down AI into simple concepts to give you a fundamental understanding of the topic to build upon. Using a variety of examples, the book then takes those concepts and walks you through actual implementations designed to highlight key concepts and features related to game AI in Unity. Further on, you'll learn how to distinguish the state machine pattern and implement one of your own. This is followed by learning how to implement a basic sensory system for your AI agent and coupling it with a Finite State Machine (FSM). Next, you'll learn how to use Unity's built-in NavMesh feature and implement your own A* pathfinding system. You'll then learn how to implement simple ?ocks and crowd dynamics, which are key AI concepts in Unity. Moving on, you'll learn how to implement a behavior tree through a game-focused example. Lastly, you'll apply all the concepts in the book to build a popular game.
Table of Contents (13 chapters)

Artificial Intelligence (AI)

Living organisms, such as animals and humans, naturally have some level of intelligence that allows them to be able to take meaningful decisions during their daily lives. On the other hand, computers are just electronic devices that can accept data, perform logical and mathematical operations at high speeds, and output the results. AI is essentially the subject of making computers able to think and decide like living organisms to perform specific operations.

As you can imagine, this is a huge subject. There's no way that such a small book will be able to cover everything related to AI. However, it is essential to understand how to use the basics of AI in different domains. AI is just a general term; its implementations and applications are different for different purposes, solving different sets of problems.

Before we move on to game-specific techniques, we'll take a look at some of the research areas in AI applications:

  • Computer vision: This is the ability to take visual input from sources such as videos and cameras, and analyze them to do particular operations such as facial recognition, object recognition, and optical character recognition.
  • Natural Language Processing (NLP): This is the ability that allows a machine to read and understand human languages, that is, as we usually write and speak. The problem is that human languages are difficult for machines to understand. Language ambiguity is the main problem: there are many different ways to say the same thing, and the same sentence can have different meanings according to the context. NLP is a significant step for machines since they need to understand the languages and expressions we use before they can process them and respond accordingly. Fortunately, there's an enormous amount of datasets available on the web that can help researchers to automate the analysis of a language.
  • Common sense reasoning: This is a technique that our brains can efficiently use to draw answers, even from the domains we don't fully understand. Common sense knowledge is a standard way for us to attempt several questions since our brains can mix and interplay between the context, background knowledge, and language proficiency. Unfortunately, making machines to apply such knowledge is very complicated, and still a significant challenge for researchers.