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.
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…
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.
If you want to write your bot, you have to follow some steps:
-
Install pygame;
pip install pygame
-
Install EmbASP for python;
pip install EmbASP-7.4.0-py2.py3-none-any.whl
-
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);
-
Override the ask_for_a_move method inside the AIManager;
-
If you are going to use an ASP program, override also the prepare_programs_for_handler method;
-
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);
-
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);
Each “sub” team is composed of two members.
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:
- skuter for .giana sisters.
- laxity for laxity again and checknobankh (desert dream demo)
- Johannes Bjerregaard and Thomas Mogensen for Tiger Mission Hi-score (fairstars)
- Renard for untitled (zerd_01)