Brain Training

Brain Training

By Develop

November 15th 2007 at 2:18PM

Not so long ago, AI was the ingredient many thought would bring about a revolution in gaming. And then physics came along and stole its thunder, leaving it to flounder. We look at what todayâ??s consoles can do to train gamesâ?? brainsâ?¦

There’s a bit of a problem with AI. But it’s not some insurmountable scientific barrier, and neither is it a technological constraint. Rather, the problem is that it largely exists in the eye of the beholder.

While a complex physics engine produces easily observable, predictable results – shove a pile of boxes and they will topple, push a barrel down a hill and it will roll – AI is much more of a mythical force, one that has less immediately visible effects. That’s not to say that the line between convincing, intelligent behaviour and blindly running into a wall isn’t distinct – clearly, it is – but that it’s an extremely thin line, breaking a binary boundary between ‘great’ and ‘awful’.

So, how do you make sure you stay on the right side of the divide? The key to making characters behave in a realistic manner, says PathEngine’s Thomas Young, isn’t in using brand new AI techniques, but in applying currently existing techniques in a uniform way.

“As a game player I see many aspects of game AI that could be improved to make a big difference to my game-play experience, but essentially are all about making known techniques work correctly in a context; about implementation nuts and bolts.

“For a game developer, the key issue is making techniques apply absolutely robustly in all kinds of situations.”

In essence, there’s no point in using new fancy AI techniques if they don’t fit or can’t be relied on to always provide acceptable results.

NEURAL MELTDOWN
For example, much talk was previously focused on neural networks, an area of AI that aims to approximate the brain’s structure to provide a similar learning/judgement model.

Despite featuring a topology suitable for learning – an often-requested feature in games – their usage never took off as some expected. Training the network to give acceptable outputs takes time and can require significant horsepower, and the ‘network’ structure means that they act like a black box; the rhyme and reason behind outputs lost amongst a tangled nest of arcs.

But neural networks are just one example of several ‘vogue’ techniques that have been developed in the AI research field and jumped on expectantly by developers, only to discover non-suitability. “Few AI concepts are used in gaming because AI is a very broad domain, from cognitive science to natural language or advanced data mining,” explains Pierre Pontevia, CEO of Kynogon. “Most of these domains aren’t relevant for game programming.”

The fact is that, unlike many other areas of game development, AI isn’t driven by research into new techniques because the aims of the researchers are so different to those of the real-world implementers.

“The world of academic research tends to be about demonstrating something new and interesting, at a high level, with the actual engineering details not so important – but in the world of game development things are the other way around,” admits Pontevia.

FINDING YOUR PATH
It’s fitting, then, that AI middleware doesn’t approach the problem in quite the same way that other middleware does. While Havok might be a complete solution to providing accurate physics in a game, there’s little such ‘full solution’ AI middleware available on the market. Think about it: would you want your AI to act exactly like it does in your competitors’ games because you’d used the same behaviours?

As such, a large amount of the AI middleware available automates low-level, but absolutely crucial, elements like pathfinding – something that doesn’t sound nearly a sexy as neural networks or genetic algorithms, but is far, far more essential, and can make or break your game.

Kynogon, which counts dynamic pathfinding as one of the key features of its Kynapse technology, distinguishes the sorts of tasks that middleware can provide from the ones that have to be developer controlled. “We split game AI into two fields – ‘Decision AI’ and ‘Action AI’. Decision AI is the decision making: why a character does something and makes certain decisions, whereas Action AI is about how the character will do what it has decided.

“Decision AI is very gameplay specific and constrained by scenario, so if there are evolutions in this domain they will come from the game designers. But we focus on Action AI with key components such as 3D pathfinding and special reasoning.”

Time was, pathfinding meant an implementation of A* or one of its variants, often accompanied with pre-calculated navigation meshes based on level topography, but these days things have changed significantly. Thanks to the advent of advanced physics simulations in games, levels now tend to be littered with more objects that can – and frequently do – move and scatter. As such, relying on pre-calculated walk meshes alone is a less feasible prospect, as objects need to be dynamically circumnavigated or avoided, whole routes recalculated on the fly.

Doing this in real-time on previous-gen consoles would have been impossible, but the parallel nature of modern console architectures means that these calculations can be offloaded to another core or SPU.

“Multi-core technologies enable the game developers to spend much more resources than were possible before,” elaborates Dr. Andreas Gerber, CEO of AI behaviour technology company Xaitment. “Implementing believable AI on the last generation consoles was just not possible.”

These parallel architectures are also enabling larger amounts of intelligent agents on screen at once, realistically populating the large worlds that players have come to expect in contemporary games. “We’re seeing more scenes with crowds of characters that can display complex behaviours, like panicking or rioting,” explains Robert Kopersiewich, VP of product management at Presagis, the developers of AI.implant.

BRAINS OF THE FUTURE

So if the future of game AI isn’t in new revolutionary concepts or models, where does it lie? Most agree that it likely lies in improvements in current techniques, but there are areas into which research is being applied.

One such area is that of spatial reasoning, says Pontevia: “Pathfinding tells you how to go from point A to point B, but spatial reasoning tells you why B is an interesting destination.

“You need to be able to dynamically analyse the 3D topology to identify interesting locations, such as hiding places, access ways and threatening zones. Being smart starts with understanding properly your environment.”

And the future? TechExcel’s CEO Tieren Zhou imagines a future where games are all like virtual worlds: “Characters could adapt themselves to change, not based on pre-defined characteristics. That would make games more adaptive, more exciting.

To build characters with infinite change, and with self-adapting and self-forming capabilities, AI will play a significant role.”
Such a vision may seem far off, or even a nightmare to some designers, but in reality the latest hardware makes this sort of autonomy a more viable prospect.

“The time is right for significant advancements in AI,” says Kopersiewich.

But nothing will happen until developers see the need for it. Despite being a hot topic in previous years, AI would appear to some to have fallen as the gaming zeitgeist. Adds Gerber, that doesn’t mean it’s any less important.

“Physics was the hype of yesterday, but now every game does it. Every game has a complex graphics engine. The only thing games can differ is AI, but only when game studios and publishers spend more resources on AI. If only one to three per cent of the budget is spent on AI, it’s clear that the results won’t be adequate.”

INTELLIGENCE GATHERERS

Xaitment
www.xaitment.com
andreas.gerber@xaitment.com
+49 (0)681.9593.140 (EU)
+1 (415)259.6253 (US)

Kynogon
www.kynogon.com
info@kynogon.com
+44 (0) 1372 454083 (UK)

PathEngine
www.pathengine.com
partners@pathengine.com
(+33) 4.78.27.06.02

AI.implant

www.ai-implant.com
info@presagis.com
1-800-361-6424 (US)

TechExcel
www.techexcel.com
emeasales@techexcel.com
+44 (0) 208 322 7750