April 8, 2019

History VI: It Is Well That War Is So Terrible

The enemy said, 'I will pursue, I will overtake, I will divide plunder, my desire will be full of them, I will draw my sword, my hand will destroy them.' - Exodus 15:9 LEB

The Heidelberg Institute for International Conflict Research (HIIK) defines 6 levels of violence intensity between nations.

lvldesc.
0no conflict
1dispute
2non-violent crisis
3violent crisis
4limited war
5war

Levels 0-2 are non-violent, while 3-5 are escalated into actual conflict. This fascinating paper gives me a great set of models to use to predict conflict between nations [1]. For example, a variable for "border conflict" $C$ can be used as a "bad neighbor index": \[C = \sum_1^n x_i p_i,\] where $n$ is the number of bordering nations, $x_i$ is the previous year intensity for nation $i$, and $p_i$ is the percent of border shared with nation $i$. This paper [2] takes it a step further by providing a transition probability matrix between peace and war!

However, Hegre's robust model only transitions between no conflict (0-2), minor conflict (3), and major conflict (4-5). So I can use this to create a full transitional matrix between the 6 levels (using my old friend Inverse Distance Weighting).


After a bit of testing, that seems like it transitions way too quickly. My tests devolved into war within 10 years. Guess that's possible when everyone is super touchy. Let's try something more fundamentally based.


That does a little better. Doing a few tests shows it has a nice spread leading up to war, between 70 and 280 years for 5 tests. Perhaps it could even be modified per nation. Some are naturally peaceful, some are naturally expansionist. It is quite obvious from even a few tests how massively the matrix affects behavior.


At creation, every nation will be at Level 0 with its neighbors (barring circumstances like a secession from the parent hegemony, in which case it would already be at war).

However, this transition matrix is situationally agnostic. It doesn't know how much border I share with that crazy king who's always eyeing my silver mines. It doesn't remember the bloody civil war in which my people were brutally defeated but still nurse their wounds with undaunted pride and opportunistic ears. So while this system can add some substantial random salt, it's not the end all be all. We need a few more mechanics and numbers for that (rebellions, treaties, overall population contentment, confederations, etc). But for now we will assume that war is only governed by this single mechanic.

If two nations are at war, they will seek to capture the bordering city which has the highest raw desirability.

Now, how do two nations actually fight? There has been some work done about this from a game design perspective, but I'm particularly drawn to the Lanchester equations. These are very simple equations which describe the attrition rates of two armies of size $A$ and $B$ at battle: \[A'(t) = - \beta A(0)^{2-n} B(t)\] \[B'(t) = - \alpha B(0)^{2-n} A(t)\], where $\alpha$ and $\beta$ are the combat effectiveness of $A$ and $B$ respectively, and $n$ is the attrition parameters. $n=1$ is the linear case, where one solider kills one soldier, but $n=2$ is the square case, more applicable to modern warfare. It also turns out that when a defender is fortified, the attack attacks linearly, while the defender defends with the square law. This makes sense intuitively - it is difficult to take a position. So how do I use this in my game?

First I need to determine the raw number of troops. I'll pull random low percentage (3-6%) from the rest of the country to determine a standing army size, and 5x that from the attacked hex. This includes both urban and rural populations (right now, my rural calculation is 5 times the infrastructure number but I don't like this and will address it soon).

Potential issues: it doesn't make much sense for the entire standing army to reinforce a single city in every case. It may not be strategically important, or it may be the fortress upon which the whole balance hangs. There's no way to know, and I'm looking for verisimilitude, not accuracy.

Consider the following free cities:
  • Wienw, population 559 (rural 11,670), founded 3604. Militarization rate: 5.6%. Total military: 2,860.
  • Aedcad, population 6,694 (rural 31,110), founded 3325. Militarization rate: 4.9%. Total military: 1,742.
Aedcad attacks Wienw but is met with a much larger defending force (Wienw gets a boost because it's being attacked). To figure out who wins and how many troops are lost, I need a measure of $\alpha$ and $\beta$. If one side has steel swords and the other has bamboo canes, it almost doesn't matter how many people you have with canes. Technically, I can get numbers for weapon availability by leveraging the market system, but I can't computationally afford to do that every simulated year. So instead, I'll use the desirability and infrastructure indexes, which are updated regularly. The theory being that resource availability yields a higher desirability, and a higher infrastructure gives you a better mechanism to train your troops. For Wienw ($\alpha$) and Aedcad ($\beta$), this gives \[\alpha = {0.7368 \cdot 103 \over 10} = 7.589\] \[\beta = {0.5242 \cdot 21 \over 10} = 1.101\] The indexes are averages of the entire hegemony (which in these cases is only one hex) and they are divided by 10 to bring it into a reasonable range. A soldier from Wienw can kill almost 8 enemies before he dies, but an Aedcadian can only manage around 1.

The solutions for the above equations are too long to display here, but suffice it to say that Aedcad was soundly defeated (using $n=1.25$). Defenders will hang on until they have lost 50% of their troops; attackers will break off if they have lost 30%. Aedcad (red) loses 528 men in the attack - a costly battle, and Wienw (blue) only loses 467. Because these are single cities, it's easy to just subtract the casualties; in the case of larger hegemonies, all cities will lose some in proportion to how many they supplied.


However, as robust as this may seem, I don't know if it will be fast enough to use as my primary engine of war. I'll have to run some tests with some non-linear solvers. But otherwise, it's a fair start.

Potential issues: why would Aedcad attack Wienw in the first place, given Wienw's military and numbers advantage? However, we have information that Aedcad does not: perfect information on the likelihood of a victory or loss. Until we salt the system, Aedcad will always lose this battle. It's just a question of by how much. I'd also like to create some castles/other fortifications, because these are gameably cool, would most likely be built in highly contested areas, and would give a significant defensive boost.

References:

  1. B. Boekestein, “A Predictive Logistic Regression Model of World Conflict Using Open Source Data,” Air Force Institute of Technology, 2015.
  2. H. Hegre, J. Karlsen, H. M. Nygård, H. Strand, and H. Urdal, “Predicting Armed Conflict, 2010-2050,” Int. Stud. Q., vol. 57, no. 2, pp. 250–270, Jun. 2013.

No comments:

Post a Comment