Skip to content

Utility scripts

Loic Nyssen edited this page Oct 14, 2018 · 2 revisions

Utility scripts

This document details how to use the various utility scripts available within the root train directory of this project.

StateGenerator: smb-state-generator.sh

This script is a proof of concept in our ability to load any Super Mario Bros level and save the state of the start of the level to the local disk. This can be used to quickly generate state files that can be used to commence training from any level.

The actual utility of the script is no longer valid as we have solved the "chicken and egg" issue of needing a state file to be able to save more state - but is a useful reference to keep on how state saving works in Lua and FCEUX.

StateSaving: Train.py

This script is another proof of concept in our ability to randomly play Super Mario Bros and save this state from the wrapping Gym environment. This proves out the ability for us to save state not only from Lua but from outside the entire Gym system.

This forms the basis of our NEAT implementations within the agent and evolve scripts.

Playback: PlayBest.py

This script allows you to play Super Mario Bros with the best generated network that has been created thus far. This is also useful for playing your network against other levels or just for visualising progress of the network thus far.

You can also view an example of this script running here.

Clone this wiki locally