Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I think your simulation should try to represent each unit acting independently and simultaneously. If so you will need to be very careful how you implement your simulation of each round. You don't want player 1 to have an advantage by being able to weaken or destroy the opposition's units so that they are less able to retaliate just because their turn is second. So all of the updating of the shields and integrity and explosions needs to be stored and applied after both players have made their moves.</p> <p>When you run the simulation, you will get a result that one or the other player won that battle. By running it an arbitrary number of times, and calculating for player 1 the wins / (wins + losses) you will get an estimate of the percentage of times player 1 would win given the starting situation. This is similar to tossing a coin to determine if it is a fair coin (see wikipedia). </p> <p>You can also calculate an estimator of the error and use this to determine the confidence interval. This gives you the range of values which would contain the true probability of player 1 winning the scenario an arbitrary percentage of the time (eg 95%). If you want to be extremely confident the range contains the true value and have a small margin of error the you will be in for a long night as you will need to run many simulations. You will also need more simulations if the battle is evenly matched rather than if it is more one-sided.</p> <p>I've done some rough calculations as per the wikipedia article on tossing a fair coin. If you are happy with a 95% confidence interval, and want the maximum error to be 0.01, then you need 10000 tests if the probability of winning is 50%. If it is only 25%, then you will need about 1350. If it is only 10% then you will only need 312. If you want the 99% confidence interval then you will need about 3 times as many tests.</p> <p>EDIT</p> <p>I think an analytical solution to this problem will be extremely difficult. I was going to suggest that you simplify your rules to make it more tractable.</p> <p>Rule 3 - Requiring a minimum weapon power to attack a particular shield is unlikely to have much effect on whether any structural damage is done to a unit unless one side outnumbers the other by 100:1. Any small amount of damage done if this rule were not in place would be healed when the shields are restored at the end of the round. I suggest ignoring this rule.</p> <p>Rule 6 - I think that if you have 100 blasters with a 10% chance of rapid fire, this is identical (from an average damage done to the enemy point of view) to having 110 blasters which don't rapid fire. So to calculate the effects of rapid fire, just increase the average damage done by the percentage chance of rapid fire.</p> <p>Rule 5 - This significantly complicates the situation as now the variance of the structural integrity values now significantly affects how many units survive to the next round. Without this rule you could just work on using the average damage done per unit to estimate the amount of damage done to the enemy similar to the other suggestions given. If you wanted to simplify this, I think it would be similar to modelling units that have 30% less structural integrity 85% of the time, which works out to reducing all units integrity by 25.5%.</p> <p>By doing this you will essentially be following Dariusz's approach</p> <pre><code>Eg if you have Side A: 100k bombers and 200k rocket launchers Side B: 130k bombers and 150k rocket launchers Expected total damage side A (ETDa) ETDa = 100k*BomberDamage*(1+rapidfire%bomber) + 200k*RLDamage*(1+rapidfire%rocketlauncher) This will be spread evenly between the units in side B based upon their percentage of the total number of units present. Expected total damage to bombers on side B (ETDBombersB) ETDBombersB = 130k/280k*ETDa Similarly ETDRocketLaunchersB = 150k/280k*ETDa Structural damage to bombers on side B is reduced by the amount of the bombers shields ESDBombersB = ETDBombersB - 130k*BombersShields Similarly ESDRocketLaunchersB = ETDRocketLaunchersB - 150k*RocketLaunchersShields Rather than have partly damaged units at the end of a round, I suggest you treat all existing units as fully healed, and apply the damage to units in turn until it is all used up. As above I am reducing the structural integrity by 25.5% to model the average chance of explosion. % of bombers destroyed = ESDBombersB / StructuralIntegrityBombers*(1-0.255)*130k % of rocket launchers destroyed = ESDRocketLauncherB / StructuralIntegrityRL*(1-0.255)*150k </code></pre> <p>Also note that by the central limit theorem you are more likely to get the average result when you have a larger number of units in the simulation, the extreme amount of damage one unit does will tend to be cancelled out by the low amounts that others do. I.e. it is much more likely to get extreme values 1 or 6 on a dice when rolling it once, than it is to get a total of 3 or 18 when rolling it 3 times. So this may make the statistically fudged analysis still reasonably useful.</p> <p>But if you are trying to simulate the situation in an actual existing game, then the rules are specified and you need to spend the time to work on a monte carlo simulation as originally described to get the most accurate result.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload