Generating Your Own, Playable Super Mario Level Is Easy With The MarioGPT AI Chatbot

mario gpt mario maker 2
Mario has been in the news a lot lately due to the upcoming feature film by Nintendo and Illumination. Well, now we get to talk about Mario level creation, and we're not talking about Mario Maker! A new open-sourced AI-based system that can build Mario levels is now available.

Named MarioGPT by its developers and researchers, the system takes advantage of the Large Language Model (LLM) training AI recently made popularized by OpenAI's ChatGPT. Using this in combination with the concept of Procedural Content Generation (PCG), levels can be generated and tweaked based on ongoing input from the user.

"We show that MarioGPT can not only generate diverse levels, but can be text-prompted for controllable level generation, addressing one of the key challenges of current PCG techniques." says the developer on its Cornell University Arxiv Post where the research associated is published.
new initial prompt mariogpt
Example of initial prompt and its output

While the focus is on that of Super Mario Bros., it is important to note that the core building blocks of Super Mario Bros. are tiles. This means that, using the source code, anyone could generate a tile-based level for a platformer of their choice just by entering a text prompt. The reason for prioritizing the original Super Mario Bros. in this instance is likely due to several factors. Beyond its popularity, the original title is overall less complex than later installments in the popular series.

The model generated a section of a level extremely similar to that of the classic Super Mario Bros. 1-1 level when provided the prompt "3 pipes, 1 enemy, some blocks, low elevation." As of right now the system only outputs in a text format, but this can then be used in a Mario ROM editor or even versions of Super Mario Maker.

From our perspective, we see some fantastic concepts that can come from this, and as stated, this is applicable for any tile-based platformer. Not only that, but according to the paper this procedural generation method also includes attempts at predicting player paths and ensuring playability, so an "impossible level" can't truly be created.

That could be worked into active procedural generation in games. Imagine a game in which an initial base prompt makes the first level, then generates the next level you play based on your performance in the last and defined by say, the number of jumps you have to take, or how narrow the height of those jumps might be, maybe more enemies, or less, any number of possibilities.

mario gpt prompt output results
Examples of Prompts used in MarioGPT to generate levels and their output.

The concept has been used before in other titles, including 3D games such as with Left 4 Dead's AI director. The difference from this is that it just handled the frequency of enemy spawn and their health and how many "boss" enemies you saw, or a game might just up the difficulty the next level you load.

In the case of MarioGPT you could see a way more complex level 2 if you finish level 1 in record time, and then you might see it even out on Level 3 if you fail frequently in Level 2. That does mean there could be very odd spikes in difficulty, but it's a cool thought and we hope to see some more awesome stuff come from it.
Tags:  Mario, AI, chatgpt, mariogpt