This repository serves as the primary storage location for all code relating to the CSSE416: Deep Learning final project "Super Learning Bros".
- We included the source code for https://github.com/justinmeister/Mario-Level-1. We did not comment this code as this is not code we created or modified (with the exception of fixing a bug with how mario jumped).
- We are assuming you are testing the code on a Rose-Hulman Laptop and not a Linux server (like Gebru) or a Mac device. As such our code and instructions have been designed with Windows 11 in mind (and treat Linux as more of a second-class citizen, we never tested any code on MacOS).
- Generative AI is utilized in the creation of this code.
- Claude Sonnet 4.5 provided advice and some implementation details surrounding DDQN and PPO, and assisted with debugging some annoying API details with OpenAI's Gymnasium
- All developers had GitHub CoPilot enabled, while most the of the changes it recommended were ignored, a few details such as formatting, and variable naming were often accepted.
- There are two main files which run basically all of the logic for this project.
- CSSE416-FINALPROJECT/main.py
- This file contains the actual RL algorithms (in the main repo just DDQN)
- CSSE416-FINALPROJECT/gymnasium_env/envs/mario_world.py
- This file provides the connections between OpenAI's Gymnasium and the Mario level 1-1 implementation
- CSSE416-FINALPROJECT/main.py
- PyTorch-based DQN agent with target network and experience replay
- Custom environment using Gymnasium API
- MultiBinary action mapping for Mario controls
- Configurable hyperparameters for training
- Replay buffer and epsilon-greedy exploration
- Model checkpointing and reward logging (commented for easy activation)
- Ensure dependencies are installed (see
requirements.txtinmario_game/). a. We would highly recommend installing the CUDA verison of torch as we make extensive use of GPU optimizations b. You may install CUDA torch using this commandpip install torch torchvision --index-url https://download.pytorch.org/whl/cu121c. You can do this by runningpip install -r requirements.txt(if you chose to install torch with CUDA support, then that should override this default torch install) - Run the training and display script (run from the top-level repo folder CSSE416-FinalProject):
python main.py - Training progress and rewards are printed to the console.
- A window will appear showing Mario's actual progress in the level.
NUMBER_OF_SEQUENTIAL_FRAMES: Number of stacked frames for state inputREPLAY_BUFFER_SIZE: Size of experience replay bufferBATCH_SIZE: Training batch sizeLEARNING_RATE: Optimizer learning rateGAMMA: Discount factor for future rewardsEPSILON_START,EPSILON_DECAY,EPSILON_MIN: Exploration parameters
- Model checkpoints and reward logs can be enabled by uncommenting relevant lines in the script.
- Checkpoints are saved in the
checkpoints/directory.
- The script uses
MarioLevelEnvfromgymnasium_env/envs/mario_world.py. - See environment code for details on observation and action spaces.
- Adjust hyperparameters at the top of
main.pyto tune training. - Modify the environment or agent for advanced RL experiments.