Doom and Super Mario could be a lot tougher now AI is building levels
Imagine the frustration of playing a game where the difficulty can constantly change
AI researchers do love their games and two papers have shown that they can use general adversarial networks (GANs) to make old favorites a lot more interesting.
In two separate papers, AI researchers built general adversarial networks to construct new video game levels for Super Mario Bros, a popular platform game controlling a mustachioed man in red overalls to collect coins and avoid enemies to reach a princess, and DOOM, the classic first person shooter from the early 1990s.
GANs were first introduced in 2014. The system is made up of two networks: a generator and a discriminator. The generator creates fake samples of training data, and a discriminator tries to determine if the samples are real or fake. Both networks spar with one another, and over time the generator learns to forge more realistic samples to trick the discriminator.
By applying them to entertainment, the researchers hope that they will be used help humans design better video games in the future.
OpenAI challenges you to beat 1990s classic Sonic the Hedgehog using machine learningREAD MORE
“Level design usually heavily relies on domain expertise, good practices, and an extensive playtesting. To deal with these issues, several game researchers are spending considerable effort on studying and designing procedural content generation systems that, exploiting machine learning and search algorithms, can model the level design process and assist human designer,” according to the DOOM paper.
Evolving new levels
To create fake Super Mario levels, the researchers use a specific level within the Video Game Level Corpus (VGLC) as a training sample. The objects in the level including the blocks, green pipes, and enemies are represented as different types of tiles. Each tile is then encoded and mapped to an integer and converted to a vector.
The training data is generated by processing all game objects into tiles and converted into vectors and images.
It means that a single level can be broken down as a sequence of tiles and converted to 173 training images to be fed into a discriminator.
“The GAN learns to include all these different tiles in the generated levels, and it also learns how to combine them,” said, Sebastian Risi, co-author of the paper and an assistant professor at the IT University of Copenhagen.
Training on a single level isn’t very exciting. Using a small training set usually means overfitting, so the fake level and real level used for training is likely to be very similar and boring to play.
Enter a second algorithm: the Covariance Matrix Adaptation Evolutionary Strategy (CMA-ES). It evolves the vectors in the GAN-created level to create new levels that aren’t part of the training level, Risi explained to The Register.
“The levels we generate can have different numbers of enemies or ground tiles. One benefit of this approach is that we can evolve levels with specific properties such as difficulty, measured by for example, the number of enemies and ground titles.”
GANs are notoriously tricky to train (look at some of the horrors from the Deepfakes kerfuffle), and the results can be awry.
“MarioGAN generates new levels very quickly but occasionally makes structural mistakes such as incompletely assembling pipe tiles,” Adam Smith, co-author of the paper and an assistant professor at the University of California, Santa Cruz, told El Reg.
“This project benefits AI research by helping us to map out the space of which techniques work where and when they fall apart when a hidden assumption they make is broken.”
It’s a similar process for Doom. A thousand Doom levels are processed into a set of training images that include the game’s most important features: “the walkable area, walls, floor height, objects, and room segmentation”.
These images along with the game features, and a little added noise are given to a generator to create new levels. This is then passed to the discriminator for examination. If it passes the test, it means that the new fake level is pretty good and should be able to be played like a real Doom level.
But if you’re itching to have a go on these AI-generated games, you’ll have to wait a while. Both projects are still prototypes and can’t be played quite yet. Although the code for the Super Mario GAN can be found on GitHub.
Risi said it’s a problem that the team are working on. “In the next version we want to create a level that continually adapts its difficulty to the player.” ®