Stadia Semantic ML

Can machine learning revolutionise game development? Stadia thinks it can

Perhaps one of the strongest selling points of the Stadia is its streamlined process, saving a tremendous amount of time on behalf of the user. With no lengthy game downloads, updates or hard drive management, it’s a tempting option for the time-poor individual who has carved out a spare hour to sit down with a game.

Google has taken this time-saving philosophy and applied it to game development itself – by experimenting with machine learning technology. And this work is touching on elements as disparate as content creation, balance testing and language-based interaction.

Stadia has put together a team of game developers, machine learning engineers and infrastructure engineers in order to create gameplay prototypes to demonstrate the potential for machine learning in game development, it told MCV/DEVELOP.

“We’re taking on the risk that developers don’t want to,” explains Erin Hoffman-John, head of creative for Stadia research and development. “We’ve been talking externally to developers and asking them, what are the things that you’ve always wanted to do but have not been able to do? What are the things that you’ve had to cut out of your games because you haven’t been able to do them fast enough, or you just haven’t had the processing power?”

PROJECT CHIMERA

Erin Hoffman-John
Erin Hoffman-John

One of the projects that was born out of conversations like this is codenamed Chimera – which took form when one of Stadia’s engineers wanted to experiment with generative adversarial networks. Chimera was part-inspired by projects such as This Person Does Not Exist – a website created by former Uber software engineer Phillip Wang that creates computer-generated images of people who, as the name would imply, do not actually exist. 

The technology is impressive – the website just seems to be a collection of LinkedIn profile pictures before it’s explained that all of these faces are computer-generated. It immediately begs the question of whether this can be applied to game development, particularly if it can be used to create video game assets? Additionally, given the constraints and challenges of game development, can it be used to empower smaller development teams?

“What if a team of 14 people could make a game the scale of World of Warcraft? That’s an absurd goal, right? The thing about games like World of Warcraft is that they rely on a lot of heavy, repetitive content creation. The artists and the writers are doing a lot of essentially duplicate work, that’s where a lot of the investment goes. If you look at the amount of money that is spent making a game like World Warcraft, it’s like 70% content and 30% or less code, even though it’s a tremendous amount of code, it’s way more on the content side.”

Hoffman-John runs us through what Chimera is capable of. The game prototype is a card-based creature-battling strategy game, featuring machine-generated artwork. The machines are trained on 3D assets created by an artist, creating a host of animals that can be merged together to create new and more powerful creatures (hence the name ‘Chimera’ we suspect).

“What does it mean to unlock the next billion gamers?”

 

Ordinarily, the prospect of creating artwork for every possible creature combination would be completely off the table for a smaller team, as Hoffman-John stresses, underlining the potential of Chimera for smaller teams. And by linking this with Style Transfer ML, which allows artists to literally drag and drop reference images to inform a game’s art style – smaller teams are able to create more complicated character designs without a huge time-sink. 

The next element of Chimera is reinforcement learning. Seeing as the prototype is a card-based strategy game, Stadia have been able to use reinforcement learning agents to play the game millions of times and do play testing in order to inform the game’s balance. 

“So I knew when I designed the game that the T-Rex is super strong. But I didn’t know exactly how strong, and I didn’t know the frequency with which it could be played. This is the kind of thing that causes exploits to be in games when they’re released, or you have this wild imbalance in a card game, because you can’t predict all the outcomes. 

“But by playing the game millions of times with reinforcement learning agents that we’ve trained on the rules of the game, that lets us test the balance very, very quickly. So even a small developer who might not have access to hundreds of people to playtest their game could have access to this reinforcement learning tool that will optimise the play of the game.

“It can learn the game by itself without being scripted, and then tell you where the problems are  in the balancing. It lets you test your theories of the design against what’s actually happening in real time”

