Developing games is a passion for some, and I believe that this is because we are able to create a world that is completely imagined by us; this is like being a god, and the AI characters that we place there are the habitants of that world that we have just created. We are free to imagine how they will behave, we can create a society according to our imagination, we are able to create a sweet and kind character, but also we can create the most devilish character that ever existed--the possibilities are endless, and that is why we will always have new game ideas coming out. No matter what game genre we decide to develop, the world and their characters will be the essence of our vision; this is what will make our game unique, and ideally we should be able to create everything that we have in mind, just as we imagine. This book was conceived with that in mind, that all of us should be able to create the ideas that we have and that we shouldn't limit our imagination, so this book will cover the foundations of creating an artificial character, and after reading it, we should be able to explore all the topics that you have learned, creating AI characters that fit perfectly with what we have imagined.
Chapter 1, Different Problems Require Different Solutions, is a brief introduction to the video game industry and game AI.
Chapter2, Possibility and Probability Maps, focuses on how to create and use probability and possibility maps for AI characters.
Chapter 3,Production Systems, describes how to create a set of rules necessary for the character AI to achieve their goals.
Chapter 4, Environment and AI, focuses on the interaction between the characters in the game and their environment.
Chapter 5, Animation Behaviors, shows best practices to implement animations in our game.
Chapter 6, Navigation Behavior and Pathfinding, focuses on how to calculate the best options for the AI to move in real time.
Chapter 7, Advanced Pathfinding, focuses on the use of theta algorithms to find short and realistic-looking paths.
Chapter 8, Crowd Interactions, focuses on how the AI should behave when there are a lot of characters on the same scene.
Chapter 9, AI Planning and Collision Avoidance, discusses the anticipation of the AI, knowing in advance what they will do when arriving at a position or facing a problem.
Chapter 10, Awareness, focuses on working with awareness systems to create stealth genre mechanics.
It is recommended that you have install a game engine that uses C# (Unity3D has a free version, and it was used for the examples covered on the book).
This book is intended for developers who have already created their first games in C# and seek to expand their capabilities with AI, creating crowds, enemies, or allies that can behave autonomously.
In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The variables that we'll be using for now are Health
, statePassive
, stateAggressive
, and stateDefensive
."
A block of code is set as follows:
if (playerPosition == "triggerM") { transform.LookAt(playerSoldier); // Face the direction of the player transform.position = Vector3.MoveTowards(transform.position, buildingPosition.position, walkBack); backwardsFire(); }
New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "In Unity we click under the Layers
button to expand more options, and then we click where it says Edit Layers...
."
Feedback from our readers is always welcome. Let us know what you think about this book-what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of. To send us general feedback, simply e-mail feedback@packtpub.com
, and mention the book's title in the subject of your message. If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you. You can download the code files by following these steps:
- Log in or register to our website using your e-mail address and password.
- Hover the mouse pointer on the
SUPPORT
tab at the top. - Click on
Code Downloads & Errata
. - Enter the name of the book in the
Search
box. - Select the book for which you're looking to download the code files.
- Choose from the drop-down menu where you purchased this book from.
- Click on
Code Download
.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
- WinRAR / 7-Zip for Windows
- Zipeg / iZip / UnRarX for Mac
- 7-Zip / PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Practical-Game-AI-Programming. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/PracticalGameAIProgramming_ColorImages.pdf.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form
link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title. To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata
section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy. Please contact us at copyright@packtpub.com
with a link to the suspected pirated material. We appreciate your help in protecting our authors and our ability to bring you valuable content.