Skip to content
IFAI

Industry

How machine learning is replacing behavior trees in game design

Published Reach 44

Eidos-Sherbrooke researchers just demonstrated a prototype combining Unreal Engine's Environment Query System with machine learning to drive enemy AI. Instead of wrestling with complex behavior trees, designers can easily tweak difficulty values. The goal isn't superhuman bots, but enemies that adapt to keep gameplay challenging and fun.

How machine learning is replacing behavior trees in game design
Image: aws.amazon.com

We have all been there: a game boss either feels like an unfair meat grinder or moves so predictably it is boring. Tuning that sweet spot usually takes game designers weeks of wrestling with massive, tangled code trees.

At Unreal Fest 2022, Eidos-Sherbrooke machine learning researchers Romain Trachel and Alexandre Peyrot showed off a very different approach. They combined machine learning with Unreal Engine's Environment Query System (EQS) to see if neural nets can make enemies smarter to build, not just harder to beat.

Giving Unreal a brain

Most modern game AI runs on behavior trees. These are massive branching flowcharts of if-then statements. If you want to make an enemy slightly more aggressive, programmers and designers often have to spend hours adjusting variables across dozens of nodes.

Trachel and Peyrot split the problem in two. They used Unreal's EQS as the AI's eyes and ears to pull spatial data from the map, and then fed that data into a machine learning model that acts as the brain.

In their demo, which basically works like a top-down Pac-Man, the player dodges a stalker while collecting orbs. The pursuer is not running on fixed scripts. If a designer wants a harder chase, they just dial up a single reference value in the engine, letting the model handle the navigation logic underneath.

The camper problem

Building an unbeatable game AI is actually the easy part. Deep Blue and AlphaStar already proved machine learning can crush humans. The real problem is making a bot that is actually fun to fight.

The researchers learned this the hard way when experimenting with a multi-output model trained to predict player paths. The AI quickly figured out the optimal winning strategy: it just camped right on top of the objective orbs. It won consistently, but the game was miserable to play, so they scrapped the demo.

Their goal is not superhuman bots, but saving production time. Outside combat, teams like Modl.ai are already using adaptive machine learning bots to speed up QA. Modl.ai cofounder Julian Togelius said the company has spent years using AI agents to sniff out game-breaking geometry bugs and unwinnable scenarios, and is now prototyping models that mimic human play styles across different titles.

Why it matters

We think this research highlights a fundamental truth about gaming: players do not want the smartest possible opponent; they want the best sparring partner.

In chess or StarCraft, a cold, calculating algorithm is great. In an adventure game, an AI that optimizes purely to win will just spawn-kill you or camp in a corner. What makes Eidos-Sherbrooke's method clever is pragmatism. Instead of inventing an exotic new stack, they plugged lightweight machine learning directly into standard Unreal Engine tools, letting designers tweak challenge without drowning in behavior trees.

The catch is predictability. Game directors are control freaks for a reason; pacing requires tightly scripted emotional beats. Because neural networks are notoriously hard to debug when they misbehave, we likely will not see fully machine-learning-driven bosses in major AAA titles tomorrow. The immediate payoff will be in game testing, where bots from teams like Modl.ai do the grunt work of finding exploits before humans ever log in.

Sources (2)

  1. [1]
    cacm.acm.org(opens in a new tab)Originalcacm.acm.org
  2. [2]

Best of AI, daily