By applying machine learning to both recreating the character designs and the game’s balancing, Stadia is opening the doors to smaller teams to create unique and well-balanced experiences that otherwise would have been too complicated, time-consuming and expensive to create – which is all in support of Google’s own ‘next billion gamers’ goal.

“We worked backwards from this question of ‘what does it mean to unlock the next billion gamers?’ We’re thinking very long term, looking five or more years into the future. The big thing we want to do is be able to use Stadia’s accessibility to reach billions of people. And if we want to do that, from a game development standpoint, you have to either empower, amplify or create more game developers. You have to make it easier to make games.”

WHAT DOES THE FOX SAY?

Anna Kipnis
Anna Kipnis

Chimera isn’t the only way Stadia is using machine learning to reach those one billion gamers, though.  Anna Kipnis, senior interaction designer at Google, runs us through another (and much more adorable) prototype using Semantic ML. 

“I was a game developer for about 16 years,” Kipnis says. “I worked as an AI and gameplay programmer for Double Fine. Most of Double Fine’s games have really complex characters. And my focus was on bringing them to life. 

“Over the years, we’ve seen games go through this incredible visual evolution, from just a few colours, to many colours, from 2D to 3D, extremely high fidelity  and so on. But I think that interactivity with characters has not seen the same kind of exponential improvements. And so this is where I think semantic ML could really help.

“So what is Semantic ML? And at its core, semantic ML is just phrase or word association. But of course, some phrases are more closely associated than others. So for example, the word ‘flower’ is more closely associated to ‘tulip’ than it is to ‘funeral.’ So what Semantic ML can do is give us these like word distances, these word vectors, and some of these word vectors are actually signals of context. So for example, a flower can be put into a vase”

Kipnis boots up the demo and we’re suddenly confronted with the dream our heart never allowed us to have – communicating with a cheerful cartoon fox.  The fox follows simple instructions and directions – Kipnis types hello, and the fox waves in response. She asks for some coffee, and the fox brings her a mug. She throws a stick, and the fox fetches it and brings it back to her.

“I didn’t actually programme the fox to answer questions,” Kipnis cuts in, “or even to know you know what the heck coffee is. What I’ve done was I’ve taken an object that looks like a mug, and I’ve given it the label in plain English, ‘small mug.’ And then semantic ML kind of did everything else for me through those word associations.”

“First up, I want to mention a few misconceptions about using ML. Firstly, the misconception that it requires knowing how to train ML models. I thought this too when I first started working with ML because you hear about it a lot – but you can also just use pre-trained models. 

“Next, the idea that it requires massive amounts of data. Of course, data is important for training ML models, but it turns out that you don’t really need that data if you’re not going to be training anything. 

“And finally, this idea that developers have no control whatsoever over the output of ML. People think that it’s like this black box, and you just kind of have to accept what it gives you. But this is actually not true.”

Kipnis points to how the fox learns to interact with the world around it. She shows us the game’s workings under the hood – all written not in code, but in plain English.

“Typically, the way that you create characters in video games is that you have to be explicit about everything” notes Kipnis. “If the player does this specific thing, then our character will answer exactly like this. So if the developer’s not accounted for something that the player decided to do, if the player is being original, then the game just doesn’t do anything – there’s no response.

“The fox is different. So the way that I made it work is using simple grammar of the form, “I verb noun” or ‘I verb.’ like I just created a complete expression space of everything that the fox can do to whatever objects I’ve labelled in plain English.”

The model, which is developed by Google AI, is trained on billions of conversations from all over the internet, allowing it to create these semantic connections without need for input from the developer. So with the objects and actions labelled under the hood, the fox can respond to full sentences without the need to manually link concepts together – Semantic ML takes care of that.

I’M NOT OKAY (I PROMISE)

So with these rulesets of the fox’s actions in place, Kipnis explains how Semantic ML can be used to define a character’s personality. Which unfortunately means we’re going to take our lovely fox friend and make him very sad. 

Google Stadia Semantic AI

