Gamasutra is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Gamasutra: The Art & Business of Making Gamesspacer
View All     RSS
October 14, 2019
arrowPress Releases

If you enjoy reading this site, you might also want to check out these UBM Tech sites:


AI Isn't a Subsystem

by Ron Newcomb on 05/03/16 02:06:00 pm   Featured Blogs

3 comments Share on Twitter    RSS

The following blog post, unless otherwise noted, was written by a member of Gamasutra’s community.
The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.


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.

Related Jobs

HB Studios
HB Studios — Lunenburg/Halifax, Nova Scotia, Canada

Experienced Software Engineer
Disbelief — Cambridge, Massachusetts, United States

Senior Programmer, Cambridge, MA
University of Exeter
University of Exeter — Exeter, England, United Kingdom

Serious Games Developer
Square Enix Co., Ltd.
Square Enix Co., Ltd. — Tokyo, Japan

Experienced Game Developer

Loading Comments

loader image