Monthly Archives: May 2015

You are browsing the site archives by month.

Imperium combat

I thought I’d blog a bit about how the combat resolution works in Imperium. It’s not just a simple die roll and then apply some random casualties, but there is a bit more to it than that. I’ll use as an example an infantry unit with 30 men firing basic rifles at another infantry unit with 20 men 150 m away.

Firepower

The first thing is to figure out a base firepower that the firing unit sends out in the air and how much of that firepower reaches the target.

baseFirepower = number of firing weapons * firepower per weapon
baseFirepower = 30 * 0.3
baseFirepower = 9

This firepower is modified based on the range to the target. At 50% of maximum range the firepower is unaffected, but then it linearly decreases and reaches a given modifier at max range. For the basic rifles the max range is 250 meter. Interpolating a bit gives us:

rangeModifier = 0.9

If the unit is low on ammunition then a modifier of 0.3 is applied. The units will never run completely out of ammo but can always share, scavenge, steal or somehow find something to fire, but the efficiency is greatly reduced. In our case the firing unit has plenty of ammunition.

ammoModifier = 1.0

The firing unit’s experience is also a modifier. A green unit will not fire as accurately and as well in general as an elite unit. They will fumble and just not get as much firepower into the air. This modifier is currently set at 0.5 for green units, 0.7 for regular, 0.8 for veterans and 1.0 for elite units. Lets assume our unit is a veteran unit.

experienceModifier = 0.8

The unit type modifier gives a slight penalty of 0.7 for firing cavalry units. They fire when mounted and the accuracy is just not too good. Headquarter units also get a slight penalty as not all men are busy firing, some will be busy shouting orders and leading the battle in general. Our unit is an infantry so the modifier is 1.0.

unitTypeModifier = 1.0

A terrain modifier is then applied based on the terrain the attacker is in. Some terrain is detrimental to the effect of the fire. As an example when firing in woods some of the firepower will hit trees and thus get lost. Different units get different penalties for different terrain. For instance artillery firing from a ford gets a 0.2 modifier which is the worst possible. Lets assume our unit is on a field and gets no penalty.

attackerTerrainModifier = 1.0

If the unit fires as part of an advance or assault then a penalty is applied due to the stressful and hasty situation. They units simply don’t shoot as well when on the move. This modifier is 0.7 for advancing or assaulting units. Our unit is standing still and firing and gets ni penalty.

missionTypeModifier = 1.0

Finally a random modifier is applied, it’s [0.8 .. 1.2]. Lets assume it’s 1.0 for this example.

randomModifier = 1.0

This is everything that affects the outgoing firepower, lets multiply it all together:

firepower = baseFirepower * rangeModifier * ammoModifier * experienceModifier * unitTypeModifier * attackerTerrainModifier * missionTypeModifier * randomModifier
firepower = 6.48

The total firepower that leaves the firing unit is thus 6.48.

Scatter

Now that some firepower has left the firing unit and flies through the air it will cause something to happen to the target. The first thing to modify the effect is how much the firing is scattered. This is basically similar to the rangeModifier, but does not diminish the firepower, it modifies where it lands. Each weapon has a scatter value which is based on the distance. Every weapon type is inaccurate at max distance. A flamethrower for instance has a scatter distance of up to 50 meters on a max firing range of 100 meters. Quite a  lot.  The scatter is calculated as a scatter distance from the target position and then modified by the attacker experience. The idea is that more experience units are more accurate at hitting their desired target. Elite units will have the scatter distance modified by 0.5 and green units will not have it modified at all. Finally a random modifier is applied. to the distance and the center point is calculated.

All units that are close enough will receive some damage. This tries to  make fire more realistic as units that were not targeted at all can still be damaged, even own units. So don’t fire into a melee where your own units are. The cut off distance is currently set at 30 meters from the “landing point”. Any unit further away than that will be unharmed and units within that radius will get a distance modifier based on how far they really were. Lets assume 10 meters of scatter.

distanceModifier = 1 - 10 / 30 = 0.66

Fire effect

Each unit within the area of effect is then dealt damage. It’s irrelevant for this example if there are other units close, so lets assume there are none. A target terrain modifier is then resolved. It is a value from 0.5 to 1.0 and indicates how well the terrain protects the target. Woods for instance has a value of 0.6, fields 1.0 and so on. Various unit types can also have slightly different modifiers to indicate how well they can use the terrain they are in. Lets assume the target is in scattered trees:

targetTerrainModifier = 0.8

Finally the casualties are calculated. This gives us a direct value of how many men were hit:

casualties = (firepower / hitUnits ) * distanceModifier * targetTerrainModifier
casualties = (6.48 / 1) * 0.66 * 0.9 = 3.85 men

The value is rounded down, which means that the target loses 3 men.

Retreating

We then calculate a percentage for how many men the target lost:

percentageLost = (casualties / men) * 100
percentageLost = (3 / 20) * 100 = 15%

If the target does not have command control the percentage is doubled and if the target is disorganized then it is also doubled. The reason for calculating the lost percentage is that it is used to check if the target unit will retreat. A higher percentage of lost men means it’s more eager to retreat. Our target has command control and is not disorganized, so the percentage is not modified. Then a random value from 0 to 100 is checked against the percentage. If it is less than the percentage then the unit retreats. So a disorganized unit simply has a higher chance to retreat. In our case the target does not retreat, but if it would have to retreat a suitable position away from the attacker would be chosen and the unit would retreat. For our example the target would have a 15% chance or retreating.

Finally the attacker has expended one ammunition point.

Phew, this is roughly how it all goes. 🙂

Imperium alpha is out!

So a few days ago I released the first alpha of Imperium. This marks the first time someone else gets to see the game for almost two years. I think it was time to see how it works for others and get some feedback. For me it works well, but I’m likely blind to all the real issues that it has for new players.

In case you are interested in testing it out and have a spare iPad, let me know. I distribute it via TestFlight which means that it’s very easy to test and only requires a minute or two of work to install.