How to teach an AI parkour

When all you expected to be able to do in a third person action game was press a button to jump over a gap, 'traversal' in level design wasn't that hard. Adding the odd bit of scenery you can vault over isn't much harder: level designers place markers that tell your character they can vault, and what animation to play to make it look right.

But full free-running over complex terrain has become an expected feature, and the job of manually marking which bits of a level you can climb, vault or scramble over has become dauntingly huge. At GDC in San Francisco last week, Ben Sunshine-Hill of Havok explained a solution they're offering to developers as middleware: AI.

Havok's AI middleware is essentially doing the painstaking job of a level designer intuitively deciding how characters should vault or jump over each bit of terrain, but automatically, and for every possible spot in the level.

Those calculations are difficult: checking every pixel of the space between you and your destination would take an impractically long time. So Ben's invention is a set of clever maths tricks to that make these calculations much quicker.

How? Well, this bit gets tricky, and I'm not as smart as Ben, so I'll butcher his deeply technical talk in layman's terms as best I can.

Each one of these checks comes down to: “How do I get from here to there, if there's an obstacle in the way?” That involves checking for collisions along an arc that represents the trajectory of a jumping animation - imagine firing a jet of water to land where you want to go, and seeing if the jet hits anything. If it does, that doesn't mean you definitely can't vault the obstacle - other animations might be able to clear it, so you need to fire different jets to check those too.

Ben's system tests a whole row of starting positions at a time, and checks the possible trajectory arcs from them all in the same direction. Picture a lawn sprinkler firing all its jets at once in parallel arcs. The system makes a note of where each jet first hits something, and stores all that information in a graph.

The benefit of this is that most of the really tricky calculations about which animations will fit can then be applied to this simple, 2D graph. It's a little cheat sheet of all the possible things you might hit and where they are. It's much easier to look at that graph and see, 'this whole set of positions on the left are all totally clear, so our vaulting animation will work fine in all those positions.'

It's called segment casting, and it's the magic bullet that makes Havok's system efficient enough to be feasible. With it, something that used to take human intelligence - and a huge amount of time — can be automated.

The same system can be used to handle even trickier stuff, like irregularly shaped low walls. Yes, it's low enough to vault over, but where should your character put their hand? If it's a craggy, irregular ridge, you need to find a spot that's close to where you are, but isn't too low, and isn't too sloped that your hand would slip off. So again Havok's system fires its sprinkler array of arcs downwards, maps out where each part of it hit something, and manipulates that much simpler data to find the natural place to put your hand.

What's the benefit of this to the gamer? Changing this from a huge, time-consuming human task to something you can solve automatically with middleware makes it much more viable for developers to let you clamber on stuff. In short, it means more free-running in games, which feels nice and is cool.

It may also lead to better free-running: humans aren't perfect, and if you've ever played a free-running game and found yourself stopped by a piece of the level you 'should' be able to vault over, you know things get missed. If and when it's perfected, this technology could solve that reliably.

But for me, the most interesting thing about this system is that it's needed at all. Listening to the technical challenges involved in creating it is a startling glimpse into the insane amount of complexity and work that goes into free-and-easy movement in a game. Ease is hard.

Latest in AI
Image for
'No real human would go four links deep into a maze of AI-generated nonsense': Cloudflare's AI Labyrinth uses decoy pages to trap web-crawling bots and feed them slop 'as a defensive weapon'
CHINA - 2025/02/11: In this photo illustration, a Roblox logo is seen displayed on the screen of a smartphone. (Photo Illustration by Sheldon Cooper/SOPA Images/LightRocket via Getty Images)
'Humans still surpass machines': Roblox has been using a machine learning voice chat moderation system for a year, but in some cases you just can't beat real people
OpenAI logo displayed on a phone screen and ChatGPT website displayed on a laptop screen are seen in this illustration photo taken in Krakow, Poland on December 5, 2022.
ChatGPT faces legal complaint after a user inputted their own name and found it accused them of made-up crimes
Public Eye trailer still - dead-eyed police officer sitting for an interview
I'm creeped out by this trailer for a generative AI game about people using an AI-powered app to solve violent crimes in the year 2028 that somehow isn't a cautionary tale
Closeup of the new Copilot key coming to Windows 11 PC keyboards
Microsoft co-authored paper suggests the regular use of gen-AI can leave users with a 'diminished skill for independent problem-solving' and at least one AI model seems to agree
Still image of Bastion holding a bird, taken from Microsoft's Copilot for Gaming reveal trailer
Microsoft unveils Copilot for Gaming, an AI-powered 'ultimate gaming sidekick' that will let you talk to your console so you don't have to talk to your friends
Latest in News
The snazzy red and black HyperX Cloud Alpha wireless headphones float in a teal void. The microphone is attached to the headset.
The best wireless gaming headset is now even better in the Amazon Big Spring Sale, boasting a more than $50 discount
A chip being held up in an Intel fab
Intel is reportedly 'working to finalize commitments from Nvidia' as a foundry partner, suggesting gaming potential for the 18A node
Amazon box
Don't panic! The 'Do Not Send Voice Recordings' option Amazon just removed was only used by 0.03% of customers and they can still have it
Digital generated image of people surrounded by interactive transparent and glowing panels with data. Visualising smart technology, blockchain and artificial intelligence
Now I shall demand the cookies! Proposed new browsing agreement turns the tables and lets users dictate terms to websites
Intel CEO, Pat Gelsinger, with a 18A SRAM test wafer
Former Intel CEO, Pat Gelsinger becomes executive chairman of a 'Technology Platform Connecting the Faith Ecosystem' to work on Christian AI using DeepSeek
Assassin's Creed Shadows immersive mode - Naoe holding a tanto in her hand as two guards fall to the ground behind her.
Assassin's Creed Shadows' first hotfix addresses stability issues and a photo mode crash