RuneWars Combat Simulator

By Aetheriac, in Runewars Miniatures Game

Hey all, I've started working on a simulator to run multiple iterations of combat between different units.

This project is still in a very rough state and currently does not handle upgrades yet.

I'm starting work on a frontend to make it more user friendly to setup the simulations.

Currently it can simulate melee combat between 2 units, including heroes. It handles basic tray elimination, mortal strikes, proper hit/damage application. It will throw the runes on each turn and alternate between the units for actions.

There are 2 scenarios for re-rolls right now. Blanks only, or non-hits/damage dealing faces (hits, double hits, and mortal strikes stay).

I still have to model the dials, and programmed dial progression through the turns. This basically means that you can tell the unit what dial settings you want to simulate for each of the 8 rounds.

It currently simulates 500K combat interactions, up to 8 rounds of combat per in about 2 minutes. It gathers statistics on the dice faces, re-rolls, unit death, and number of rounds of combat.

I'm wondering if anyone has interest in this type of thing, and what features/scenarios you would want to see? This will not model a full battlefield. I only intend to model 1v1 or 1v2 combats.

Rigorous, but no doubt there is great advantage to knowing the toe to toe stats/expected outcomes. Dare say upgrades may provide too many moving parts?

I forgot to add that Rune throwing per turn is modeled too.

Edited by Aetheriac

Great job, I have my own excel file that simulates combats. Its limited and very (very) spaghetti coded (I am not a programmer) but I can share it with you. The logic for rerolls is sound I would say.

1 hour ago, Darthain said:

Rigorous, but no doubt there is great advantage to knowing the toe to toe stats/expected outcomes. Dare say upgrades may provide too many moving parts?

Part of the idea for this was to be able to run simulations with different upgrades to judge whether any feel more/less useful than others, vs just gut feel from the table.

I really want to know the difference between a

2x2 Oathsworn Cavalry (Tempered Steel, Moment of Inspiration) and a

4x1 Oathsworn Cavalry (Tempered Steel, Rank Discipline)

Versus the same target. Maybe a 3x2 renanimate with some upgrades like lingering dead and a FL carrion lancer or something?

Anyway, the goal would be to determine the value of the 34 pt Hawthorne on the field. I realize that he also hands out inspiration candy, but at least this is a start.

3 hours ago, Glucose98 said:

I really want to know the difference between a

2x2 Oathsworn Cavalry (Tempered Steel, Moment of Inspiration) and a

4x1 Oathsworn Cavalry (Tempered Steel, Rank Discipline)

Versus the same target. Maybe a 3x2 renanimate with some upgrades like lingering dead and a FL carrion lancer or something?

Anyway, the goal would be to determine the value of the 34 pt Hawthorne on the field. I realize that he also hands out inspiration candy, but at least this is a start.

Well a 4x1 is going to put a multiplicative amount of damage where a 2x2 w/ MOI is going to have additive amount of damage. So I guess the question is how do numbers increase faster with multiplication or with addition.

So in the general case Damage equals:

2(X+W) for the 2x2, or 4X for the 4x1

where x is the number of hits. To compete this you could find the average number of damage done by each dice summed to equal X and that will give you the unit that give you the better average damage.

Edit: Did some mathing(adding that one surge can do one dmg w/ tempered steel, and I take Avg to be hits/faces):

X = 0.71 Avg hits, X+W = 0.70 Avg Hits so
the 4x1 will do 4*0.71=2.83 avg dmg

the 2x1 will do 2*0.70=1.4 avg dmg

So the 4x1 will do twice as much average damage

Maximum damage will be:

for the 2x2: (2(W) + 2(R) + 2(R) + 2(B+TS)) x2 = 16 DMG

for the 4x1: (2(R) + 2(R) + 2(B+TS))x4 = 24 DMG

So by max damage and average damage the 4x1 wins. Also with the 4x1 you only have to untap TS while the 2x2 you would have to find a way to untap MOI and TS.

Hope this analysis helps!

