Skip to content

sheisstarwithoutmoon/ResearchOnOthello

Repository files navigation

Project: AlphaZero-Inspired Game Learning: Faster Training by Using MCTS Only at Test Time 
Group Number: 54

Description: This project implements Othello and ConnectFour, with AI vs Human modes, AI vs Edax comparisons (for Othello), and performance analyses using MCTS at test time.

Prerequisites:
1.Ensure you have Python 3.x installed on your system.
2.Install required dependencies:
  pip install numpy
  pip install matplotlib

Steps to Run Othello (Human VS Our AI Mode):
3.Run the following command in the terminal:
  cd Othello
  python othello.py
  
  Press *Play Game* button to start the game.
  Press *New Game* button to start the game and then start playing.

  Directory Structure:
  ├── controller
  │   ├── othello_controller.py
  ├── model
  │   ├── othello_model.py
  ├── outputs
  |   ├── aivshumanothelloGame1.jpg
  |   ├── aivshumanothelloGame2.jpg
  |── views
  |   ├── othello_view.py
  ├── othello.py  (main script)
  othello_agent.pkl  (trained model)

Steps to Run ConnectFour (Human VS Our AI Mode):
3.Run the following command in the terminal:
  cd ConnectFour
  python connect_four.py

  Directory Structure:
  ├── outputs
  |   ├── aivshumanc4game1.png
  |   ├── aivshumanc4game2.png
  |   |── aivshumanc4game3.png
  |── connect_four.py (main script)
  |── ConnectFourModel.pkl (trained model)

Steps to Analyse and Plot the Results of ConnectFour Games:
3.Run the following command in the terminal:
  cd ConnectFourAnalysis
  python tournament.py

It runs the game and creates a brief analysis of MCTS Vs TCL-wrap, MCTS Vs TCL-base, and MCTS Vs AB-DL Agent
  Directory Structure:
  ├── graph
  |   ├── analysis.png
  ├── model.pkl (trained model)
  |── tournament.py (main script)


Steps to Run Othello (AI VS Edax Mode):
3.Run the following command in the terminal:
  cd OurAIvsEdax
  python edaxvsothello.py

  Press *New Game* button to start the game.
  Then both AIs will play against each other.

  Directory Structure:
  ├── controller
  │   ├── edax_wrapper.py
  │   ├── edaxvsothello_controller.py
  ├── model
  │   ├── othello_model.py 
  │   ├── td_agent.py 
  │   ├── edaxvsothello_model.py
  ├── outputs
  |   ├── graphs
  |   |   ├── win_rates_level_5.png
  |   |   ├── win_rates_level_6.png
  |   |   ├── win_rates_level_8.png
  |   ├── edaxvsaiLevel5.png
  |   ├── edaxvsaiLevel8.mp4
  |   ├── edaxvsaiLevel8.png
  |── views
  |   ├── othello_game.py
  |   ├── edaxvsothello_view.py
  |── othello_agent.pkl (trained model)
  ├── edaxvsothello.py (main script)
  edax.exe (edax version 4.6)

To generate graph for analysing the win rates of Edax at different levels vs Our AI:
  python edaxlevelwisegraph.py

Additional Notes:
1. Outputs and visualizations are stored in the respective outputs and views folders.
2. The implementation leverages MCTS at test time to enhance training efficiency, as per the research paper.

About

Implemented a lightweight, AlphaZero-inspired Othello agent using TD(λ) n-tuple learning. The model uses Monte Carlo Tree Search (MCTS) only at test time for efficient move selection without increasing training complexity. Achieved strong performance when benchmarked against Edax Othello engine (up to level 5).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages