Game AI Uncovered

During the early 2000’s, when I first started out in the games industry, there was a series of books called ‘Game Programming Gems’ which graced the book shelves of most open plan offices, offering up tips and code snippets from veterans and academics about ways to do everything from collision handling, cameras, rendering techniques and a lot more besides. These books became essential reference for many industry programmers, to leaf through when planning out their next coding challenge or game requirement.

Then along came an off-shoot of this series, specifically for game AI, called “AI Game Programming Wisdom”.

As is often the case with game programmers in their early years, I found myself specialising in the type of game code I’d be allocated to write, and so in part because of my fascination with the area and some University/academic past experience, I started - more often than not - working on AI code. As a result of this, I became fascinated and obsessed with this series of books. I’d read every article, try every code snippet, and even build little prototype ideas around samples provided. Infact the A-Star algorithm for pathfinding that I carry around with me to this day was originally conceived out of the learnings from an article in “AI Game Programming Wisdom” book 1!

I was also fascinated by the authors of these articles. Legends of the genre to me. I even eventually got the opportunity to work with a couple of them - John Reynolds at Acclaim, who had written an article about combat squad group behaviours, and Dr Brett Laming, who wrote about his work which underpinned the AI systems of Grand Theft Auto: Chinatown Wars.

Incidentally, Brett is now Ash’s Dad. But that’s another story.

Fast forward around 15 to 20 years, and an old friend and colleague from my time at Activision, Paul Roberts, gets in touch to tell me he’s editing a new series of books inspired by the “AI Game Programming Wisdom”‘s of old, and would I like to write an article for him based on the work we’d done together at Activision?

Paul and I worked together from around 2012 to 2014 on the AI for a mobile title in the Call of Duty universe called ‘Call of Duty: Strike Team’.

Many of us at The Blast Furnace were former Rockstar and Team 17 staff, and the Rockstar bunch in particular, of which I was one, were very comfortable and familiar with the MARPO methodology (Movement, Avoidance, Routing, Planning and Orders), and the ‘task system’ approach of developing NPC AI behaviours derived from this, pioneered by Brett and described in detail in AI Game Programming Wisdom book 2. It’s out of print now, but if you dig deeply enough on the internet it can be found!

The work we did on Strike Team was inspired by this, and then moulded to fit combat and tactical behavioural decision making (as opposed to pedestrians desperately trying to avoid gangland violence in Liberty City!).
So I fired up a new Unity project, without access to the Strike Team source locked away in the archives of Activision, and tried to remember our thought processes and the challenges we’d faced along the way. It was great fun to revisit, and I hope that anybody who gets the chance to read my article in Game AI Uncovered book 1 finds some inspiration there for their own projects! The book is available now from the publisher Routledge, and is also available on Amazon.

Right from the outset, Paul had decided on a series of three books to be published, so he asked if I had any ideas for another article, or even a third, one for each book. The timing was perfect. We had just come to the end of our time co-developing the cross platform title ‘Make Way!’ for IceBEAM Games and were looking for our next project, so we were in a bit of downtime. The question was, what could I write about next that people might find interesting?

THe first idea I had was based on some R&D work we’d been experimenting with during our time assisting development for a big console title for 2K and Hangar 13 a couple of years earlier, which never ended up seeing the light of day. This title had some really interesting realtime lighting tech, which voxelised the environment for fast and efficient environmental calculations. Along with the design team who concepted the high level game implementation ideas, I discussed the idea with them of utilising this data so that avatars could query their current location using the voxel space, and using metadata encoded onto the voxels be able to make behavioural decisions and produce informed ‘barks’ (speech comments) to give a bit of intelligent life to a scene.
So the technical thoughts and the challenges we faced when prototyping these ideas became article number 2 in book 2!

For the final article, I took inspiration from something old and something new. One of the most exciting projects I worked on during my pre-GentSci days was for The Creative Assembly, and leading the battle AI development on Empire: Total War. The Total War games of the time tended to be developed in cycles of iteration and then refactor - so a game in the series would be built directly off the back of the previous title, and then the next would be largely developed from the ground up again. And Empire was in the cycle of ground up, so the remit was pretty much, “do what you like” in terms of AI development. Rome and Medieval 2, the two previous games in the series, had used rules-based AI, and that worked really well for the different tiers (Army -> Unit Group -> Unit) of AI tactical behaviour. We had the freedom to try something a bit different with Empire, even though the underlying foundations were a rules-based system, we had a simple goal oriented action planner on top to try to manage high level battle decision making, and we also experimented with a system of attempting to ‘persuade’ the AI to fight in certain ways, for example to make a battle set at Waterloo to play out like the battle of Waterloo did at least in terms of how the AI would behave - through a pattern-matching template system, analagous to showing the AI a whiteboard of desired tactical layout and actions and encouraging it to follow that as much as possible.

A decade or so later, I revisited the same theories to try to implement a similar whiteboard approach to tactics for our in-house mobile football game, Advance Soccer. Sadly, we never quite got to the point of realising the complete dream for that title, as we had to pivot onto work for hire to pay the bills, but it was fantastic to be able to revisit those ideas and put them down into an article, for book 3!

And this concludes fulfilling my dream of eventually writing an article (or three!) for a book (or books!) about AI!
I truly hope someone reads one of these articles one day, and is inspired to take these ideas in a whole new direction for their own successful game. I would love to hear about it!