Prompt-Guided Level Generation
Shyam Sudhakaran
1
, Miguel González-Duque
1
, Claire Glanois
1
,
Matthias Freiberger
1
, Elias Najarro
1
, Sebastian Risi
1,2
1
IT University of Copenhagen
2
modl.ai, Copenhagen
Denmark
{shsu,migd,clgl,matfr,enaj,sebr}@itu.dk
ABSTRACT
Automated generation of complex and diverse environments can be
achieved through the use of Procedural Content Generation (PCG)
algorithms. However, generating content that is both meaningful
and refective of specifc intentions and constraints remains a chal-
lenge. Recent advances in Large Language Models (LLMs) have
demonstrated their efectiveness in various domains. These mod-
els can be fne-tuned and information can be reused to accelerate
training for new tasks. Our study presents MarioGPT, a fne-tuned
GPT2 model that has been trained to generate tile-based game levels
for Super Mario Bros. The results demonstrate that MarioGPT can
generate diverse levels and can be text-prompted for controllable
level generation, addressing a critical challenge in current PCG
techniques.
CCS CONCEPTS
· Computing methodologies → Artifcial intelligence.
ACM Reference Format:
Shyam Sudhakaran
1
, Miguel González-Duque
1
, Claire Glanois
1
,, Matthias
Freiberger
1
, Elias Najarro
1
, Sebastian Risi
1,2
. 2023. Prompt-Guided Level
Generation. In Genetic and Evolutionary Computation Conference Companion
(GECCO ’23 Companion), July 15ś19, 2023, Lisbon, Portugal. ACM, New York,
NY, USA, 4 pages. https://doi.org/10.1145/3583133.3590656
1 INTRODUCTION
Procedural Content Generation (PCG) algorithms allow the auto-
mated creation of game content, such as levels, maps, or charac-
ters [19]. Adding PCG to a game can lead to reduced production
costs and an increase in the game’s replayability. Recently, PCG
researchers have started to incorporate machine learning-based
approaches into their systems. One such example is the use of Gen-
erative Adversarial Networks (GANs) [7] that can be trained to
generate levels for games as diverse as Doom [5] or Super Mario
Bros, using a level from the Video Game Level Corpus [26].
A drawback of current approaches that combine PCG with Ma-
chine Learning (a feld now referred to as Procedural Content Gener-
ation via Machine Learning (PCGML) [22]) is that they often rely on
costly searching inside of the latent space of the underlying neural
Permission to make digital or hard copies of part or all of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed
for proft or commercial advantage and that copies bear this notice and the full citation
on the frst page. Copyrights for third-party components of this work must be honored.
For all other uses, contact the owner/author(s).
GECCO ’23 Companion, July 15ś19, 2023, Lisbon, Portugal
© 2023 Copyright held by the owner/author(s).
ACM ISBN 979-8-4007-0120-7/23/07.
https://doi.org/10.1145/3583133.3590656
(a) "many pipes, many enemies, little blocks, low elevation"
(b) "little pipes, little enemies, many blocks, high elevation"
(c) "many pipes, some enemies"
(d) "no pipes, no enemies, many blocks"
Figure 1: Prompt-conditioned generations from a single seed
block. MarioGPT is able to create diverse levels solely based on a
text prompt in natural language.
networks. Ideally, we would like to directly condition a generator
to create levels with certain properties in natural language.
The presented paper addresses this challenge, introducing Mar-
ioGPT (Figure 2), a fne-tuned GPT-2 model trained to generate
Mario levels. The model shows that LLMs can be combined with
PCG techniques to efectively create new and diverse levels through
natural language prompts. Showing the efectiveness of the method,
a surprisingly high percentage (88%) of MarioGPT generated levels
are in fact playable.
2 BACKGROUND AND RELATED WORK
2.1 Procedural Content Generation
Procedural Content Generation (PCG) algorithms [19] deals with
the automatic creation of game content (e.g. for level design, charac-
ter generation, environment modeling, etc.). As reviewed in [19, 27],
earlier works often focused on evolutionary computation [2], solver-
based methods [20] or constructive generation methods (such as
cellular automata, grammar-based methods), etc. More recently,
research on deep learning for PCG [12, 22] has proposed a promis-
ing approach to generate high-quality game content śnot only
aesthetically pleasing but also functional and challengingś in a
data-driven manner, while reducing the manual efort required
from game developers. Diversity, originality and playability of the
179