informa
/
Featured Blog

AI Isn't a Subsystem

Demystify AI by viewing it as an extension of existing subsystems.

When building a game we have the traditional divisions of code: graphics, sound, input, AI, physics, gameplay, and the menus.  Of these, AI tends to be built later in the product's creation because it either depends on other systems working first or it's unclear how to begin.  But does AI need to be its own subsystem at all?  Most game AI falls under one of three types of algorithms: the planner, the pathfinder, and combat.  If AI is not its own subsystem, then where do these algorithms live?

A character-controlling AI can masquerade as a type of hardware controller. Characters, both PC and NPC, are coded agnostically with respect to what hardware or software "pushes their buttons".  AI is then a kind of keyboard or joystick. The AI 'controller' would need gamestate fed to it which the joystick does not.  But in a way the joystick controller does receive gamestate as well: through the graphics and sound outputted to the human who in turn outputs to the joystick.

AI can be viewed as a hinting or how-to-play system taking its own advice.  If the hint system advises pressing Jump to bypass an approaching chasm or highlights where to stand in relation to a mobile opponent, then it is capable of pressing the buttons itself. The harder part was knowing when or where to act, not the difference between describing or performing the act. 

AI can also be viewed as physics.  An enemy patrolling back and forth in a platformer moves the same way as a moving platform does, but we'd be tempted to use AI for one and physics for the other. We think of things like gravity and momentum as outside forces acting upon us while dashing and jumping as forces from within because that's how reality works, so of course we tend to code it the same way. But it's all just movement and state changes as far as the code cares.

Many first-time videogame creators tend to save AI for last because it is the least obvious how to go about doing so. Their libraries of code have ready-made functions for graphics, sound, and input, but even if there's a pathfinding function on offer, it's not entirely clear what to do with it.  Viewing AI as extensions of other systems is a simple way to demystify it.

Latest Jobs

Sucker Punch Productions

Bellevue, Washington
08.27.21
Combat Designer

Xbox Graphics

Redmond, Washington
08.27.21
Senior Software Engineer: GPU Compilers

Insomniac Games

Burbank, California
08.27.21
Systems Designer

Deep Silver Volition

Champaign, Illinois
08.27.21
Senior Environment Artist
More Jobs   

CONNECT WITH US

Register for a
Subscribe to
Follow us

Game Developer Account

Game Developer Newsletter

@gamedevdotcom

Register for a

Game Developer Account

Gain full access to resources (events, white paper, webinars, reports, etc)
Single sign-on to all Informa products

Register
Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Subscribe
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more