informa
2 MIN READ
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

Xbox Game Studios

Redmond, Washington
10.5.22
Technical Lighting Artist

Innogames

Hamburg, Germany
10.5.22
Game Designer - Elvenar

Six Foot

Houston, TX
10.3.22
Six Foot Director, Player Relations

Hometopia Inc.

Remote
10.7.22
Lead Engineer
More Jobs   

CONNECT WITH US

Explore the
Subscribe to
Follow us

Game Developer Job Board

Game Developer Newsletter

@gamedevdotcom

Explore the

Game Developer Job Board

Browse open positions across the game industry or recruit new talent for your studio

Browse
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