Archive for November, 2009
Battle AI – By Mike Simpson
Just before the end of Empire the lead Battle AI programmer left CA to return to his family up north. Unfortunately, thanks to Mr Wilberforce’s efforts 200 years ago we couldn’t stop him. It left us with a battle AI, which at that stage, struggled to beat good players in a fair fight, and was pretty much at the mercy of great players, even with a level of handicap (I call it cheating) that is all too obvious.
Since then we’ve had our most talented programmers pick up where he left off, but becoming the master of a chunk of code that took almost three years to write is not an instant thing. In the updates so far we’ve got rid of some of the worst behaviours that are close to the surface, and have started to tackle deeper issues like unstable decision loops that cause the AI to mill around rather than hold its line and fire. We’re also starting to add new behaviours, for example taking better advantage of hilly terrain. These improvements take the code further than we’ve been able before and will be there for Napoleon but we’re not sure yet whether we’ll be able to reverse them back in to Empire in a future update – the code has moved on. If we can we will.
Our overall aim with the improvements is first to get rid of any erratic behaviour, second to improve general performance to the point where the obvious handicaps can be removed, and then to add a greater variety of ‘smart’ behaviours. None of these have a fixed finish line – it’s a process of continual improvement, and each game will get AI better than the last one. Including Napoleon.
Progress is frustratingly slow but thankfully rewriting the Rome: Total War codebase has left us with a clean codebase that is easier to work on, and an architecture that has way more potential than Rome’s. The main difference is the shift to a goal oriented planning system rather than a static system that has no long term plans. This has yet to fully pay off. But it will. When it does I’ll talk about it again.
Battle AI is not rocket science – its way, way harder than that. It’s so difficult that very few strategy games attempt it. Most use simple scripts of canned behaviour that fire when you bump in to them, and very simple swarming behaviours. They’re limited, and are “gamey” rather than real world. What I mean by that is that the tactics you use to beat them are something that you have to learn for each game or sometimes each scenario/level, and bear no relation to reality. What we strive for is a game where real world tactics actually work. It’s not the easiest path to take, but it is the most rewarding.
If you’re a genius C++ programmer, you understand exactly how difficult this problem is, but still think it’s the most interesting code problem in the world, apply for a job. We’ll find space for you.
Who is this game for anyway? – By Mike Simpson
Our guiding principle with design is that we make the game we want to play, and trust that other people will like it. That inevitably means we make the TW games for the hardcore fans rather than for the more casual gamers that are possibly the majority of our customers. We believe that if we succeed in making a game that the fans like it will by definition be a great game, and the because of its quality casual players will like it too, so long as we make it accessible. We need both groups (casual and hardcore) to get enough money in to allow us to keep making the games, so one of the tightropes we walk is the balance between accessibility and depth. Great design manages both, and that’s what we strive for (occasionally successfully!).
We do however also have another customer who we make the game for, and in one particular way they are the most important of all. It’s our publisher, who is driven by the grim necessity of commercial reality. Those necessities tend to be short term compared with the dev time of a game or the lifetime of a series. They are also necessities that we cannot ignore – if we do it’s Game Over. Empire: Total War happened the only way it could – it had to be in a box in Feb 09. Damned stressful for all concerned, but it’s so much a fact of life it’s almost not worth talking about.
I think some people think that when “commercial reality” wins, they lose. If the car parks at Sega or CA were full of Ferraris, I might agree. But they are not. When “commercial reality” wins, we live to make another game.