Edit: Oathsworn (RRB) are not Leonx Riders(RBB).

Edited by flightmaster101
3 hours ago, flightmaster101 said:

Well a 4x1 is going to put a multiplicative amount of damage where a 2x2 w/ MOI is going to have additive amount of damage. So I guess the question is how do numbers increase faster with multiplication or with addition.

So in the general case Damage equals:

2(X+W) for the 2x2, or 4X for the 4x1

where x is the number of hits. To compete this you could find the average number of damage done by each dice summed to equal X and that will give you the unit that give you the better average damage.

Edit: Did some mathing(adding that one surge can do one dmg w/ tempered steel, and I take Avg to be hits/faces):

X = 0.71 Avg hits, X+W = 0.70 Avg Hits so
the 4x1 will do 4*0.71=2.83 avg dmg

the 2x1 will do 2*0.70=1.4 avg dmg

So the 4x1 will do twice as much average damage

Maximum damage will be:

for the 2x2: (2(W) + 2(R) + 2(R) + 2(B+TS)) x2 = 16 DMG

for the 4x1: (2(R) + 2(R) + 2(B+TS))x4 = 24 DMG

So by max damage and average damage the 4x1 wins. Also with the 4x1 you only have to untap TS while the 2x2 you would have to find a way to untap MOI and TS.

Hope this analysis helps!

Edit: Oathsworn (RRB) are not Leonx Riders(RBB).

Thanks for the breakdown -- and here's the part that makes the simulator interesting: The 3x2 reanimates are going to survive that initial attack and counter-attack. Now your 4x1's threat goes down easily, the 2x2 less so. Modeling that is pretty difficult, but running it in a simulation makes it easier. @Aetheriac's simulator is running the combat until one side dies, or the maximum of 8 rounds are hit. It will be interesting to see what the % chance of success is given a full set of rounds.

2 points:

1. Modeling it and running it in a simulation are the same thing. Every simulator needs a model to know how things are to be evaluated. I haven’t used the simulator, but unless it’s running a Monte Carlo analysis the answer is going to be very similar to a thought experiment.

2. A 4x1 of oathsworn can one shot a 3x2 of reanimates. 24 dmg on a perfect roll is the same as 1 armor 1 wound 4 per tray x 6 trays. If I ran a Monte Carlo I could tell you what percentage of those attacks do such a thing.

Also I did not account for flanking in the original analysis.

I believe that it would fit a Monte Carlo style scenario.

As only vanilla units are modeled without taking into account flanking or morale checks or dials [or regeneration]...

Re-rolls are any non damaging die face.

4x1 Oathsworn vs 3x2 Reanimates

Oathsworn strike first

[Oct 26 01:06:41.826] INFO - Size: 99999
Total Rounds: 316546
Avg Rounds: 3
[Oct 26 01:06:42.173] INFO - First (Oathsworn Cavalry) kills Second (Reanimates) (isAlive): 74584 (delta): 74.58474584745848
[Oct 26 01:06:42.173] INFO - Both Alive (isAlive): 0 (delta): 0.0
[Oct 26 01:06:42.173] INFO - Reanimates (isAlive): 25415 (delta): 25.41525415254153
[Oct 26 01:06:42.174] INFO - Second (Reanimates) kills First (Oathsworn Cavalry) (isAlive): 25415 (delta): 25.41525415254153
[Oct 26 01:06:42.174] INFO - Oathsworn Cavalry (isAlive): 74584 (delta): 74.58474584745848

3x2 Reanimates vs 4x1 Oathsworn

Reanimates strike first

[Oct 26 01:08:05.011] INFO - Size: 100000
Total Rounds: 316598
Avg Rounds: 3
[Oct 26 01:08:05.179] INFO - Both Alive (isAlive): 0 (delta): 0.0
[Oct 26 01:08:05.179] INFO - Reanimates (isAlive): 28254 (delta): 28.254
[Oct 26 01:08:05.179] INFO - First (Reanimates) kills Second (Oathsworn Cavalry) (isAlive): 28254 (delta): 28.254
[Oct 26 01:08:05.179] INFO - Second (Oathsworn Cavalry) kills First (Reanimates) (isAlive): 71746 (delta): 71.746
[Oct 26 01:08:05.179] INFO - Oathsworn Cavalry (isAlive): 71746 (delta): 71.746

