Book description
Explore various recipes to build games using popular artificial intelligence techniques and algorithms such as Navmesh navigation A*, DFS, and UCB1
Key Features
- Explore different algorithms for creating decision-making agents that go beyond simple behaviors and movement
- Discover the latest features of the NavMesh API for scripting intelligent behaviour in your game characters
- Create games that are non-predictable and dynamic and have a high replayability factor
Book Description
Interactive and engaging games come with intelligent enemies, and this intellectual behavior is combined with a variety of techniques collectively referred to as Artificial Intelligence. Exploring Unity's API, or its built-in features, allows limitless possibilities when it comes to creating your game's worlds and characters. This cookbook covers both essential and niche techniques to help you take your AI programming to the next level.
To start with, you'll quickly run through the essential building blocks of working with an agent, programming movement, and navigation in a game environment, followed by improving your agent's decision-making and coordination mechanisms – all through hands-on examples using easily customizable techniques. You'll then discover how to emulate the vision and hearing capabilities of your agent for natural and humanlike AI behavior, and later improve the agents with the help of graphs. This book also covers the new navigational mesh with improved AI and pathfinding tools introduced in the Unity 2018 update. You'll empower your AI with decision-making functions by programming simple board games, such as tic-tac-toe and checkers, and orchestrate agent coordination to get your AIs working together as one.
By the end of this book, you'll have gained expertise in AI programming and developed creative and interactive games.
What you will learn
- Create intelligent pathfinding agents with popular AI techniques such as A* and A*mbush
- Implement different algorithms for adding coordination between agents and tactical algorithms for different purposes
- Simulate senses so agents can make better decisions, taking account of the environment
- Explore different algorithms for creating decision-making agents that go beyond simple behaviors and movement
- Create coordination between agents and orchestrate tactics when dealing with a graph or terrain
- Implement waypoints by making a manual selector
Who this book is for
The Unity 2018 Artificial Intelligence Cookbook is for you if you are eager to get more tools under your belt to solve AI- and gameplay-related problems. Basic knowledge of Unity and prior knowledge of C# is an advantage.
Table of contents
- Title Page
- Copyright and Credits
- Dedication
- Packt Upsell
- Contributors
- Preface
-
Behaviors - Intelligent Movement
- Introduction
- Creating the behaviors template
- Pursuing and evading
- Adjusting the agent for physics
- Arriving and leaving
- Facing objects
- Wandering around
- Following a path
- Avoiding agents
- Avoiding walls
- Blending behaviors by weight
- Blending behaviors by priority
- Shooting a projectile
- Predicting a projectile's landing spot
- Targeting a projectile
- Creating a jump system
-
Navigation
- Introduction
- Representing the world with grids
- Representing the world with points of visibility
- Representing the world with a self-made navigation mesh
- Finding your way out of a maze with DFS
- Finding the shortest path in a grid with BFS
- Finding the shortest path with Dijkstra
- Finding the best-promising path with A*
- Improving A* for memory – IDA*
- Planning navigation in several frames – time-sliced search
- Smoothing a path
-
Decision Making
- Introduction
- Choosing through a decision tree
- Implementing a finite-state machine
- Improving FSMs: hierarchical finite-state machines
- Implementing behavior trees
- Working with fuzzy logic
- Making decisions with goal-oriented behaviors
- Implementing a blackboard architecture
- Experimenting with Unity's animation state machine
-
The New NavMesh API
- Introduction
- Setting up the NavMesh building components
- Creating and managing NavMesh for multiple types of agents
- Creating and updating NavMesh data at runtime
- Controlling the lifetime of the NavMesh instance
- Connecting multiple instances of NavMesh
- Creating dynamic NavMeshes with obstacles
- Implementing some behaviors using the NavMesh API
-
Coordination and Tactics
- Introduction
- Handling formations
- Extending A* for coordination – A*mbush
- Analyzing waypoints by height
- Analyzing waypoints by cover and visibility
- Creating waypoints automatically
- Exemplifying waypoints for decision making
- Implementing influence maps
- Improving influence with map flooding
- Improving influence with convolution filters
- Building a fighting circle
-
Agent Awareness
- Introduction
- The seeing function using a collider-based system
- The hearing function using a collider-based system
- The smelling function using a collider-based system
- The seeing function using a graph-based system
- The hearing function using a graph-based system
- The smelling function using a graph-based system
- Creating awareness in a stealth game
- Board Games and Applied Search AI
- Learning Techniques
- Procedural Content Generation
- Miscellaneous
- Other Books You May Enjoy
Product information
- Title: Unity 2018 Artificial Intelligence Cookbook - Second Edition
- Author(s):
- Release date: August 2018
- Publisher(s): Packt Publishing
- ISBN: 9781788626170
You might also like
book
Unity 2018 Cookbook - Third Edition
Develop quality game components and solve common gameplay problems with various game design patterns Key Features …
book
Learn Unity ML-Agents - Fundamentals of Unity Machine Learning
Transform games into environments using machine learning and Deep learning with Tensorflow, Keras, and Unity About …
book
Building an RPG with Unity 2018
Build a high-end, multiplayer role-playing game (RPG) from scratch with C# and Unity 2018 Key Features …
book
Unity 2018 Shaders and Effects Cookbook
Bring realism to your games by mastering post-processing effects and advanced shading techniques in Unity 2018 …