Skip to content

DanHChampion/BlokusAI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BlokusAI

A showcase of multiple AI agents to master Blokus.

BlokusAI GUI Screenshot

Badges

Create a Python virtual environment

python -m venv venv

Activate the virtual environment

venv\Scripts\activate

Install requirements

pip install -r requirements.txt

Environment variables

Copy the .env.template file in the configurations folder to set up the environment variables.

copy src/configurations/.env.template src/configurations/.env

The .env file contains the following configurations:

Global Configs

  • PYGAME_HIDE_SUPPORT_PROMPT=1: Suppresses the PyGame support prompt message.
  • AI_LIST='["v1", "v3", "v1", "v2"]': Specifies the list of AI versions to be used in the simulations. Available AI versions: v1, v2, v3

CLI Configs

  • VERBOSITY=True: Enables detailed logging in the command-line interface.
  • DRAW=False: Disables drawing the game board in CLI mode.
  • DRAW_RESULTS=False: Disables drawing the results in CLI mode.
  • STEP_BY_STEP=False: Disables step-by-step execution in CLI mode.

PyGame Configs

  • CELL_SIZE=20: Sets the size of each cell in the PyGame grid.
  • FPS=20: Sets the frames per second for the PyGame simulation.

Experiment Configs

  • RECORD=True: Enables recording of experiment results.
  • GAMES=100: Specifies the number of games to be played during experiments.

Run the simulations

python run.py --phase CLI # Light-weight simulation
python run.py --phase GUI # See them play against each other
python run.py --phase GAME # Play against the AIs
python run.py --phase EXP # Incomplete, not working yet
python run.py --phase DQN # Incomplete, not working yet

Game Controls

  1. Drag & drop the piece on the the board
  2. Whilst holding, press 'f' to flip piece horizontally
  3. Whilst holding, press 'r' to rotate piece clockwise

About

A showcase of multiple AI agents to master Blokus.

Topics

Resources

Stars

Watchers

Forks

Contributors

Languages