Tanks VR devlog #6 - bots progress
A problem many VR multiplayer games experience is a lack of active playerbase. Many players have commented on the lack of active players in Tanks VR. In order to get more concurrent players, we want to introduce bots to the game. This allows players to play singleplayer, co-op or multiplayer with bots. In turn we hope that this will cause players to have longer play sessions, increasing the chances of encountering other players. While adding bots can grow the active playerbase, it will also make the matches more interesting. Currently we have mostly seen small 1v1, 2v2 matches. With bots, every match can become a 5v5 match, despite the amount of players in the match. In this devlog, we will show the AI system we've been working on the past weeks as well as what we still want to achieve in the coming weeks.
Utility based AI
Most AI systems are simple state machines. This means that these bots make decisions based on "if .. then". For example, if an enemy is close to the bot, then it should find a position further away. Which is normal behaviour. Now imagine that the enemy HP is low, so the bot should be able to destroy the enemy in one shot. The bot will have to take that into account. Now imagine that there are 5 enemies nearby with low HP, then the enemies would be able to destroy the bot without any problems. We can imagine a huge variety of special situations with unique circumstances that would need to taken into account when developing a state machine AI system. This would be simply not possible, so such AI systems often result in boring and predictable behaviour.
In Tanks VR, we wanted a system that reflects the type of game it is, which is tactical. We wanted to take into account a whole list of important variables, such as:
- Own, enemy and teammate positions
- Own, enemy and teammate turret direction
- Own, enemy and teammate reload time
- Own, enemy and teammate HP
- Cover based on enemy and teammate positions
- The objective(s)
Therefore we have decided to make use of a so called "utility based AI" system. Utility based AI tries to model human decision making. It scores each action with a value, which tells the AI if it's a desired action. For example, if you're very hungry, but also slightly thirsty. The utility of eating a sandwich is higher than drinking a glass of water. Thus you choose to first eat a sandwich. During eating, your hunger decrease and you will keep eating until the utility of drinking is higher than eating. So you will decide to take a gulp of water. This concept can be applied to any type of decicion you make, such as driving your tank into cover instead of firing at an enemy.
|Utility in humans|
We want the Tanks VR bots to take all relevant variables into account, such that it will make the best decision available to the bot at the time. The bot will take into account that an enemy with low HP, long reload time, closeby with no support, is not considered a threat to the bot. Thus the bot will hold his ground and engage the enemy. Moreover, a bot will become more confident when teammates are nearby. He might even push towards the enemy, if that action has a higher utility than staying put.
In order to score each action the bot can take, the bot needs information about his surroundings. For example, the bot checks if it can see the enemy. An enemy that is seen will get a higher threat score than an undetected enemy. The bot will then score some nearby positions based e.g. the line of sight, distance and more variables at that position. It will then determine the best action to take based on the scores of each action. For example, it can choose to turn its turret, move to cover, flee from the enemy, fire at the enemy and more.
The gif belows shows a bot driving for cover based on the positions of two enemies. It can be seen that the bot is trying break the line of sight of one of the two enemies, such that threat score of that enemy is lower. The values in the grid around the tank show the utility for each cell. In this case it can be seen that the position of the highest utility is behind cover, shielding the bot from one of the two enemies.
|Bot being ambushed by two enemies.|
When a bot spots a new enemy, it will try to find a better position to fight. The gif below shows an enemy approaching a bot from the rear, while the bot is already engaged with another enemy. The bot reacts by driving to a better position.
|Bot drives to better cover after spotting new enemy.|
Another interesting result of our AI system, is that bots will actively seek cover behind teammates or low threat enemies. The gif below shows a bot with low HP hiding behind a teammate, in order to avoid being destroyed.
|Bot with low HP uses teammate for cover.|
We want to introduce variety to the bots, by assigning each bot a random personality and intelligence. Some bots might be more scared, causing them to stay back instead of pushing enemies. Other bots might be overconfident, making them overextend into enemy line of fire. Combining these personalities with a random intelligence gives interesting results. You could end up with a dumb overconfident bot that makes a lot of mistakes in situation assessments and has slow reaction speeds. Or a smart objective playing bot that makes good situation assessments and reacts quicker to events. There are endless possibilities, but we want certain personalities to be correlated with certain intelligence levels.
The bots are expected to be released in the beginning of june. In the coming weeks we want to work on adding firing, improving navigation and adding the personalities to the bots. We're also still working on the new city map and reworking the old city map, which were mentioned in the previous devlog.