Jump to ratings and reviews
Rate this book

Programming Game AI by Example: .

Rate this book
Programming Game AI by Example provides a comprehensive and practical introduction to the “bread and butter” AI techniques used by the game development industry, leading the reader through the process of designing, programming, and implementing intelligent agents for action games using the C++ programming language. Techniques covered include state- and goal-based behavior, inter-agent communication, individual and group steering behaviors, team AI, graph theory, search, path planning and optimization, triggers, scripting, scripted finite state machines, perceptual modeling, goal evaluation, goal arbitration, and fuzzy logic.

495 pages, Paperback

First published September 30, 2004

63 people are currently reading
496 people want to read

About the author

Mat Buckland

5 books4 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
92 (34%)
4 stars
107 (40%)
3 stars
52 (19%)
2 stars
11 (4%)
1 star
3 (1%)
Displaying 1 - 9 of 9 reviews
Profile Image for Costin Manda.
670 reviews20 followers
February 28, 2019
Programming Game AI by Example is one of those books that would have changed my life had I had read them when I was 15. Mat Buckland is taking a really high tech portion of game making and turning it into child's play. With source code!

From the very beginning we are being told that AI in games is different from what we would normally associate with Artificial Intelligence. AI in games is the thing that makes game agents look smart, but let the user enjoy the game the most. In other words, something that seems smart, but is just stupid enough for you to continue playing.

The book is comprised of ten chapters, heavy with code, but very well structured. The main tool in use are Finite State Machines, but we first get a mechanics physics lecture in chapter 1 where we learn what a vector is and how to normalize it and how to use this in the game physics. Moving to chapter 2, we learn what a state machine is and how to optimize memory by making each one a singleton, how to compose them and why more exciting aspects of artificial intelligence, like say neural networks, are not used more in games. We delve further into methods to optimize what we have learned to make it practical: prioritized dithering, partitioning, BSP, quad and oct trees, fuzzy-Q logic, cell space partitioning, all with code examples, in chapter 3. Chapter 5 is reserved for graphs, Dijkstra, A* and such. Chapter 6 goes into integrating Lua into your games, as a good tool to define and tweak the innards of your game before compiling it all for performance into a single code base. Raven, the example game engine, is detailed in chapter 7. Path planning is described in chapter 8, complete with many optimizations and tricks to make an algorithmic movement of units look natural and smart. Chapter 9 is about goal driven agent behavior, where we learn how to make an agent define goals and act upon those goals. The composite pattern is suggested as a good solution for goals within goals. We end with a very interesting chapter about fuzzy logic. The basis of this is to fuzzify a situation, infer a behavior, then defuzzify into a usable algorithmic value.

The bottom line is that this is a very easy book to read, explaining matter-of-factly how to easily create the intelligence in games like Fifa or Counter Strike. The code examples are extensive, but not necessary to understand the gist of things. At the end, it is both a fascinating and intriguing read as well as a good reference book for when you actually need this stuff.

I end this review with a quote from Dijkstra that was also mentioned in the book: The question of whether Machines Can Think... is about as relevant as the question of whether Submarines Can Swim. Very nice book and a recommended read.
Profile Image for Alex.
9 reviews
September 6, 2021
Good book.

Although this book is dated it book is definitely worth reading. You will gain knowledge about how many modern AI systems work, but more importantly how to implement them.

I enjoyed how the content was approachable and chapters used previous content. I like how a programmatic (non-academic) approach was taken and more emphasis was placed on "how to build such a system". The implementation was really understandable and modular, while still being approachable (I actually would like to re-implement a soccer team after reading this).

As with most books the final chapter on fuzzy logic did not resound with me, but other than that I found all the content useful/fun.

A great book for non-beginners that helped me understand both how game-AI works and how to implement them (to some extent). If you are wondering about it you should probably read it.
Profile Image for Olha.
96 reviews10 followers
Read
May 21, 2021
I've seen a reference to this book here: https://www.aleksandrhovhannisyan.com...
I've skimmed through the chapter on FSMs. It's cool that author gives the real examples of code, and informally describes the patterns for state management in event-driven systems.
While there's almost nothing new, now I know that when we have a StateMachine class, and a State class (State DP), we can do `state->exit`/`state->enter` before/after looking to a State Transition table/diagram.
Profile Image for Elias Daler.
31 reviews6 followers
January 21, 2018
Ah, what a wonderful book! Even if you've never done AI programming before, you'll be writing your first simple algorithms in a short time when you'll start reading this book. It shows you how to implement lots of different algorithms and even shows you how to make a small shooter with bots!

The only problem with this book is that it was written a long time ago, so its C++ code is not the best, but it's still very readable and well-written for C++03.
Profile Image for Trimikha Valentius.
21 reviews
December 3, 2017
Recommended by a friend to read this when i was looking for a reference to develop a simple AI for a game project. This books contains a good real life application of AI for game development, it start with a simple math formula to calculate direction (Trigonometry) to more advanced AI technique like pathfinding.

I recommend this book to those who are looking for a more practical use of AI especially in game development.

///

Dapat rekomendasi dari teman ketika saya mencari buku referensi untuk mendevelop AI sederhana untuk sebuah projek game. Di buku ini terdapat beberapa contoh aplikasi AI untuk game development, dari rumus matematika sederhana untuk menghitung arah (Trigonometri) sampai tehnik AI yang lebih rumit seperti Pathfinding.

Saya merekomendasikan buku ini untuk yang sedang mencari contoh penggunaan AI yang lebih praktikal, terutama dalam mendevelop sebuah game.
Profile Image for Cynbel.
90 reviews7 followers
August 22, 2016
Good overall reference for game AI, though the examples work correctly there are some issues with getting code to run (mostly in setting some things up), but I think that's due to the code being not up to date. Considering the book is 12 years old, a newer edition might be good, but not really necessary.

Personal preference of mine is working through projects and building from the ground up, which isn't really something this book does it's more about explaining the concepts and how it was implemented in the example code.
Profile Image for AngryKarl.
50 reviews3 followers
May 16, 2011
V počítačové sféře není moc odvětví, kde může být šest let stará knížka naprosto aktuální (tak jako to je v oboru AI). Před čtením jsem neměl s AI žádné zkušenosti, knížka mě nenásilně uvedla do základů goal-driven development, path finding atd. Fuzzy logic sice znělo zajímavě, nakonec jsem ho přeskočil, páč tohle stejně nikdy programovat nebudu :-) Doporučuji všem, kdo chtějí pochytit (naprosté) základy umělé inteligence, tedy alespoň té zaměřené na počítačové hry.
Profile Image for Omar Elkhafif.
30 reviews3 followers
November 2, 2013
Very good book about using ai in your game.

If you are a novice game developer and shocked by the "Game AI" every one is talking about. then you should read this book

You would discover that real AI is rarely used in games and mostly game AI is how to create an illusion to make the player feel that he is facing an actual enemy

This book requires hard work and lots of practice
3 reviews13 followers
December 28, 2013
Great theory and descriptions, a bit too tied to the programming language for my liking - many patterns that exist and are used in C++ simply aren't relevant or needed in other languages. Luckily very little of the design is based around the implementation language.

Displaying 1 - 9 of 9 reviews

Can't find what you're looking for?

Get help and learn more about the design.