mario-gpt  by shyamsn97

Research paper code for text-conditioned Super Mario Bros level generation

created 2 years ago
1,130 stars

Top 34.6% on sourcepulse

GitHubView on GitHub
Project Summary

MarioGPT enables the generation of Super Mario Bros. levels from text prompts using a fine-tuned GPT-2 model. It targets researchers and developers interested in procedural content generation, AI-driven game design, and exploring the capabilities of large language models for structured output. The project offers a novel approach to controllable level creation, allowing for diverse and potentially playable game environments.

How It Works

MarioGPT leverages a fine-tuned distilgpt2 model, trained on Super Mario Bros. and Super Mario Bros: The Lost Levels level data from The Video Game Level Corpus. The model takes text prompts describing desired level features (e.g., "many pipes, many enemies") and generates a sequence of tokens representing the level layout. This approach allows for a flexible, prompt-based generation process, with parameters like temperature controlling the stochasticity and playability of the output.

Quick Start & Requirements

  • Installation: pip install mario-gpt or install from source.
  • Prerequisites: Python 3.8+, PyTorch, Hugging Face transformers. CUDA is recommended for faster generation. Java 8+ is required for interactive playback and A* agent simulation.
  • Demo: An interactive Hugging Face demo is available for browser-based generation and playback.
  • Documentation: Code examples for generation, training, and interaction are provided in the README.

Highlighted Details

  • Generates levels based on text prompts.
  • Includes methods for interactive playback (play()) and pathfinding (run_astar()).
  • Provides code for training custom models.
  • Supports continuing generation from a previous output.

Maintenance & Community

The project is associated with NeurIPS 2023 and lists multiple authors from ITU. The primary repository is shyamsn97/mario-gpt.

Licensing & Compatibility

The project is released under the MIT license, permitting commercial use and integration with closed-source projects.

Limitations & Caveats

The README notes that generation is "not perfect" and suggests higher temperatures for more playable, albeit stochastic, levels. Inpainting functionality and more advanced generation methods are listed as future plans, indicating they are not yet implemented.

Health Check
Last commit

1 year ago

Responsiveness

1 day

Pull Requests (30d)
0
Issues (30d)
0
Star History
10 stars in the last 90 days

Explore Similar Projects

Starred by Tobi Lutke Tobi Lutke(Cofounder of Shopify), Stas Bekman Stas Bekman(Author of Machine Learning Engineering Open Book; Research Engineer at Snowflake), and
21 more.

guidance by guidance-ai

0.1%
21k
Guidance is a programming paradigm for steering LLMs
created 2 years ago
updated 1 day ago
Feedback? Help us improve.