On the path to bots ‘understanding’ the situation better: round analysis

As I was thinking about how to have my bots make good decisions, I realised something crucial was missing: a ‘high-level overview of the map.

Early AI researchers trying to build a chess computer were faced with the same problem: how can we quantify how strong a position is? Given a position, who has the so-called ‘strategic’ advantage? (as opposed to small-scale short-term ‘tactical’ advantage)

In Tinker Tanks there’s a lot obvious stuff we humans can grasp from just a glance at the map in any given round: in what corner are most of a player’s units? Where are the mines to be found? Who seems to be winning this game, anyway?

So I created a small php function that tries to summarize some indicators about each player’s situation, based solely on the map. Here’s how it looks for now:

Player analysis pane, based on current round situation

Player analysis pane, based on current round situation

(only visible in debug mode for now)

True to Age Of Empires, ‘environment’ (they called it Gaia) is also a ‘player’.

Avg. X and Avg. Y measure where all units are ‘on average’, expressed in grid tiles. I am also playing with the idea of adding a ‘schematic’ green square with an ‘average’ dot for each player, where dot size is proportional to score (see below).

For the Environment player, XY position is calculated taking only the ore fields into account. So if a truck has no obvious ore field nearby he can have an idea where to go explore for the goodies!

I also (finally) took a first pass at defining a meaningful score: it is the sum of price*health over al units currently on the map. This can be refined of course, just as with chess strategy we might incorporate a ‘position advantage’ or something like that later on. Or factor attack bonuses into the equation.

Currently, the buildings/units available at game start are included in the score calculation, so even at round 0 score is quite high because homebases, war factories and ore trucks cost so much.

If I ever show this to players during a game I may have it start on zero for everybody, but I am not really sure if that’s the best approach for guiding a bot’s judgement yet.

In any case, I feel this ’round analysis’ is a nice pass towards giving bots a better ‘understanding’ of what is going on in the game. Soon all that will be left for them is to sense emotions based on your mouse gestures so they can use some psychological warfare…

Leave a comment