Stochastic simulation of Combat

SLAM: debunk creationism, pseudoscience, and superstitions. Discuss logic and morality.

Moderator: Alyrium Denryle

Post Reply
User avatar
Steel
Jedi Master
Posts: 1120
Joined: 2005-12-09 03:49pm
Location: Cambridge

Stochastic simulation of Combat

Post by Steel »

Since it has come up a few times, and as it is interesting in its own right, I thought it might be interesting to do some simulations of combat. (I'm not sure if here or history is the best forum, as that is where the issue has popped up most recently.)

The basic idea is to make a stochastic model of combat, then wrap it up in Flash and put it online so people can stick together two forces and run a bunch of simulations to see what the probability of one force beating another is. An example thing might to be to ask "What if my ships are twice as tough as theirs, can I make up for a 3:2 numbers disadvantage?", as that was the sort of thing that came up in the Jutland threads.

If we just use Lanchesters equations to deterministically model simulations, we will get some answer, but for small numbers of units there is a significant variance in results. Consider for example a 2 on 1 duel of equal opponents: deterministically the side with 2 units always wins, but looking at it stochastically the side with 1 unit actually has a 1/6 chance of winning (1/3 chance of getting the first kill, then 1/2 chance of winning the resulting 1:1 duel). You can do some interesting stuff with pen and paper, but you quickly run out of things that can be done without extreme effort.

So the idea is to do an individual based stochastic simulation (this would allow for different parameters for each unit in a force) and extract some interesting statistics. The simulations would be running until one force is annihilated, but we can assume that if a force would retreat given that they could see the way things were going then that's a win for the dominant force either way; these simulations form the heuristic that the forces would use to determine whether or not to fight.

I've knocked together a quick test version where the combat simulation has the following parameters for each unit:

Fire rate (shots fired/time)
Accuracy (p(hit))
Defence (probability of units defences negating a successful hit)

if a unit is successfully hit then it is destroyed: unless your armour manages to deflect the hit to the extent that you are still effective in the fight then whether destroyed or unable to fight any more you're out of the game.

The model is currently just a simple one where any unit can engage any other unit, and there is no target selection or priority.

The statistics I was thinking of tracking are:

Probability of a force beating another force - how likely are you to win given you fight?
Expected numbers of units remaining given that a side wins - if you do win, is it worth it?

as well as watching a full individual simulation as time progresses for if you want.

I'm looking for what people think might be interesting parameters to explore, as well as the statistics to gather from simulations. If people are really interested then we can change the combat model significantly to look at specific things, and if necessary run some big parameter sweeps as I have access to a ~500 core cluster (although with the model as simple as it is I can do thousands of runs a second on just a laptop).

It might be that nothing comes of this if I'm too busy at work or if other things get in the way, but hopefully I can crank something out quickly.
Apparently nobody can see you without a signature.
Nitrophage
Redshirt
Posts: 15
Joined: 2013-04-26 04:41pm
Location: Dublin, Ireland

Re: Stochastic simulation of Combat

Post by Nitrophage »

This does sound interesting though there will certainly be more than just ROF, ACC, and DEF to take into account. To use a historical example, consider spearmen versus cavalry - the former will a have a higher accuracy against the latter than, say swordsmen. But if the cavalry keep their distance using their speed, any missile weapons they have can get hits on the spearmen but the spearmen can't touch them (the range problem). Another issue is diminishing capabilities. Say my ship gets a hit on yours (or hell, I shoot you). You may be able to continue fighting, but a reduced capacity. If each unit represented several guys, this would be the norm rather than the exception.

Looking back, that last paragraph seems very negative. But I do think that such a simulation would be very interesting, just the sort of online tool I love to play with.
But I just don't see how you can boil something so complex to just three variables unless you only intended it to work properly under very specific circumstances.
Basically you have three states of legality in Ireland. First you have all this stuff here which is "That's grand", then you get into this stuff which is "Ah now, don't push it'" and finally you get to "Right, you're taking the piss"

-Dara O' Briain
Simon_Jester
Emperor's Hand
Posts: 30165
Joined: 2009-05-23 07:29pm

Re: Stochastic simulation of Combat

Post by Simon_Jester »

The Lanchester laws are designed to model deliberately simplified situations: each "unit" on your side shoots with a fixed probability of destroying an enemy "unit," and vice versa. This is actually a fairly good model for, say, artillery duels (where shells land semirandomly), or battleship combat, or fights between long lines of guys with muskets in the open.

It is not a good model for, say, a bunch of guys assaulting a fortification who are getting shot at from long ranges where they cannot reply.
This space dedicated to Vasily Arkhipov
User avatar
Steel
Jedi Master
Posts: 1120
Joined: 2005-12-09 03:49pm
Location: Cambridge

Re: Stochastic simulation of Combat

Post by Steel »

Nitrophage wrote:This does sound interesting though there will certainly be more than just ROF, ACC, and DEF to take into account. To use a historical example, consider spearmen versus cavalry - the former will a have a higher accuracy against the latter than, say swordsmen. But if the cavalry keep their distance using their speed, any missile weapons they have can get hits on the spearmen but the spearmen can't touch them (the range problem). Another issue is diminishing capabilities. Say my ship gets a hit on yours (or hell, I shoot you). You may be able to continue fighting, but a reduced capacity. If each unit represented several guys, this would be the norm rather than the exception.

Looking back, that last paragraph seems very negative. But I do think that such a simulation would be very interesting, just the sort of online tool I love to play with.
But I just don't see how you can boil something so complex to just three variables unless you only intended it to work properly under very specific circumstances.
I'm initially thinking about this from the simplest cases, then expanding to more complicated scenarios if there is interest and I have time, although I am trying to build things generally so that it can be extended later. For now, there is no explicit consideration of space, and I'm thinking primarily about ranged combat. Melee combat has additional considerations as you need to model movement in some ways and to account for the fact that you can only engage with some proportion of your force at a time, and only with some fraction of the enemy as well (ie the front ranks or whatever).

I've built the simulation around an individual based model, so this means that although its simple for now it can be extended to take into account considerations like the diminished capacity of individual units with damage. For now I'm only doing a simple model so that for debugging purposes initially I can compare to either things I can do analytically or solutions to stochastic lanchester like models.
Simon_Jester wrote:The Lanchester laws are designed to model deliberately simplified situations: each "unit" on your side shoots with a fixed probability of destroying an enemy "unit," and vice versa. This is actually a fairly good model for, say, artillery duels (where shells land semirandomly), or battleship combat, or fights between long lines of guys with muskets in the open.

It is not a good model for, say, a bunch of guys assaulting a fortification who are getting shot at from long ranges where they cannot reply.
I think the long lines of guys with muskets is one example where space is important, as you're really firing on an area target in that case, so as they suffer casualties and gaps appear your woefully inaccurate fire becomes less effective. Same with the artillery duel if you have unaimed fire, there the N squared law doesn't apply any more, as the larger force is potentially disadvantaged as they occupy a larger area and thus are easier to hit.

Anyway, I've managed to get a working version of the underlying model done in C++, I'm now going to make a few changes and then wrapper it up in Flash and see about deploying it. This should take between a few hours and forever depending on how cooperative everything is...
Apparently nobody can see you without a signature.
User avatar
Purple
Sith Acolyte
Posts: 5233
Joined: 2010-04-20 08:31am
Location: In a purple cube orbiting this planet. Hijacking satellites for an internet connection.

Re: Stochastic simulation of Combat

Post by Purple »

How does this translate to any form of warfare where you actually have some form of strategy at all? In fact, I am curious to see how it translates to the situation where the opposing line of napoleonic infantry decides to play unfair and do a bayonet charge.
It has become clear to me in the previous days that any attempts at reconciliation and explanation with the community here has failed. I have tried my best. I really have. I pored my heart out trying. But it was all for nothing.

You win. There, I have said it.

Now there is only one thing left to do. Let us see if I can sum up the strength needed to end things once and for all.
User avatar
Steel
Jedi Master
Posts: 1120
Joined: 2005-12-09 03:49pm
Location: Cambridge

Re: Stochastic simulation of Combat

Post by Steel »

Purple wrote:How does this translate to any form of warfare where you actually have some form of strategy at all? In fact, I am curious to see how it translates to the situation where the opposing line of napoleonic infantry decides to play unfair and do a bayonet charge.
Depending on what level you're modelling things at, this could be thought of as a strategic simulation. If for example the forces were being modelled as army groups then you've got a whole war, if they're a dozen individual men on each side then you've got a small skirmish. At the moment I'm more interested in the whole randomness aspect, and if you're at the level of thousands of men then that gets washed out, and things behave much less randomly. As a concrete example, in a 2 vs 1 fight the side with 1 guy wins 1/6 of the time*, but a 2000 vs 1000 fight, the side with 1000 wins an absolutely miniscule number of times (p << 1/million).

*this is in the scenario where the probability of a hit is low per shot, otherwise the individual kills one of the pair, but is then certainly killed by the remaining member of the pair. This is an advantage of explicitly modelling things as individuals as results like this emerge naturally, rather than your differential equation model giving you garbage unless you very carefully think things through ahead of time- the expense is computational cost, but big computers are cheaper than big brains, and even the biggest brain can only solve analytically what is solvable.

If by strategy you're talking about lower level considerations, like what target should each individual force/unit engage, how should they go about that, then that's the next level of thing I want to consider, as it could be interesting to look at how target priority and tactical decisions affect things. Currently when forces engage each other each unit in the force selects a target randomly and engages it until it is destroyed, then selects another. There isn't a complicated model of target acquisition or cost of aiming, so this doesn't actually change anything yet. Also so far all my tests are with homogeneous forces, ie all units are the same type, so there is no glass cannon that you want to try and eliminate first or other such obvious tactic. Once I move on to considering those things, this kind of consideration will be very interesting to explore, both in terms of what is a good order to prioritise targets (probably in order of (target firepower)/(Expected time to eliminate target) but also what knowledge of the opposing force you have, and if you can actually know what you're shooting at. In the case of WW2 to modern infantry combat the individual squad members can't actually figure out (a) if they're actually engaging an individual and especially (b) the role/capabilities of that individual.

It looks like people are pretty interested in melee combat, so that might be something to put in in the future as well. I am planning to put in spatial considerations as well later on. Currently the forces are assumed to be maintaining approximately a constant distance from each other, but moving up to thinking about 1-d advance/retreat tactics shouldn't be much more effort.
Apparently nobody can see you without a signature.
Simon_Jester
Emperor's Hand
Posts: 30165
Joined: 2009-05-23 07:29pm

Re: Stochastic simulation of Combat

Post by Simon_Jester »

Steel wrote:I'm initially thinking about this from the simplest cases, then expanding to more complicated scenarios if there is interest and I have time, although I am trying to build things generally so that it can be extended later. For now, there is no explicit consideration of space, and I'm thinking primarily about ranged combat...

I think the long lines of guys with muskets is one example where space is important, as you're really firing on an area target in that case, so as they suffer casualties and gaps appear your woefully inaccurate fire becomes less effective. Same with the artillery duel if you have unaimed fire, there the N squared law doesn't apply any more, as the larger force is potentially disadvantaged as they occupy a larger area and thus are easier to hit...
Consideration of space is modeled in a second set of Lanchester laws, the ones covering "indirect fire."

http://everything2.com/title/Lanchester ... +of+Combat
This space dedicated to Vasily Arkhipov
User avatar
Steel
Jedi Master
Posts: 1120
Joined: 2005-12-09 03:49pm
Location: Cambridge

Re: Stochastic simulation of Combat

Post by Steel »

Simon_Jester wrote:
Steel wrote:I'm initially thinking about this from the simplest cases, then expanding to more complicated scenarios if there is interest and I have time, although I am trying to build things generally so that it can be extended later. For now, there is no explicit consideration of space, and I'm thinking primarily about ranged combat...

I think the long lines of guys with muskets is one example where space is important, as you're really firing on an area target in that case, so as they suffer casualties and gaps appear your woefully inaccurate fire becomes less effective. Same with the artillery duel if you have unaimed fire, there the N squared law doesn't apply any more, as the larger force is potentially disadvantaged as they occupy a larger area and thus are easier to hit...
Consideration of space is modeled in a second set of Lanchester laws, the ones covering "indirect fire."

http://everything2.com/title/Lanchester ... +of+Combat
There are in fact yet more elaborations of Lanchesters equations!

This has a good summary of a bunch more.

These all account for a bunch more factors in various ways.

For melee combat, its really a quite different system as only a fixed number of combatants can engage at a time as in the slide on Ancient warfare in that presentation above. N^2 law certainly doesnt apply there either.
Apparently nobody can see you without a signature.
Post Reply