Skip to content

abdelrahmanabdelnabi/Risk-game-and-AI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RISK AI Game

This project is a simplified browser based implementation including several AI agents for the popular game "Risk".

Features

The game supports two modes. Human vs AI (playing mode) and AI vs AI (simulation mode).

The game starts with an occupation phase players take turns selecting the countries they would like to occupy, positioning one unit at a time.

Then the war phase starts where players can attack other players based on the rules of the game.

AI Agents

We implemented several AI agents which you can choose to play against. The agents differ in their strategy and state space search algorithm. Here are the agents we implemented:

  • A* search
  • realtime A* search
  • Minimax
  • Greedy
  • Agressive
  • Pacifist

We used the Border Security Ratio heuristic from this paper as the heuristic for the A* and minimax agents.

Technologies

The game is implemented using React.js for the frontend side and python scripts for the AI agents with a simple flask server for client server communication. We use boardgame.io for managing and defining game state, moves, rules and transitions.

Demo

demo gif

Setup

Clone the repo, then:

To start the client run

cd Risk-game-and-AI/client
npm i
npm start

To start the server

cd server

# install the python dependencies
pip install numpy flask flask-cors

# run the server
flask run

About

a web based GUI for the risk game with several AI agents

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published