Skip to content

AndreaYpmY/GreatEscape

Repository files navigation

README

Introduction

This repository contains all the files from our Artificial Intelligence final project, where two multiple-player groups challenge each other with their agent.

The project is named after the homonymous Codingame challenge, which is directly inspired by the board game “Quoridor”.

The project’s main goal is to develop a bot (mainly implemented via Answer Set Programming) that plays the game autonomously.

To make the bot play the game, you also need the game itself: that’s why we also had to develop it.

Technical info

The game is written in Python and uses the Pygame library.

Since the project is evaluated solely on how smart the AI is, don’t expect the rest of the code to be well-designed.

In the case of Team 1, the AI is implemented through some functions in Python, and the rest of the task is given to a single ASP program, which then runs on Clingo and the resulting optimal Answer Set is the effective players’ move.

…info on Team 2 to be written soon…

Game rules

The game rules are practically identical to the Codingame challenge’s, except for the time constraint, which is a little bit more relaxed. You can check them out there.

How can I write my personal AI?

If you want to write your bot, you have to follow some steps:

  1. Install pygame;

    pip install pygame
  2. Install EmbASP for python;

    pip install EmbASP-7.4.0-py2.py3-none-any.whl
  3. Create your AIManager child class and let it handle your moves. Please bear in mind that you have **limited time to do it (you can check the correct amount in the “Timekeeper” class);

  4. Override the ask_for_a_move method inside the AIManager;

  5. If you are going to use an ASP program, override also the prepare_programs_for_handler method;

  6. Pass your freshly created AIManager and your name to a new AIPlayer instance, which then you need to append to the ai_manager_pool list, inside the Game class (Note: the ai_manager_pool is shuffled in the create_players method, so if you want to make sure that one of the players is gonna be yours, comment the shuffle instruction and let your manager be in position 0 or 1 of the list);

  7. Run main.py as you wish (Note: If you are a Linux user and you want to run it as an executable, you should probably run a chmod u+x on it);

The Team(s)

Each “sub” team is composed of two members.

Team 1

Team 2

Credits

The ASP solvers DLV2 and Clingo

Many thanks to Angelo Fittipaldi (@imbngy), who made the HUD layout and the players’ pawns assets for us.

All credits for the music must go to:

In-game Screenshots

Here are some in-game screenshots for you to see: python_KWaGIgQiBk python_zV6BIHmFW0

About

Final project of the Artificial Intelligence course

Resources

License

Stars

Watchers

Forks

Packages

No packages published