“So I mentioned before that developers think that ML is kind of this black box” Kipnis notes. “But this tool actually allows you to tweak the final outcomes. So let’s say like when we have a fox that’s sad, and when I say hi, maybe instead of waving, I want it to just get very sad. I ask it if it wants to play, and it’s not going to play. I ask for some coffee, and it’s going to be very unlikely to offer us some.”

Kipnis demonstrates, throwing a stick to our forlorn fox friend, who picks it up and solemnly places it by a plant – perhaps contemplating the futility of his sad fox existence. 

Another use of Semantic ML is in dictating patrol behaviours – actions a character does to demonstrate that it has a life outside of the player. Something that, in traditional game development, would require a high level of programming knowledge in order to implement – But as with the fox’s other actions, Semantic ML allows you to keep these instructions in plain English. Kipnis shows us a simple list that the fox follows, patrolling the room without need for code to inform his behaviour. The instructions don’t even need to be entirely precise – while the fox refers to the label ‘couch’, it understands the instruction ‘look at sofa’ regardless, thanks to the word association element of Semantic ML.

So far the fox has been following fairly simple instructions. Say hello, pick up a mug. What happens if we ask something more elaborate? 

Kipnis shows us another list of instructions – get stoked, get some money, check out the weather and we see what the fox does.

Semantic ML Stadia

In this example, Kipnis has misspelled “money” as “monet.” Instead of getting confused and not doing anything in the face of an unfamiliar instruction, the fox instead summons a painting. 

“I was a little surprised when this came out,” says Kipnis. “But the thing about semantic ML is that it’s also aware of these cultural connections and so as you know, Monet was a painter. So if we say ‘make some monet,’ the fox will respond by conjuring a painting which is just one of the random things it knew how to do. The coolest thing for me about this technology is it gives characters this inner life that it would have taken a tonne of work before for developers to be able to to put this in. As a developer, you don’t have to anticipate every possible idea a player has.”

Kipnis sends the fox off again, this time telling it to check out the weather. Dutifully, the fox walks up to the window and looks outside. 

“Again, I didn’t do anything. There’s nothing connecting those concepts. It associated that the weather happens outside and so it moves to check it out there.”

As with Chimera, the potential for this to save a tremendous amount of time for developers is clear. Without the need to code everything, with the freedom that comes with an AI understanding more vague and unexpected instructions, developers could suddenly find a lot more time to spend on other aspects of development. 

“If we could spend less time focused on the tedious parts of AI, what is now possible?” asks Kipnis. “Semantic ML can speed up that iterative process and help save developers time, but most importantly it enables developers to focus on far more interesting problems. The game artist who got that set of tools didn’t just go home early, they used them to create more and more complex visuals and with each step in that evolution, they would think, ‘okay, now that we’re here, what can we reach out and grab that was just too far out for us before?’ And so this is what I think semantic ML can do for game characters. Like if we can interact with game characters in plain English or plain language, you know what is now possible?”

This rings true with what Hoffman-John said about the inspiration behind Chimera: If we free up developer’s time on the more tedious and laborious aspects of game development, what kind of games are now possible? 

Of course, Google’s experiments with machine learning open up the door to new and exciting game experiences, but they could also provide quality of life improvements for developers. With crunch being constantly discussed in the industry, machine learning could allow more developers more time outside of development, beyond just the potential for improving their games.

About Chris Wallace

Chris is a freelancer writer and was MCV/DEVELOP's staff writer from November 2019 until May 2022. He joined the team after graduating from Cardiff University with a Master's degree in Magazine Journalism. He can be found on Twitter at @wallacec42, where he mostly explores his obsession with the Life is Strange series, for which he refuses to apologise.

Check Also

Final Boss: Jonathan Lloyd, CEO of CGHero

Every month an industry leader wraps up MCV/DEVELOP with their unique insight. This month, we speak to Jonathan Lloyd, CEO of CGHero