Published in

Excursions

# The Geometry of Empire 1: Protecting Your Borders

How many border forts does an ancient city state need to secure it borders? This is the basic problem we’ll tackle in a series of articles, at the intersection of mathematics and game design. We will keep the math mostly to abstract thinking and geometry. We’ll start simple today, and examine more elaborate scenarios as we go on.

Let’s get defending!

## The Situation

Let’s assume a circular territory, where one defender (blue) must respond to one attacker (red). The invader appears at the border. The defender moves to intercept him as quickly as possible.

In this basic setup, the defender must travel the length of the empire to protect it, and we can imagine a lot of damage happening during the wait. This prompts the defender think about some alternate strategies: he could divide his forces, and spread them out around his empire. But where? This is the question we’ll tackle today. (We’ll address how many defenders to have later.)

## Simplify

On a uniform, circular territory, we can greatly simplify the question of placement. Each unit can best defend the area around it, and all the units are equivalent, so they should defend equivalent portions of the territory. We can therefore divide the territory into equal sectors, and assign one defender to each. For example, if there are four units, each defends a quarter.

An attack can occur from anywhere, so we should try to minimize the distance to all points on the edge. There’s no reason to deviate from the center line: that would favor one side more than another, and open a hole for an attacker.

## Possibilities

Where should we be on the mid-line? Let’s begin be considering the extremes.

If the defender is located at the origin of the territory (left image) all possible attack sites on the edge are equidistant — but also as far away as possible. If the defender is instead located at the edge itself, on the midline (right), it can immediately intercept attacks at that one point, but must travel to the rest of the edge; and the corner of the sector becomes the most distance target.

This starts to give us an idea about how hard it is to defend different parts of the edge — with the corners and center point deserving special attention.

## The Limiting Factor

In fact, our two extreme cases above tell us what we can’t do. While we can choose to defend the center point very well — to the detriment of everything else — we can’t actually do the reverse. At no position (on the midline) is the defender closer to the corners than to the center. Here is a random position to illustrate:

No matter where on the midline we are, the corners will always be our weak spot. Therefore, we should pick a position to defend them as best we can. Since both corners are equally important, that position must be midway between them:

No other position is closer to both corners than this. It will best protect us from a savvy attacker who targets either corner, and will also protect us (even better) from any other attack.

(You may say: but to best defend the corners, we should have two attackers. That would mean a greater division of the territory, into smaller segments; again with each defender needing to be positioned. But the question of how many segments to have is a valid one — which we’ll address in a later piece.)

## Geometrically Determine the Best Point

Exactly how far out is our ideal defensive position from the center of the territory? To find out, we can sketch it in a more familiar geometric way:

We know the angle alpha, which is 360 divided by number of segments, then divided by two again — in this example 45 degrees. If we treat the territory as the unit circle, length AC is 1. Since the central point is a right angle (the proof is left to the reader), we can use a trigonometry identity to find AD:

`cos alpha = AD / ACAC = 1AD = cos alpha`

In our example, this yields ~0.71, meaning our defenders should be 71% of the way out from the center. This percentage increases rapidly as the number of segments/defenders rises from 1, and then slows to asymptotically approach 100%.

Here is what that looks like from a bird’s eye view of the territory:

## How Far to Intercept?

Any savvy attacker will choose to strike at the corner of sectors. The defender must travel the distance CD which we can get from:

`sin alpha = CD/ ACAC = 1CD = sin alpha`

Which in this example is also 71% of the territory’s radius. It’s still high, but much better than the 100% required when the defender lives at the center of the territory.

(Note that our example, with four sectors, is the only case in which the intercept distance perfectly matches the ideal placement, at ~71%.)

Next time: What happens when the attacker doesn’t sit at the border but instead moves to invade the center of the empire?

--

--

--

## More from Excursions

Casual mathematical explorations of games, history, and science fiction

## Jasper McChesney

Data, graphics, games. So You Need to Learn R.