🔰Setup guide

This section will cover the installation of Dungeons and Data Structures.

1️⃣ Game Requirements

Dungeons and Data Structures requires a working version of Python 3. To check what version of Python you have, type the following into your terminal:

python --version

If you don't have Python 3 installed on your machine, please go to the official Python web site here and follow installation instructions for your operating system.

2️⃣ Installing the game environment

1. Download the latest game release:

2. Install the game environment:

Assuming workspace is the directory you want to use to develop your AI-agent, open your terminal (as administrator) and run the following:

# Create a working directory for your project:
> mkdir -p ~/workspace/my-agent

# Change into that directory
> cd ~/workspace/my-agent

# Create a python virtual environment. Lets call it venv
> python3 -m venv venv
# Activate your new python environment
> source venv/bin/activate

# Install the Coder One Dungeon module you have previously downloaded:
> pip install ~/Downloads/dungeon-0.1.6.tar.gz

Option B: Using Git

1. Alternatively, you can open your terminal and clone our GitHub Repo using:

$ git clone <https://github.com/CoderOneHQ/dungeons-and-data-structures.git> 

2. Then run the following commands:

> cd <git check-out>

# Create your Python virtual environment 
> python3 -m venv venv

# Activate the virtual environment
> source venv/bin/activate      # or for Windows use: venv\\Scripts\\activate 

# Install game dependancies
> pip install -r coderone/requirements.txt
> pip install -r coderone/dungeon/requirements.txt

Option C: Manual Installation

1. Download the package manually by heading over to our GitHub repo.

2. Click the 'Code' button on the right hand side and download the Zip file.

3. Unzip the folder in the destination of your choice (e.g. workspace/my-agent).

4. Open your terminal and run the following commands:

# Change into your working directory
> cd ~/workspace/my-agent

# Create a python virtual environment. Lets call it venv
> python3 -m venv venv
# Activate your new python environment
> source venv/bin/activate       # or for Windows use: venv\\Scripts\\activate.bat 

# Install the Coder One Dungeon module you have previously downloaded:
> pip install -r coderone/requirements.txt
> pip install -r coderone/dungeon/requirements.txt

3️⃣ Testing your setup

In your terminal, ensure you're in the right working directory, then run:

coderone-dungeon --interactive coderone.dungeon.agent

If the above doesn't work, you may need to try using python -m coderone.dungeon.main in replacement of the wrapper coderone-dungeon, for example:

python -m coderone.dungeon.main --interactive coderone.dungeon.agent

You should then see the game load:

Hit ENTER to start the game. We've opened the game in interactive mode, meaning you can use the following keys to try playing the game yourself (you are playing as the Knight):

  • ENTER - pause / unpause the game

  • R - restart the game with new random map

  • / / / - arrows to move the player

  • SPACE - place a bomb

If you got here without any errors - congratulations Dungeons and Data Structures is all set up!

4️⃣ Building your first AI Agent

It's time to build your first AI Agent! Click on the tutorial below to get started:

Last updated