The main idea of our task/project is to develop a bot client for a turn-based strategy game, that is based on the
original World of Tanks game. The game, can be played by up to three players who control five different types of
vehicles with their own properties.
The map is made out of hexagons (See picture below. Hex map) and the main task of each player/bot is
to conquer their opponents by either capturing a central base or destroying as many enemy vehicles as possible.
For our bot client assembling and running we currently use PyCharm IDE, link can be found here.
To launch our project using PyCharm IDE, follow the following steps:
1) Download/clone our project.
1.1) If project was downloaded, you should have a zipped project file. Just extract it to
a folder.
1.2) If project was cloned, you should already have required folder, so you're ready to
go further.
2) Open project folder using IDE, in our case, we just open it in PyCharm IDE.
3) If IDE is not returning any error messages (if everything is installed correctly), just run main
file.
4) In opened window, fill in required fields and proceed. And congrats, now you should see how bot
plays the game.
5) After the game will finish, program will inform you about the results of the game.
Bot client is written in Python 3.11 programming language. Also, it requires installed "pygame" library, which is
required to draw and update our map.
Our bot client consists of main following parts:
1) Communication with server
2) Bot/player logic
3) GUI
4) Map
5) Game types
6) Main game loop
Our communication with server is made in game-client.py, which communicates with the server using socket connection. The client sends requests to and gets messages from server in the form of binary messages in chunks which are encoded as a byte stream.
The implementation also defines two enums, Action and Result, which are required to identify the different types
of actions that can be performed by the client, and the possible results that can be returned by the server.
The bot client/player logic is located at players. In this folder, there is a main logic of movement and shooting
of tanks.
Also, we have an implementation of advanced bot logic, which can be found here
The GUI of out game is being drawn by pygame. For drawing map and gui elements we have a separate painter.py file.
All of our menus are being drawn by pygame_menu library. Link to this library can be found here
Game map is made out of hexagons, which each have x, y and z coordinates. The middle of the map has coordinates -
(0, 0, 0). For better understanding, in the following picture we can see all our map coordinates.
Hex map, which represents current game state, is being drawn using python library called "pygame".
In our implementation, map.py is responsible for drawing, updating, coloring of the map. Also, it has a specific methods, that checks hexagon/hexagons if we need something.
Our game has 2 game modes:
1) Online game - game with other players, where we can either create our own game, either join other
players game.
2) Local multiplayer - game with selected amount of local bots.
Starting point of our bot app is main.py.
Main creates an instance of Controller.
Controller creates all pre-required instances/menus etc. and it controls the flow of application.
Game.py is the most important part of our program,
because it combines all previous steps in order to allow bot client work properly.