This project serves as a text-based adventure game-ish environment to train solo RL agents. I prepared this as a showcase for a #BuildWithAI
event organized by GDG on Campus | AdtU
. But, this is not a solo effort. Contributions from GDG on Campus | AdtU
team and community members have made this possible.
NOTE:
macOS
(bothIntel
andApple Silicon
) is currently not supported. As things are right now, the project heavily relies onNVIDIA CUDA
to work.
This project uses the pixi package manager (written in Rust btw). Follow the instructions below to install pixi
, setup autocompletions and run the game:
# Install pixi on Linux
curl -fsSL https://pixi.sh/install.sh | bash
# Install pixi on Windows (Powershell)
iwr -useb https://pixi.sh/install.ps1 | iex
# Linux autocompletions for pixi
echo 'pixi completion --shell fish | source' >> ~/.config/fish/config.fish # fish
echo 'eval "$(pixi completion --shell zsh)"' >> ~/.zshrc # zsh
echo 'eval "$(pixi completion --shell bash)"' >> ~/.bashrc # bash
# Windows (Powershell) autocompletions for pixi
Add-Content -Path $PROFILE -Value '(& pixi completion --shell powershell) | Out-String | Invoke-Expression'
# Clone the repo and cd into it
git clone https://github.com/debarchito/reinforced-shrine-adventure.git
cd reinforced-shrine-adventure
# If your system is avx2 capable, set this env variable to "1" before installing packages
set PYGAME_DETECT_AVX2 1 # fish
export PYGAME_DETECT_AVX2=1 # bash or zsh
$env:PYGAME_DETECT_AVX2="1" # powershell
# Install dependencies
# (sit tight with some coffee, this might take a while as it has to install CUDA and stuff)
pixi install
# Activate the virtual environment
pixi shell
# Run the game. Hot-Module-Replacement (HMR) is enabled
pixi run game
# Train the agent
pixi run rl_train
# Let the agent play the game (CLI)
pixi run rl_play
Additionally, check the HOWTO.md file for more information on how to work with the project.
The story is written using the Ink scripting language and Inky editor for real-time feedback. You can find the story in the story directory. To load the story in the game, you need to export it as JSON
(functionality available in the Inky
editor). Check story.ink.json for the exported version of the complete story (as it stands).
You can get started with
Ink
using the official documentation: WritingWithInk. It covers everything you need to write succesful stories inInk
. If you want a video tutorial, I recommend Learn Ink (video game dialogue language) in 15 minutes | Ink tutorial by Shaped By Rain Studios. I personally found it quite helpful.
story.ink serves as the entry point for the story in the game. Put seperate scenes in separate files inside the story directory. Afterwards, import them in story.ink and use them in appropriate places.
Please check the assets/Credits.md file. It contains the credits for all the assets used in this project.
This project is licensed under GPL v3.0.