Shapes of war
A downloadable game for Windows, macOS, and Linux
This game is the result of a school project on the study of AI in collaboration with my teammate Anna. All the sprites in the game were also drawn by Anna.
Anna's Itch.io: https://aiskal.itch.io/
What is this game?
Shapes of War is a playerless game that plays itself, rather like a simulation. It implements multi-layered AIs that fight in a basic RTS for control of the map's resources.
4 teams take part in a game, all controlled by an AI instance. A team continuously generates units based on available resources, and can send these units to conquer and defend objectives. Resources exist only in extractors scattered across the map, representing major strategic points.
AIs are made up of 3 layers that drive the different actors in a team:
The main layer
This layer controls the team itself. It is the decision-making center. It is made up of several modules which analyze the game and decide what needs the team must fulfill. For example, the resource management module will periodically analyze resource stocks and decide which resource the team needs most.
Each identified need is placed in a queue with an estimated priority. Another module is responsible for periodically selecting a need from the queue and launching the task, allocating available resources to it. For example, if the need to obtain the resource “triangle” is declared, the extractors producing this resource will be analyzed and sorted according to their distance, nearby enemy forces, quantities of resources in stock, etc.
When a specific conquest objective is created, a battalion is assigned to this objective and units are selected to carry it out.
To bring diversity to teams AI, the notion of character is added to create modifiers to decision-making algorithms. The character is based on a random value between 0.5 and 1.5 for each of the deadly sins: Anger, Greed, Envy, Pride, Gluttony, Sloth and Lust.
We use these values as we see fit in our decision-making algorithms, so no two teams will ever behave in the same way. Characters such as Sloth will increase certain cooldowns or reduce interest in distant objectives; Envy makes the team more aggressive towards objectives controlled by the opposing team; and so on.
The battalion layer
Each battalion is controlled by the second AI layer. A battalion is used to organize units around a single objective. It is supposed to react dynamically to the environment and update its immediate objectives in real time, but this behavior has not had time to be implemented. The battalion is therefore just used to manage the units it groups together.
The unit layer
Each unit is controlled by the third AI layer. Units behave in two ways:
- moving towards the objective
- patrolling
during these two phases, a unit can aggro an opposing entity, leading to combat.
There are 4 different types of unit, each using a different combination of resources:
- The minion: a basic unit with basic statistics.
- Attacker: weaker unit with enhanced attack capabilities.
- The defender: no attack but very resistant, used as bait in battles.
- Healer: keeps away from enemies and heals allies
Leave a comment
Log in with itch.io to leave a comment.