The artificial intelligence fever and long-language models — like GPT-3 — have exploded to such an extent that Big Tech is vying for leadership in this sector. While the focus is on ChatGPT, Midjourney, and other generative AIs, there are noteworthy projects out there. Such is the case of MarioGPT, an AI capable of generating hundreds of playable levels of Super Mario Bros.
A team of researchers at the University of Copenhagen led by Shyam Sudhakaran, published MarioGPT: open text-based level generation via extensive language models. The study details a method of creating scenarios for the popular Nintendo game using artificial intelligence. MarioGPT is based on a GPT-2 model trained with a subset of levels of Super Mario Bros and Super Mario Bros: The Lost Levels and is able to create new content via simple text input.
Simply put, just enter phrases like “lots of enemies, some blocks, and little elevation” or “lots of pipes, and lots of enemies” for the AI to do its job. According to the study, 88% of the 250 levels generated by MarioGPT are playable. Each scenario is accompanied by an optimal trajectory that confirms that it can be traversed from start to finish.
MarioGPT is based on levels of Super Mario Bros and its sequel, The Lost Levelsconverted to text by The Video Game Level Corpus. Each item on the stage is assigned a character, similar to what we see in classic games like Rogue or the ultra famous Dwarf Fortress. Thus the model is trained and recognizes the patterns and then reproduces them in completely new scenarios through an input (or prompt).
MarioGPT: the first step to designing video game levels using AI
As is to be expected, the first results are not perfect. MarioGPT has some limitations, starting with the subset of data with which the model is trained. The text levels of The Video Game Level Corpus require more coding work to identify all the elements that make up a scenario. An example of this is the enemies, which are simply defined by the letter “E” and which prevent there from being any variation in the levels generated by the AI.
Shyam Sudhakaran, one of the study authors, told TechCrunch that decided to use GPT-2, since it is easier to train and it performs better than GPT-3 with a smaller data set. However, the investigator revealed that in the future they could migrate to a more sophisticated model if they have a more extensive base. According to Sudhakaran, MarioGPT would be the first step towards a more controllable and diverse generation of video game levels.
Added to technical limitations, researchers would have one more problem to deal with: Nintendo. The Japanese company specializes in canceling projects involving its intellectual properties. Slablawyers from the big N would already be writing a letter of cease and desist to send it to the University of Copenhagen as soon as possible, regardless of whether this project is of a scientific nature.
Super Mario Bros is not the only game with levels generated by GPT-2
Around the same time MarioGPT was published, New York University announced a similar project. In the study titled Level generation through extensive language models, researchers use GPT-2 and GPT-3 to create game scenarios Sokoban. Julian Togelius, one of the authors, mentions that its model generates novel and playable levels with a high success rate.
Unlike MarioGPT, the academic mentions that GPT-3 works best with a small data set., reducing the required level base. However, Togelius mentions that the work at the University of Copenhagen is more sophisticated in its way of training the AI. In both cases, experts agree that is the first step in a promising future in the field of video game level generation using AI.