Edited by Aetheriac
8 hours ago, Aetheriac said:

I believe that it would fit a Monte Carlo style scenario.

As only vanilla units are modeled without taking into account flanking or morale checks or dials [or regeneration]...

Re-rolls are any non damaging die face.

Interesting. Help me interpret the data.

8 hours ago, Aetheriac said:

3x2 Reanimates vs 4x1 Oathsworn

Reanimates strike first

[Oct 26 01:08:05.011] INFO - Size: 100000
Total Rounds: 316598
Avg Rounds: 3
[Oct 26 01:08:05.179] INFO - Both Alive (isAlive): 0 (delta): 0.0
[Oct 26 01:08:05.179] INFO - Reanimates (isAlive): 28254 (delta): 28.254
[Oct 26 01:08:05.179] INFO - First (Reanimates) kills Second (Oathsworn Cavalry) (isAlive): 28254 (delta): 28.254
[Oct 26 01:08:05.179] INFO - Second (Oathsworn Cavalry) kills First (Reanimates) (isAlive): 71746 (delta): 71.746
[Oct 26 01:08:05.179] INFO - Oathsworn Cavalry (isAlive): 71746 (delta): 71.746

So this is saying:

You ran 100000 cases. On average combat took ~3 rounds

both units never lose a tray 0%

Reanimates Kill Oathsworn ~28% of the time

Oathsworn Kill reanimates - ~72% of the time

?

I think it would be valuable to see a plot spread. Kind of like a Gauss curve where you have overlays of the two units and percentage of trays left where the dependent axis is trays left and the independent is percent chance. You could have 1 side (negative) of the dependent be one units trays left and the other side (positive) be the other units trays left.

1 minute ago, flightmaster101 said:

Interesting. Help me interpret the data.

So this is saying:

You ran 100000 cases. On average combat took ~3 rounds

both units never lose a tray 0%

Reanimates Kill Oathsworn ~28% of the time

Oathsworn Kill reanimates - ~72% of the time

?

I think it would be valuable to see a plot spread. Kind of like a Gauss curve where you have overlays of the two units and percentage of trays left where the dependent axis is trays left and the independent is percent chance. You could have 1 side (negative) of the dependent be one units trays left and the other side (positive) be the other units trays left.

"Both Alive" represents both units still having trays/figures at the end of 8 consecutive rounds.

The analysis package is pretty simple right now, and there is more data collected than being presented.

Another caveat that I forgot to mention, the attacks are just alternating who hits first in the first round, and flip-flopping each round there after. Initiative and dial support will be added after a few upgrades are added.

There are two runs of data I posted.

First Scenario:

4x1 Oathsworn vs 3x2 Reanimates

Oathsworn strike first (full order of strikes, rnd 1: OS then RE, rnd 2: RE then OS, rnd 3: OS then RE ...)

Size: 99999 (total number of simulations collected)
Total Rounds: 316546 (the total number of rounds processed within the 999999 simulations)
Avg Rounds: 3 (the average number of rounds of combat processed per simulation)

OS kill the RE: 74.58% of the time

RE kill the OS: 25.41% of the time

The (isAlive) stat shows how many rounds the unit remains alive. In this particular case, the percentages match the kills as there were no simulation where both units survive.

Second Scenario:

3x2 RE vs 4x1 OS

Reanimates strike first (full order of strikes, rnd 1: RE then OS, rnd 2: OS then RE, ...)

Size: 100000
Total Rounds: 316598
Avg Rounds: 3
Both Alive (isAlive): 0 (delta): 0.0
Reanimates (isAlive): 28254 (delta): 28.254
First (Reanimates) kills Second (Oathsworn Cavalry) (isAlive): 28254 (delta): 28.254
Second (Oathsworn Cavalry) kills First (Reanimates) (isAlive): 71746 (delta): 71.746
Oathsworn Cavalry (isAlive): 71746 (delta): 71.746

