Code Monkey home page Code Monkey logo

super_mario_as_a_string's Introduction

Generating Super Mario levels using LSTM

For more generated levels, please scroll to the bottom!

Description

This repo intends to replicate Super Mario as a String: Platformer Level Generation Via LSTMs. However, there are some differences between this implementation and what the paper describes. In this implementation:

  • Snaking and level depth are not used.
    • Although the paper claims that the number of characters between the left and right sides of pipes are decreased by snaking down and up, it is also obvious that this number is increased by snaking up and down. They are two sides of the same coin.
    • The paper claims that one depth character is added to the fifth column, two depth characters are added to the tenth column and etc. This means that an average Mario level (~200 columns) would have 40+ depth characters appended to later columns. To me, this seems very inefficient since seq_length is only 200.
  • Validation is done after each epoch instead of every 200 training examples (I guessed this number; the paper was not clear on this).
  • The LSTM used here similar to Andrej Karpathy's min-char-rnn.py, which supports seeds of arbitrary length during generation. It does not simply use n characters to predict the next. It isn't clear what the paper used.
    • Please read through Andrej's code line-by-line if you are confused by what I wrote above; it gave me a crystal clear understanding of the difference between a LSTM and a standard feed-forward neural network (that simply uses the last n to characters to predict the next).
    • To see some empirical evidence that LSTM memorizes longer than seq_length used for training, check out the first paragraph of section 4.2 of Visualizing and Understanding Recurrent Networks by Andrej.
  • Perfect pipe generation is not achieved here.

Please shoot me a pull request or message if you have any suggestions.

Instructions

To understand how everything works, please go through the following notebooks in sequence:

  1. 01_preprocess_data.ipynb
  2. 02_train_model.ipynb
  3. 03_generate_txt_from_model.ipynb
  4. 04_convert_txt_to_png.ipynb

Example generations

super_mario_as_a_string's People

Contributors

zhihanyang2022 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

yigitozgenc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.