Skip to main content

How King is using AI to speed up development of new Candy Crush levels

The firm has made level iteration 50% faster as a result of its playtesting bot

For King, the new opportunities offered by AI in improving and speeding up game development aren't new at all.

The Candy Crush maker has been utilising and researching machine learning and AI tech for over half a decade, which is even before it acquired Peltarion, the Swedish-based AI software company it picked up in 2022.

King's AI Labs is a sizeable department led by Sahar Asadi, and the firm has already introduced AI tools that its teams are using in games such as Candy Crush. In fact, one of those tools has already had a profound impact on the development of the hit mobile game.

"The playtesting bot we've developed gives designers, prior to releasing a level, an understanding of the game experience for the players," Asadi explains. "They can see whether the level they've created is providing the desired experience or not, and if not they can go back and refine it.

"We've also built on top of this bot a tweaking solution. If a designer says there are a few levels that don't have the intended experience, and these are the criteria for that experience, the bot can make refinements automatically. The best refined solutions are sent to the designers, and they can pick the best ones and go from there.

"The fun part for designers is to create levels. The mundane part is iterating, playing the level, looking at how it is, and if you're not happy going back and tweaking it. That manual work is mundane. The playtesting bot has been helping to reduce the time on tweaking, and that allows for more time on the creative part, which is making and innovating with levels."

Candy Crush level tweaking has been sped up significantly due to AI

AI being used to play games isn't new. We've had computers play chess against world champions for decades. But the AI that King has built isn't trying to beat humans but replicate them. And that required a different approach.

"For us, the key element about playtesting is to make sure it's human-like. A few years ago, there was this AlphaGo from DeepMind, which was playing Go against the master of Go, and the goal was to beat the best player. Here, we want to emulate our players. How do we make sure it is human-like? Let's say you're on move number two or three: [the bot] looks at the board, it looks at the possible actions you can take, and then decides what the best option is. And 'best' in this case is the one that is most probably taken by a human."

This behaviour is learnt from the data King gathers about its players, Asadi continues.

"We know millions and millions of states and the corresponding actions that [players] took. And the bot is learning this pattern. So for a new state that it sees, it can predict the most human-like response. It might not be the best option, but it's the most human one.

"We run the playtesting bot over a large amount of data. We have the level difficulty, and we have the bot estimate on the level difficulty and the overall challenge. And we will find a linear pattern, which is an indication that it is playing the game like a human. Also, we have been continuously working recently on how would you incorporate player skills and preferences into the bot so that you can make it even more human-like."

The impact of the bot has been significant. Asadi tells us that there are now 95% fewer manual tweaks being made to levels as a result of the playtesting bot, and that's led to 50% faster tweaks to the levels overall. But the bot isn't all about speed of development.

"It also really helps us to ensure the quality of the released level," Asadi says. "Is the level playable? How much shuffle does this level have? Does it give the right amount of challenge to our players? That is a factor in why we're doing this."

"The way of working is going to change There will be some shift in what skills you need in the day-to-day work"

The natural concern for employees is whether this is the beginning of the end for designers. If bots are successfully recommending tweaks to levels that designers are accepting, how long before these tools are building the levels to begin with?

"Absolutely we need designers," Asadi says firmly. "We see this as a co-pilot for designers. It's an assistive tool. What the playtesting tool provides is insights about the gameplay before releasing it. If the bot gets it right, we are sure that the insights are right. At the end of the day, the designers know what is fun and what they want from the gameplay experience. And then they can decide with these insights whether they should go ahead and release the level, or whether they should iterate more."

She adds: "What is fun? What is a good gameplay experience? Mathematically you can never explain it. The designer role is there to build that."

Candy Crush screenshot mid-match. An 8x9 grid of candies of various colors are shown, with a number of effects happening on the bottom half of the screen as various candies are matched.
The playtesting bot will play a Candy Crush level as if it's a human

What's more, these tools wouldn't be possible in the first place without the input from designers, Asadi argues.

"This whole tweaking system has been because of the close collaboration with designers. Their openness and excitement to try and get away from the mundane tasks to focus on the innovation, has been the main driver and incentivising everyone to spend time building this.

"If you go back in time, designers were using paper and pencils to design levels, then they moved to photoshop and now to new UI tools. I see this as another advanced tool that enables them to work on the things that are really skilful on. And hopefully it means we're building more exciting and interesting things."

Asadi may not believe AI will replace designers, but those mundane tasks she talks about are often the jobs that are given to entry-level employees to help them understand the processes. There are numerous people in the games industry who found their way into the business through testing, for example.

"The way of working is going to change," She admits. "There will be some shift in what skills you need in the day-to-day work. What are the new technologies and new products that we are building? So everyone's role, especially mine, is changing.

"Because of machine learning, a lot of things that engineers need to code, they don't need to anymore. When I am interviewing people today, I'm not basing it on the criteria that I used to hire people two years ago. But still, the gist of the things I need, and the understanding of machine learning, is still there."

"For other companies, AI is moving fast, but how would you integrate it technically, culturally and in terms of getting the value out of it?"

Moving forward, King's AI Labs is looking at ways that the company can get a better sense of its players and what they want at different times.

"For instance, if I sit on a bus and I have five minutes, I want to get to the level I was playing as fast as possible," she explains. "When I am sitting in the sofa, and I have half-an-hour, I might want to do different quests in the game. Getting this context and what is needed to get this joy out of the gameplay… that is something that could be rewarding for players. Part of our research is how, using foundational models and with the new developments in machine learning, we can capture a better representation and understanding of players, and feed that into the game in order to build a better experience."

AI is developing rapidly and it may only be a year or two before King's current research is implemented into its games. Yet the speed in which King can move is because of this early investment in AI tech. For other studios, the immediate opportunity AI represents will depend on whether they're ready to make the most of it.

"The landscape of AI development is changing very fast," Asadi concludes. "It makes it very exciting because it creates new opportunities to innovate, which keeps me and my team on our toes. It creates huge opportunities to bring that research into the game. But a huge factor is how ready the games are to take in these technologies. At King, we have this opportunity because we have already started, we started much earlier with some internal research, then the acquisition of Peltarion, which means we have the expertise. We have a very good connection with the game, and we're making the game ready to integrate with the AI solutions. That helps us to go fast.

"For other companies, that is something to consider. AI is moving fast, but how would you integrate it technically, culturally and in terms of getting the value out of it? That's critical. Very often my team works on something that gets to the game in one or two years. And I hope that the new solutions we're talking about can go even faster."

Christopher Dring avatar
Christopher Dring: Chris is a 17-year media veteran specialising in the business of video games. And, erm, Doctor Who
Related topics