By striking first, the RE had a slightly better survivability rate in the second scenario.

16 hours ago, flightmaster101 said:

2 points:

1. Modeling it and running it in a simulation are the same thing. Every simulator needs a model to know how things are to be evaluated. I haven’t used the simulator, but unless it’s running a Monte Carlo analysis the answer is going to be very similar to a thought experiment.

2. A 4x1 of oathsworn can one shot a 3x2 of reanimates. 24 dmg on a perfect roll is the same as 1 armor 1 wound 4 per tray x 6 trays. If I ran a Monte Carlo I could tell you what percentage of those attacks do such a thing.

Also I did not account for flanking in the original analysis.

I guess by modeling I meant closed form. We can solve for the exact percentages if we give ourselves a simple rule for how to handle rerolls on the damage outcome of the 4x1 stack. We don't need Monte Carlo to determine the % change of getting 24 damage. We just need to know the % chance of getting {double hit} - {double hit} - {hit surge} after a round of rerolls. Though it's going to depend on our reroll strategy -- do we reroll all non doubles? going for max damage? or do we just reroll non damaging rolls?

Hopefully that didn't come across as snarky. Anyway, I think another interesting thing about this simulation is to determine what the best reroll strategy is? If you have 2+ rerolls, should you reroll all single hits? Does going for double-hits on red pay off? I'd be interested to know these things.

Edited by Glucose98
28 minutes ago, Glucose98 said:

I guess by modeling I meant closed form. We can solve for the exact percentages if we give ourselves a simple rule for how to handle rerolls on the damage outcome of the 4x1 stack. We don't need Monte Carlo to determine the % change of getting 24 damage. We just need to know the % chance of getting {double hit} - {double hit} - {hit surge} after a round of rerolls. Though it's going to depend on our reroll strategy -- do we reroll all non doubles? going for max damage? or do we just reroll non damaging rolls?

Hopefully that didn't come across as snarky. Anyway, I think another interesting thing about this simulation is to determine what the best reroll strategy is? If you have 2+ rerolls, should you reroll all single hits? Does going for double-hits on red pay off? I'd be interested to know these things.

All a simulation is going to do is play out those percentages. And by doing a Monte Carlo you will arrive back at those basic percentages. You can get a good flavor for what is better by basic thought experiments. Like I showed with my thought experiment and has been shown as mathematical consistency proportionality is always better than being additive. So threat > adding dice. Rerolling dice is going to smooth your results. Simulating wont change those facts. What the simulation is good for are the complexities of indirect impacts, which as I understand it aren't involved yet.

8 minutes ago, flightmaster101 said:

All a simulation is going to do is play out those percentages. And by doing a Monte Carlo you will arrive back at those basic percentages. You can get a good flavor for what is better by basic thought experiments. Like I showed with my thought experiment and has been shown as mathematical consistency proportionality is always better than being additive. So threat > adding dice. Rerolling dice is going to smooth your results. Simulating wont change those facts. What the simulation is good for are the complexities of indirect impacts, which as I understand it aren't involved yet.

The point I was trying to make in the original post was that the thought experiment gets really hard when you start incorporating trays being removed from the opponents and counter attacking. If you want to know which side is most likely to WIN over multiple rounds a simulator is starting to become the best answer.

I hope to get more parts in the simulation soon.

  1. Regeneration
  2. Basic/common upgrades
  3. dials with initiative
  4. Figure upgrades and accuracies

The main reason why I started this thread was to get an idea of what people would want to see first?

It'll be a nightmare to integrate, but morale is the most interesting to me. Damage is pretty easy to get a good estimate for, but the expected value of a two-strength morale test is really tough to get a sense for.

After adding regeneration last night, I noticed that reanimates win 9% more battles against spearmen with it vs without.