You might have noticed I've been using this blog as my answer file. Every post answers a question that's too important to leave unanswered but too complicated to explain in casual conversation.
One question I run into is: "Don't you think we're moving toward special-purpose AI hardware, in the same way that the ATI and nVidia GPUs accelerate 3D graphics?"
This post explains why that will never happen, and why we should be happy that it won't.
1. There's no standard definition of "AI." It means something different in every game.
You can't make special-purpose hardware if you can't define what the special purpose is.
We've been able to achieve huge performance improvements with specialized graphics hardware because there's a set of very well-understood algorithms needed to transform, texture, light, and rasterize polygons. Everyone uses this same functionality for rasterized 3D graphics, and as a result, ATI and nVidia have been able to design GPUs to optimize that functionality.
The problem is, AI doesn't have any equivalent set of algorithms.
Instead, we have a big toolbox of techniques, and everyone uses different tools from the toolbox.
It's not because we're lazy or too stubborn to share our secrets with each other. It's because our games really are different and they have different needs.
Unlike 3D graphics and physics simulation, "AI" is not a well-defined problem. Depending on who you talk to, "AI" means anything from "creating entertaining and believable characters" to "simulating aspects of human intelligence" to "creating tools to let game designers design behaviors that meet the goals of the game design."
Imagine you get 5 AI programmers in a room together. One works on real-time strategy (RTS) games, one works on first-person shooter (FPS) games, one works on third-person God-of-War style melee action games, one works on 2D fighting games, and one works on basketball games.
The RTS programmer says, "I use influence mapping for strategic analysis." None of the other AI programmers use them.
The fighting game programmer says, "I have a lot of finite-state machines (FSMs) defining the animation systems for the characters in my game with lots of event-based communication between the FSMs so I can keep them in sync while they're fighting." The RTS, FPS, and basketball game programmer all hate FSMs and prefer to use behavior trees and planners.
The FPS AI programmer says, "I use A* on navigation meshes for pathfinding." The strategy game AI programmer says, "I use A*, too, but I use a grid, since that gives me random access to any cell in the grid, and I can get away with it because all the gameplay happens on a flat 2D plane." None of the other 3 AI programmers have pathfinding in their games at all.
The basketball game programmer explains that most of his work involves controlling entire teams of basketball players and getting them to understand the rules of basketball and the successful strategies in different situations and play the way a basketball team would. The RTS and FPS programmer also use squad-level AI, but in completely different ways. The 2D fighting game AI programmer doesn't have any need for it, and the third-person melee combat game programmer doesn't use it either since most of the enemies in his game are either zombies (who are too stupid to coordinate) or bosses (who the player fights alone).
There's no room for specialized hardware here. Any hardware-level optimizations that would improve performance for one kind of AI system would be useless in most of the other kinds of games.
2. Performance improvements in current-generation AI won't make a noticeable difference. The big innovations will require new game designs.
Game AI has been using 1-10% of CPU for the last few decades. As a result of that, we've been forced to adopt very fast algorithms for pathfinding and decision-making. There's not much room for improvement there.
Yes, in theory, we can make things like pathfinding, spatial analysis, planning, influence mapping, and behavior trees faster with special-purpose hardware.
In practice, these aspects of AI are not big issues anyway. A hardware accelerator card for pathfinding, for example, might let us use 3% of CPU instead of 5%. Any "accelerator" that only gives you 2% of your CPU back isn't worth the circuit boards it's printed on.
There's no doubt that in the long run, we're going to find all sorts of new applications for huge boosts in computing power. But for that to happen, the way we design games will have to change.
3. Bad AI rarely comes from a lack of computing power.
In cases where AI is broken, throwing more hardware at the problem isn't going to help the situation since it's addressing the wrong problem.
In every single case I've seen where a game had AI problems, the reasons had nothing to do with the hardware. Broken AI is almost always a result of bad engineering, bad design, bad planning, software problems (such as an underlying game engine that was too unstable to support productive AI development), or a lack of resources (not enough time in the schedule, not enough AI developers in the industry).
In general, there's very little correlation between the hardware platform and the quality of game AI. Some of the most powerful hardware has some of the worst game AI, and vice versa.
4. It's a chicken-and-egg problem. The hardware will never gain traction.
No one will buy an AI accelerator card unless games support the functionality they provide. No games are going to support the functionality of AI accelerator cards unless there's a big enough market for it.
Adding AI-related features is expensive.
When ATI and nVidia add new graphics functionality to their video cards, it's (usually) possible to add support for that in your game without making major changes. In a lot of cases, a graphics programmer spend a few hours, days, or weeks tweaking the code to support the hardware features, and you can post "before" and "after" screenshots showing how much better your game looks with the new functionality.
That's not possible with AI. In order for AI functionality to be noticeable, you have to redesign your game to make those AI features visible. That's too expensive.
5. Even the graphics guys are moving away from special-purpose hardware.
Over time, graphics programmers have come to need ever more programmability from GPU hardware. Graphics chip vendors have felt the need to push for ever greater programmability to distinguish themselves from the competition.
Simultaneously, Moore's law has forced CPUs in the direction of parallelism. The PC, Xbox 360, and PS3 all now support different flavors of multicore computing.
These two trends may be starting to come together in an interesting way.
Intel's recently-announced Larrabee architecture seems to represent a very interesting convergence of the programmability of a CPU with the throughput performance of a next-generation GPU.
Current-generation GPUs are hard-wired for 3D rendering and can only be used for AI in some extremely rare situations. With Larrabee, it will be possible to run high-level AI code written in C++.
As I explained previously, there is no silver bullet. Most of the problems game AI developers face are related to planning, design, production, and software technology. Hardware won't help us too much with those issues. Also, the really big advances in game AI will take time, and they'll benefit the most from entirely new kinds of game designs that may be a long time coming.
But there's no denying that this approach to hardware opens up some very exciting new possibilities. Whether Larrabee itself is successful or not, this overall kind of approach is exactly what game AI developers need to open the door: a high-throughput, fully programmable, large-scale multicore system.