Walk and Think like a Skeleton – Part I

Posted on by in Development, AI

Even the best of combat systems would be for naught, if the enemies stood motionless waiting to be decapitated. That’s why we put so much effort into improving the AI of our demonic creatures. Today we want to tell you more about the Artificial Intelligence in general and how it exactly works on the example of the Skeleton hordes in Hellraid.


Let’s start with the basics: what the AI of the in-game enemies really is. To put it simply, it’s a collection of abilities and actions, the interdependencies between them, and the rules of their occurrence. Many game developers try to predict single-handedly dozens if not hundreds of various situations that may occur in the game and then include them in the code. With Hellraid, though, we use a more advanced technique called HTN Planner. Not only does it analyze scrupulously the whole situation around any AI unit, but also adjusts their behavior to dynamic changes of gameplay conditions.

You can say that the HTN Planner is a kind of the AI’s thought process that also checks if particular conditions have occurred. The first stage is to determine if the enemy should see or hear the player at the moment (for example, they can be separated by a wall) and consequently take any action. The subsequent stages are concerned with the distance between them, the terrain configuration and placement of obstacles, other AI units nearby, and so on.

An important element of the HTN Planner are the tools that measure the duration and frequency of given actions. This way, the AI is never caught in a loop of infinitely repeated actions. The result is obvious: the enemy doesn’t walk in circles and uses more than one type of attack.

The simplest example of AI is a Skeleton that approaches the player and attacks him mindlessly the moment it sees him.

When we started the development of Hellraid, we set the goal to have very aggressive AI. However, the result was quite disappointing. The Skeletons would swarm the player and attack all at once. Soon it became clear to us that it wasn’t such a good idea.

The Skeletons would either walk in a single file like geese or clog a narrow corridor. What’s worse, when they got to the player, they would obscure his or her field of vision completely. Not only did the player have no chance of escape, but she or he couldn’t even fight back, because the incessant storm of blows from all sides blocked the player’s attacks.

After a series of playtests, we came to the conclusion that the Skeletons should be smarter as well as more creative. The first step was to divide the Skeleton hordes into subgroups based on their battle skills: from typical cannon fodder, to cunning units, to the formidable Skeleton Warriors. Their skills are reflected in the equipment, which we discussed earlier.

Another decision was to make their behavior more realistic. We knew they should resemble the actual reactions of warriors from a real battlefield as much as possible. We will tell you how exactly we achieve it in our next blog update. Till next time!

Comments (14)

Some suggestions, what about adding a Nemesis system like they have in "Shadow of Mordor", a 3rd person perspective would be nice, randomly generated AI at random spots in the game where possible based on health levels etc

Scott Joy stops for no man, living or dead. Scott Joy will crush his enemies, drive them before him and hear the lamentation of their women (even the undead ones).

Patience People, Have you ever made a game? I'm thinking not... give them time. Swarming isn't all bad, Those pist off skellys have been waiting in hell for an eternity to rip you to shreds! Forms of crowd control could help, based on the Equipment and AI level whether they resist it or not, the duration of cc, etc. IE: Hoarfrost Smash weapon to the ground, causing an Icy Blast that freezes lesser enemy's (only) solid. Oh and don't make it have a casting time, just gonna get swarmed and interrupted.. very frustrating

Very interesting, BUT ! bla bla bla where are new gameplay videos (promised long long ago) ? Just tell us anything about release date/early access/beta.

The latest scientific advances in video game skeletons, I love it.

will you give some kind of update on the release date soon? pls dont just say "when its ready", since that can take more than a year

Really Nice improvement!

Do you plan to make AI scripting
Possible afterwards?

And if there will be bots in coop
That use the same AI ?

The game looks very promising. Thanks to the devs. for keeping us informed through the blog.
I've got a technical question for the devs. : Which version(s) of DirectX will Hellraid use ?

Writing a good AI for a game is very difficult the behavior has to be/seem clever and realistic while still giving the player enough chances to be fun.
Your work is central for the fun the game provides. I'm really looking forward to playing it and seeing all the different AI patterns in action :)

Nice post, much more interresting than my actual AI lecture.

Good to see you're working on AI. I just hope that the enemies will be more diversified and no just skeletons and zombies.
Keep up the good work, i can't wait to see the next gameplay footage.

Great read ! look forward to seeing them in action !

Some more awesome progress, Can't wait for more info. Keep up the good work hellraid team!

Click clack click clack NYEHEHEHEHEH

Add comment »