Sponsored By

Fine-tuning the AI in Rupeck's proc-gen platformer Caveblazers

Caveblazers mixes up the procgen platformer style of games like Spelunky by adding intelligent AI behaviors to enemies, and to NPCs that can become potential allies.

Jack Yarwood, Contributor

June 30, 2017

6 Min Read
Game Developer logo in a gray background | Game Developer

New roguelike titles seem to appear on an almost hourly basis in the Steam store. This has made it extremely difficult for developers to get their video games noticed.

Caveblazers follows the standard Spelunky-like formula: you enter a cave and must clear each subsequent level by finding an exit hidden somewhere on the floor. Will Lewis of Rupeck Games, knew he had to do something different to stand out.

Intelligent combat AI and the addition of friendly NPCs presented the solution. The way that NPCs behave in Caveblazers truly sets it apart. You’ll make allies who will fight alongside you. 

You’ll also fight orcs, blobs, and goblins, as well as bosses, with unique attack patterns. It gives Caveblazers a unique twist on randomly generated platforming, providing a greater emphasis on combat and strategy.

Planning around the environment

Lewis originally had the idea for Caveblazers after playing the classic version of Spelunky by Derek Yu. As much as he enjoyed that game, he longed for a more combat-focused experience, with enemies capable of greater movement.

To achieve his goals for the game, Lewis needed to create AI-driven characters that could challenge the player and respond to changes in the procedurally-generated environment.

The addition of a wall-jumping ability helped to accomplish this. Orcs, hobgoblins, and other enemies pursue you through each level. If they come to a wall, they won’t stop or return to their starting positions, they’ll simply climb walls or maneuver themselves to a platform to fire projectiles at you.

This makes the moment-to-moment play of Caveblazers nervewrackingly unique.

Making distinctive enemies

“Having smart AI characters in the game is a big difference in my eyes," says Lewis. "I don't like enemies in other platformer games that just walk up and down endlessly on platforms and only damage you if you brush up against their backside. The slimes in Caveblazers are pretty mindless, but there's also smart orcs, goblins and friendly human characters - all of whom can find their way around the level as well as you can, wall-jumping, picking up items, drinking potions, fighting one another."

Caveblazers’ enemies have a range of different behaviors. They will all follow the player, but only the goblins and orcs need to be provoked, as they sit around campfires and rest.

Then there are different attack patterns and range of movements too. Bats, slimes, and jumpers will leap towards the player, while goblins and orcs will use a variety of ranged and close combat attacks, climb surfaces and traverse platforms. This creates a need for bespoke strategies for every situation and every combination of foes.

“If you don't have a plan going into combat with these guys, or if you're rushing through the level clumsily, you're going to get hurt,” says Lewis. “There's a bunch of items in the game you can use to deal with them; you can lay traps on the ground, chuck various bombs and orbs in their general direction, and use powerful magic items against them. A lot of the time, you'll also be able to get past them without them spotting you if you don't think you can handle them.”

Creating friendly AI

Friendly NPCs are another addition that distinguishes the game from other similar titles. While they do appear in other games in this genre, like Flinthook, they’re usually stationary or act as merchants that sell you gear. In Caveblazers, these characters aren’t passive, but will get involved in the action, behaving much like another player might.  

“Just like the player, they'll run around the level smashing stuff, fighting monsters & grabbing items, eventually making it to the exit door,” states Lewis. “If you fight alongside these guys, though, they'll become friendly and start following you around the level and helping you in combat situations.”

He continues “They add a really interesting dynamic layer to the game, they don't necessarily make the game easier, they could take out a big group of monsters that was in your way, or they could end up pulling them in your direction and getting you both killed. I also really like how clumsy they are - they'll quite often fail a jump and end up on spikes, just like players will.”

While the overall story of the game may be quite simple, these NPCs create many interesting scenarios. They can accompany you through the whole of your run or die only seconds after your initial meeting. This means you’ll always have something to talk about when you exit the game -- no matter how far you get.

Limiting random behavior

There were a few issues, however, that needed to be addressed with the AI. These mostly related to random behavior, which needed to be toned down so that players could recognize attack patterns, collect items efficiently, and better formulate strategies. 

“My initial idea was to have [NPCs] as random as possible,” admits Lewis. “Random levels of aggressiveness, random levels of greediness, random levels of ability to traverse the level, etc. Through the game's Early Access period I realized that this is not what players want; players want more predictable AI that they can learn patterns of. They need their strategies about how to tackle these guys to always be viable strategies.”

Common complaints during the Early Access release were that the human AI characters were too aggressive and would horde loot. They also had a random amounts of health, which sometimes made them extremely difficult to beat. These issues needed to be tweaked before the final release, to make the game less frustrating and more predictable for players.

Lewis removed aggressive human AI entirely, and added wind-up animations to the enemies to solve these problems. He also decreased the randomness of the AI, meaning human characters are far less likely to be a hindrance. They also now drop all of the items they’ve collected upon death, instead of taking it with them into the digital afterlife.

The result of all this is a pseudo-multiplayer experience that feels both challenging and distinctive. Lewis has clearly been successful in bringing a more methodical style of gameplay to the genre, achieving this through the use of diverse AI and increased enemy mobility. 

“I think the AI in Caveblazers worked out pretty well," he allows. "There's definitely a lot more that could be done with it to make characters appear smarter... but do they really need to be any smarter?”

About the Author

Daily news, dev blogs, and stories from Game Developer straight to your inbox

You May Also Like