MarioGPT: Endless Super Mario Bros. Levels with GPT-2
Super Mario

The artificial generation of levels, enemies, and resources in video games is nothing new. Many titles guarantee almost inexhaustible gameplay thanks to this method, but with the development of more complex models, new ideas are emerging that could completely transform classic genres and titles in the future. That brings us to MarioGPT, a project based on GPT-2 that not only creates Super Mario Bros. levels on its own, but also enables text-to-level generation to optimize its results using basic prompts.

Repetitiveness is one of the great problems every video game must avoid. Many developments manage to escape it with procedural generation, but in practice it's not that hard to reach its limits. The gaming community has found a good solution in the form of “randomizers” that partially or completely change a game's original conditions, but how does it sound to leave that job to an artificial intelligence?

With that in mind, we travel to the University of Copenhagen, where a group of researchers presented a study called MarioGPT. Unlike chatbots that seek to conquer the world one search at a time, MarioGPT uses GPT-2 to generate infinite Super Mario Bros. levels, but that's not all: it also accepts prompts that modify its results.

MarioGPT: Super Mario Bros. + Artificial Intelligence

The choice of GPT-2 was a simple matter of convenience. Shyam Sudhakaran, the study's lead, explains that GPT-2 is more appropriate for small datasets, as well as being lighter and easier to train. But the first challenge was to transform Super Mario Bros. levels into something the models can understand. The trick they used is fabulous: a conversion to text, with each element on the screen represented by a letter or symbol.

MarioGPT: Endless Super Mario Bros. Levels with GPT-2
Super Mario Bros. levels in ASCII art format to train artificial intelligence models

The result includes a chain of lowercase x letters that represent the path to follow, and the technical solution for that scenario. Over a total of 250 levels, the agent responsible for solving them succeeded nine out of ten times. Now, this doesn't allow it to escape certain limitations, such as the fact that they have a single symbol for “enemy” when the game has different creatures (Goombas, Koopas, Buzzy Beetles, and more), and the absence of water levels, but all of that can be improved with more complete datasets.

MarioGPT: Endless Super Mario Bros. Levels with GPT-2
With the use of prompts, the modifications in the levels are remarkable

Furthermore, the ability to inject prompts into the generation process is vital so that levels aren't just simple horizontal races with a couple of pipes. A modifier like “many pipes, many enemies, little blocks, low elevation” can completely transform the final experience. However, MarioGPT is at an experimental stage, and we shouldn't expect any tool in the immediate future (except for this bitmap generator on HuggingFace). In fact, I think the most important thing for the study will be to change its name. Nintendo has low tolerance for these things…

MarioGPT: Endless Super Mario Bros. Levels with GPT-2
Super Mario

Access the study: Click here

Source: TechCrunch