Making it in Unreal: Waves 2 is a twin-stick shooter powered by an AI secretly playing a CCG

Waves 2

Faced with recapturing the shuffling, bitter-ex RnB magic of Cry Me A River, Justin Timberlake and Timberland took the most direct route they could – replaying the hit over and over, reworking and jamming, until voila: What Goes Around came out. Same rhythm, same vibe, new hit.

When it came to following up the popular twin-stick shooter Waves, creator Robert Hale took a similar approach, though with marginally less beatboxing. Once Unreal Engine 4 launched, he began his sequel by porting the entire original game into the new tech, before tweaking and taking advantage of the new tools and space to experiment that the new engine gave him.

With Waves 2 in Steam Early Access, that process continues now, as Hale designs and redesigns in pursuit of the perfect neon arcade game. It’s tricky to get it just right – especially since Hale isn’t just designing the one game. He’s also built an invisible AI to work against you in a card game you don’t know you’re playing. All in the pursuit of more satisfying twin-stick shooting.

Gaining frames

Hale built the first Waves in Unreal Engine 3, using its proprietary Unreal Script. Switching to the new engine has given him the opportunity to learn C++ for the first time in his professional life, and the game has benefited for it.

“When I released Waves, it was actually struggling to get 60 frames per second on the modern hardware at the time,” he tells us. “Considering that it’s just a twin-stick shooter, a top-down arcade game with not much going on graphically apart from particle effects, that’s kind of a big deal.”

Waves 2

The moment he ported Waves over to Unreal Engine 4, Hale was able to hit 300fps. In other words, he had 240fps he could afford to lose. “That just made me go, ‘Well, I can do whatever I want now. I can just throw whatever I want at this and it’ll probably be fine’,” he says. “And to date it has been.”

As a result, Waves 2 is a faster and more frantic game. Its screen fills up with far more enemies than that of its predecessor, and its levels are more layered and complex. “Before, I would have to think really, really hard about how I was going to pull that off, or if I could pull it off at all. Now it’s just a case of knowing I want to do it.”

The other game

The twin-stick shooter is actually just one of two games going on in Waves 2. Beneath the surface, a purpose-built AI is playing a card game against them, making tactical choices that guide the flow and spawn rate of its levels.

“In the first game, one algorithm would work out what to spawn and when, based upon how well you were doing,” Hale says. “But that’s a very nebulous concept to try and distil into maths. How well is the player doing? What does well mean?”

How well is the player doing? What does ‘well’ mean?

Robert Hale

Designer

Traditionally, score attack games get harder the longer you play in each session. The obvious way to make Waves 2 harder, then, would be to spawn lots of low-level enemies that can feed you combos that build your Adrenaline, which is spent on powerful burst attacks like bombs. But it’s not as easy as that. The spawning system therefore required a more thoughtful solution and for Hale and his game it came in the form of AI.

“In the background of everything that’s happening in Waves 2 is an AI that’s playing a card game against the player, who is playing a twin-stick shooter,” Hale says. “It’s essentially similar to how the Hearthstone AI works.”

The AI has a hand of spawn cards, and looks at each to decide which is the most appropriate to play given the current game state. And just like a Hearthstone player, it’s constantly looking for counters to stop you in your tracks.

“It’s got the capability to look at the things that killed you recently, and to prefer cards that have those tags on them,” Hale says. “So if you got killed by the little green guy that dodges all of your bullets, it weights those cards higher.”

The AI has a limited amount of mana to spend on spawn cards, which is dictated by how the player performs. As a result, it’s sometimes forced to play cards that work in your favour. “That was the other part I liked,” Hale says. “Because it doesn’t have complete control over what’s in its hand, it will sometimes have to spawn something that is beneficial to the player.”

Next time you play Waves 2 and find yourself in a winning streak, you ought to feel doubly proud – it’s not just one game you’re besting, but two.

Waves 2 is on Steam Early Access. Unreal Engine 4 development is now free.

In this sponsored series, we’re looking at how game developers are taking advantage of Unreal Engine 4 to create a new generation of PC games. With thanks to Robert Hale.

 
Source

Early Access, Indie, Waves 2

Read also