Mini Empires

What does a strategy game look like if you only look at the minimap? I decided to recently explore this idea by returning to the classic Age of Empires II.

Initial exploration

I began by looking at a match with three AI players competing on a medium sized map. Here’s the starting state:

If *Ready Player One* taught me anything, it's that it is perfectly fine to cling to your childhood forever.

If Ready Player One taught me anything, it’s that it is perfectly fine to cling to your childhood forever.

By capturing a screenshot of the minimap every few seconds, we can create a time-lapse of the game. Each frame of the video below represents two seconds of real time. At 24 frames per second, the two hour game now takes a much more reasonable two and a half minutes:

Here’s the same match with the background removed. Reminds of me bacteria fighting it out in a petri dish:

Compositing the frames on top of each other revealed this thing:

While mean blending all the frames revealed common paths through the map:

To better show movement and action, I also tried looking only at the visual differences between each frame:

And here’s a visual representation of the each color’s coverage:

Color coverage of the map. Played at 2x the speed as the other examples

Combining the frames of the above video into a single image going left to right, we get:

Pretty.

Other matches

Watching the time-lapse of the AI’s behavior was fascinating, so I decided to capture a number of other matches to see what they would look like. Unless otherwise noted, all of them used the following setup:

Here’s the match from earlier, plus three replays of it. Each one evolves differently despite the same starting conditions:

In these time-lapses, you can also start to make out patterns in the AI’s behavior. Much of it is rather nonsensical—at least at the standard difficulty—with the AI attacking by sending a line of units towards the target or retreating right as it has amassed an army at the edge of the enemy’s defenseless town.

Three player matches are particularly interesting because of their dynamics. Sometimes two players gang up on the third, sometimes there’s a royal rumble in the center of the map, and sometimes the third player executes a sneak attack while players one and two bash it out (the AI is not smart enough to actually plan out any of these maneuvers, they just emerge naturally).

The lack of these dynamics makes two player matches shorter and generally less interesting. Here are a few of those:

Things improve again when we move to four player matches. In these, the fourth player is often eliminated early on, resulting in a three player match again.

I captured most of these matches by letting them run overnight. Most lasted an hour or two, but a few stabilized into stalemates. In four player match below for example, things started out exciting before the AI seems to have gotten stuck. Having exploited all land resources, blue and yellow just gave up while red continued happily fishing away forever.

Eight player matches are more chaotic. These matches involved four, two player teams:

Gold rush

Fortress

One of the games had almost zero combat:

Slicing

Of course there are plenty of other ways to look at the data besides a time-lapse, one of the more interesting approaches coming from projecting the 2D slices of the minimap into a three dimensional volume. I used ImageJ for this analysis.

Here’s the original match as a 3D volume:

The z axis (shown vertically here) is time. In the volume, buildings form solid vertical lines since they never move between construction and being destroyed.

Zooming in, we can also see the movement of troops and villagers through space and time. These look like little passageways:

Especially cool are the faint, spiraling trails of scouts moving through the map. These are much clearer in 2 player matches:

Eight player matches on the other hand are pretty much a mess.

Finally, by taking a 2D through the slices of the volume, we can look at individual planes of the map over time:

End

While the 3D projections are neat, I still find the simple time-lapses the most interesting. The minimap is very much a petri dish view of the game with each side reduced to a splotch of colored pixels, and somehow it’s fascinating to watch to watch the colors surge, retreat, and conquer. Maybe that’s what all combat looks like from high enough up.

You can find the scripts used for this project here. They are super rough so your milage with them may vary. It might be fun to apply these same techniques to other games, and are surely plenty of other neat ways to look at data like this too. Let me know if you create anything interesting.