Wednesday, May 18, 2016

Evaluate average to-hit probability, average hits and criticals in combat situation

You can find data sheets giving the probability to hit if you attack with three dice, have a focus, and the defender has 2 dice. In Squadron Benchmark, the menu entry "Probability" does just that for instance. However, what are the probabilities to hit when you have 4 ships with Twin Laser Turret firing on the same target ? What are then the average hits taken ?

This is the kind of situation now where Squadron Benchmark brings you an answer, in the version 0.8.8. Just press the button displaying the range of fire of the weapon, for as many units as you wish, it now displays additional information.


For instance, Vader, Soontir + Stealth Device + Autothrusters and a shuttle are here facing 2 Syndicate Thugs with Twin Laser Turrets.





 Pressing the primary weapon button for Vader shows now 3 values on the Thugs:
  • The to-hit percentage, corresponding to the probability to hit the target. Vader has 56% of chance to hit the first Thug, 41% to hit the second one
  • The average hit results: at the end of the combat, once all red and green dice have been compared, the attacked unit is dealt the hits and criticals that have not been cancelled. The mean value for each is shown here. The first thug takes in average 0.52 hits
  • The average crit result: Same as before for uncancelled crits. The first thug takes 0.19 crit in average.
What happens if the shuttle fires at the same turn ? The results shown for the first thug correspond to the updated values if BOTH Vader and the shuttle fire at it in the same turn: They have 88% of chance to hit it, with an average 1.36 hit result, 0.52 critical.
How is it computed ? The average results for hits and crits for Vader and the shuttle are simply added. For the to-hit probability, the probability to not hit is computed for Vader and the shuttle, they are multiplied and the final result is 1 - this probability to not hit, neither with Vader nor with the shuttle.



Now a more complex case.When the first Thug fires with the TLT, we can see he has 92% of touching the shuttle, taking into account both attacks. They perform in average 1.48 hits, and 0 crits (it's a TLT). For Soontir, the chance is only 43% to hit.

When both Thugs are firing at the same target, the shuttle seems an easy target with an average 2.92 hit taken by the shuttle.

The results are computed for the shuttle and Vader as if 4 different units were attacking them. The effect of Autothrusters needs more explanations. For each combat, the complete distribution of results is computed, associating for each combination of modified dice (red and green) the probability to see it: for instance, the probability to have 1 focus, 1 crit and 1 hit for the Thug, 1 evade, 1 focus and 2 blanks for Soontir is computed. The Autothrusters modify Soontir results into 2 evades, 1 focus and 1 blank and the probability is added to the probability to obtain this result. The average of hits and crits, the sum of probability for hit results are computed and displayed.

If Vader and Soontir have a focus token, we can see that the % to hit decreases, but not that much because if it is used in the first attack, it is no longer available for the second one.
Here the results for Vader and Soontir are only approximations: the values shown correspond to the case where the focus is always used for the first attack, and never available for the second one. The successive attacks are no longer independent, and this would require too much processing power for javascript, at least with a brute force method computing the whole distribution. So the real figures are actually lower than these ones. 

A last example, with Contracted Scouts, in order to evaluate the impact of Guidance Chips and of the Punishing One title. The topmost scout has only  Plasma Torpedoes+Deadeye, the second one has additionally Guidance Chips and the third one has Plasma, Deadeye, Guidance Chips and is the Punishing One (3 for primary weapon).
 The first ship  has 61% of chance of hitting the first IG-88 (both with Autothrusters) and only 48% of chance for the second one, at range 3 (Autothrusters effect).
 The Guidance Chips adds +24% of chance to hit the first IG-88, +30% to hit the second one. Not bad for a 0 point upgrade !

Finally, with the Punishing One title, the % to hit are the same, but the average number of criticals has significantly raised, from 0.45 to 1.18 for the first ship, 0.43 to 1.04 for the second one.







A real punishing attack, with all three Scouts, with focus and target lock (for firing the torpedo) for each, would deal 4.71 hits + 2.29 crit in average to the first IG-88, with their Plasma Torpedoes. More than 7 damages in average, a possible killing blow.
This is still a first draft for this probability evaluation and it may require some processing power. The web page may not be responsive while this is computing. This evaluation is part of the effort to improve the AI to better determine the threats and the force of its attacks.

The upgrades taken into account so far in the computations are the following.
  • Twin Laser Turret, TIE/D, Cluster Missiles, BTL-A4, Gunner, Luke Skywalker (crew), IG-88B for multiple attacks
  • Heavy Laser Cannon, Accuracy Corrector, Guidance Chips, Ion Cannon, Ion Cannon Turret, Ion Pulse Missile, Tractor Beam, Flechette Cannon, Adv.Homing Missiles, XX-23 S (modifying red dice or result)
  • Autothrusters (modifying defense dice)
All other upgrades/pilots that are not listed are not taken into account for the probability evaluation (Howlrunner for instance). The results are accurately computed for the listed effects. Tokens (evade, focus, target lock) are also taken into account, but an approximation is made when there are multiple attacks, since the tokens are assumed to be consumed after the first attack.

Enjoy !

77 comments:

  1. OMG you are crazy!

    This is so awesome!

    ReplyDelete
    Replies
    1. Thanks a lot! Hope this helps. Cheers !

      Delete
  2. Stat calculations look good!

    I found a problem with the following squad; Omega Squadron Pilot was automatically receiving an Evade token each turn.

    Academy Pilot
    Omega Squadron Pilot + Comm Relay + Juke
    Commander Alozen + Juke + Cluster Missiles + Guidance Chips + TIE/x1 + Accuracy Corrector
    Darth Vader + Juke + Cluster Missiles + Guidance Chips + TIE/x1 + Accuracy Corrector

    ReplyDelete
    Replies
    1. Yes, corrected. Comm relay was regenerating 1 focus token each turn. Cheers !

      Delete
  3. New problem playing unger Chrome:
    Game locks while first combat round. Played Guri, Xizor, Contr. Scout vs. 2 B-Wing + Eaden Vrill and vs. Chewbacca + 2 T-70.

    Cheers

    ReplyDelete
    Replies
    1. A late reply: it seems ok now. Cheers !

      Delete
  4. [Bug Report]

    I am unable to move the asteroids from their starting position during the setup.

    ReplyDelete
    Replies
    1. It was a temporary bug (in between two patches). Corrected !

      Delete
  5. Some bug reports:
    * Obstacles no longer cause damage to ships when flying through
    * When selecting both asteroids and debris as you three obstacles, I never get all the selected obstacles (sometimes I get only asteroids and sometimes I get only debris)
    * Dash cannot attack even though he barrel-rolled out of an asteroid
    * Kanan (crew) is once per round only (as it is now it works unlimited number of times). The ability should trigger a choice whenever a friendly white maneuver is performed.
    * XX-23 Tracers should also give carrier a target lock on the target.
    * Several Force Awakens Critical Damage cards faulty (the cards with identical titles as old core set damage cards; they have the old abilities). E.g. structural damage, damage sensor array, blinded pilot etc.
    * Conner net does not do any damage (but it should do 1 automatic).
    * I could perform a boost action right through an asteroid (with the template overlapping the obstacle). According to the rules this is not permitted.
    * Crack Shot is currently used before defender modifies dice. According to the faq Crack Shot should be used after defender modifies dice.

    ReplyDelete
    Replies
    1. Some late answers:
      * obstacles and damage: corrected
      * both windows for selecting debris/asteroids have been merged, making selection simpler now
      * For Dash, it's not fixed yet (no quickfix)
      * Kanan is once per round now
      * XX-23 gives also to the carrier a TL
      * For the criticals, indeed ! Modified so that Force awakens criticals are not the same as original set criticals (less lethal)
      * conner net adds one damage now
      * I think I corrected the problem of boost/roll through asteroid
      * added a modify step subphase, for crack shot and wampa
      Thanks again Hinny for these very detailed bugs and rule misreading ! Cheers !

      Delete
  6. Bug reports:
    With these squads, Prince Xizor's pilot skill showed as 11 (should be 9 with Veteran Instincts) and Howlrunner had starting Hull strength of 5 (should be 4 with Hull Upgrade).
    Syndicate Thug + Autoblaster Turret + Unhinged Astromech
    Syndicate Thug + Autoblaster Turret + Unhinged Astromech
    Syndicate Thug + Autoblaster Turret + Unhinged Astromech
    Prince Xizor + Veteran Instincts + Autothrusters + Virago + Fire-Control System

    Black Squadron Pilot + Crack Shot
    Black Squadron Pilot + Crack Shot
    Zeta Leader + Wired
    Howlrunner + Crack Shot + Hull Upgrade
    Omega Leader + Juke + Comm Relay

    ReplyDelete
    Replies
    1. Yes, this is back to normal now and works. Cheers !

      Delete
    2. I'm seeing +4 pilot skill with Veteran Instincts (this time on Zuckuss).

      Delete
    3. Yes, it persisted when the unit is created and then immediately used in combat. Corrected !

      Delete
  7. Another bug report:
    * Feedback array is working really strange. I have the option of taking either feedback array or primary weapon in combat, but when I press the primary weapon button nothing happens. Now I am forced to press feedback array and choose a target, but nothing happens and I must choose a target again. Now that target gets feedbacked and I get to shoot primaries as well. Or something like that -- It seems to differ each time I use it... In short, please do a thorough analysis of the feedback array.

    ReplyDelete
  8. Another bug report:
    * The app thought that this was an asteroid collision (a straight 3 move):
    http://imgur.com/DdMz9Vb
    I beg to differ...

    ReplyDelete
    Replies
    1. Sorry for this one, I cannot see what was the scenario. Hope I corrected the bug for asteroid collision anyway :-)

      Delete
  9. It would be nice if you could edit an existing squadron instead of starting from scratch each time you want to make a small change.

    ReplyDelete
    Replies
    1. I agree that it would be nice to edit an existing squadron using the menu tools that are used to create a squadron.

      That said, it IS possible to edit a squadron using plain text. If you know the name of the upgrades you want to add, you can just type them into the squadron box (1) or (2)

      Still, it would be nice to be able to edit using the menus as well.

      Delete
    2. Exactly ! Thanks for the answer. Now I've added the point total above the text area, so that it's a bit easier to type the modifications. You have also auto-completion, so even if you don't exactly remember the upgrade, by typing the first letters and pressing tab repeatedly, you will find it.
      For really modifying the squad, this will need more time :-)

      Delete
    3. Good enough for me! Thanks

      Delete
  10. Sorry for the spamming :)

    Bug report:
    The card Thermal Detonators is spelled without an "S" at the end in you app. This makes it impossible to import squads with this upgrade.

    ReplyDelete
  11. [Bug Report]
    Biggs Darklighter seems to work not quite right. I had a Contracted Scout fire a torpedo at a B-Wing with Biggs sitting right next to the B-Wing. It seems that the AI is choosing its weapon before choosing the target, then saying, "I can't fire this weapon at Biggs, so I don't have to attack him." But that's not the way Biggs works. He forces the attacker to attack him if possible, even if it is with an inferior weapon.

    ReplyDelete
  12. Bug reports:
    * Ion Pulse Missiles does not require a target lock on the target (but it should)
    * Cannot use Advance Sensor if this ship is switched to from another ship with the same PS.

    ReplyDelete
    Replies
    1. for Ion Pulse Missiles, there is no difference with other TL requiring weapons (Flechette for instance). What was the unit using these missiles ?

      Delete
    2. It's the same with homing missiles as well. These weapons require a target lock but does not spend it, maybe that is the difference between flechette and ion pulse. It's the same results with every ship I try it with so the composition does not seem to matter.

      Delete
    3. Indeed, there was a bug for missiles/torpedoes that does not consume TL or focus. Now corrected !

      Delete
  13. Small recent corrections:
    - cool hand bug
    - Tomax Bren, Deathfire, Systems Officer added
    -creation screen, perspective removed, upgrade installation checked and corrected for some (skill)
    -adaptability: one card, duality handled in setup
    -creation screen, mist hunter + cannon corrected (cannon couldn't be removed when mist hunter was removed)
    - feedback array corrected
    -plasma torpedo sound was missing
    -R4 Agromech: use focus and TL in same attack
    - Thermal Detonators spelling
    Cheers !

    ReplyDelete
  14. Very weird things happen with Deathrain, Advanced sensors, and Experimental interface.
    I get a Pre-move action from Adv Sens - but after I move I'm offered another action - then a further action with EI - and EI allows me to focus (and TL as well I think)
    Jan Ors Crew only seems to work on the ship she's equipped on.
    There doesn't seem to be any way to get Jan Ors to work on the focus that's passed from Garven

    ReplyDelete
    Replies
    1. For Deathrain + Advanced Sensors + Experimental Interface, I don't see now the free action from EI. I've probably changed something, now EI triggers but there is no action to perform (no upgrade with "Action:").
      For Jan Ors, corrected !

      Delete
  15. also - if I destroy a ship with the first attack from a cluster missile, I'm allowed to keep the CM to make another single attack against another target in a later round

    ReplyDelete
  16. With these squads, I had several issues.
    -Autoblaster Turret could not be selected as a firing option (the icon was there, but could not be clicked)
    -Twin Laser Turret would sometimes do damage when no hit was rolled (attacker rolls Focus-Focus-blank; defender rolls Focus-Focus-blank; no focus tokens are used)
    -Ion token from 4-LOM (crew) does not appear or does not persist from round to round
    Palob Godalhi + Veteran Instincts + Twin Laser Turret
    Kavil + Attanni Mindlink + Autoblaster Turret + Unhinged Astromech
    Bossk + Attanni Mindlink + 4-LOM + Dengar + Zuckuss + Engine Upgrade
    vs.
    Academy Pilot
    Academy Pilot
    Backstabber + Twin Ion Engine Mk. II
    Mauler Mithel + Wingman + Twin Ion Engine Mk. II
    Darth Vader + Predator + Shield Upgrade + TIE/x1 + Advanced Targeting Computer

    This squad would not load in the play area:
    Valen Rudor + Push the Limit + Autothrusters + TIE/v1
    The Inquisitor + Push the Limit + Proton Rockets + Autothrusters + TIE/v1
    Darth Vader + Veteran Instincts + Engine Upgrade + TIE/x1 + Advanced Targeting Computer

    ReplyDelete
    Replies
    1. Ok, all corrected. For TLT, I couldn't reproduce the bug so far. Cheers!

      Delete
  17. Bug report:

    Game cloggs after an Imp. Baron moves for the first time (everytime in 5 games now):

    Imperialer Baron + Crack Shot + Protonenraketen + TIE-V1
    Imperialer Baron + Crack Shot + Protonenraketen + TIE-V1
    Imperialer Baron + Crack Shot + Protonenraketen + TIE-V1
    Der Inquisitor + Crack Shot + XX-23-S-Signal-Peilsender + TIE-V1

    Thanks for your effort!
    Joscha

    ReplyDelete
  18. I'm getting a "script running slowly" error with these squadrons (usually when the first opportunity for the TIE Phantom to decloak occurs).

    "Winged Gundark" — TIE Fighter
    Twin Ion Engine Mk. II

    "Fel's Wrath" — TIE Interceptor
    Stealth Device

    Shadow Squadron Pilot — TIE Phantom
    Fire-Control System
    Darth Vader
    Advanced Cloaking Device

    "Zeta Ace" — TIE/fo Fighter
    Predator
    Twin Ion Engine Mk. II


    Zuckuss + Mist Hunter + Tractor Beam + Gunner + Fire Control System + Veteran Instincts
    Contracted Scout + Adaptability (-1) + R5-P8 + Anti-Pursuit Lasers
    Contracted Scout + Deadeye + Plasma Torpedoes + Extra Munitions + R4 Agromech + Guidance Chips

    ReplyDelete
  19. Bug Report :
    Phantom decloak broke the system.

    Take one Whisper/Echo. Move, take cloak as action, Next turn choose the move, at the start of activation phase all hangs

    ReplyDelete
    Replies
    1. Hmm, I cannot reproduce the bug. Instead, at the beginning of the activation phase, I see the green locations where Whisper can move (one is at Whisper current location). You don't see green squares(semi transparent) displayed at the start of the activation phase ? They are the same as for a roll or a boost.

      Delete
  20. Bug report:
    Tala Squadron Z-95s with Guidance Chips and Assault Missiles are not discarding Assault Missiles after firing.

    ReplyDelete
    Replies
    1. Sometimes program will hang sometime during the Assault Missiles sequence (after attacker rolls dice?). Squadron is
      Tycho Celchu + Chardaan Refit + Adaptability + Autothrusters
      Lieutenant Blount + XX-23 S-Thread Tracers + Veteran Instincts
      3x Tala Squadron + Assault Missiles + Guidance Chips

      Delete
    2. Maybe I've fixed this bug, I cannot reproduce the situation. Assault missile is fired and discarded, no hanging so far for me. Cheers !

      Delete
  21. Bug report:
    With the squad below, the "focus or evade" option from Jan Ors crew was offered even after her ship was destroyed.

    Poe Dameron (PS8) + Adaptability + R5-P9 + Comm Relay + Autothrusters
    Red Ace + R2-D2 + Comm Relay + Autothrusters
    Ezra Bridger (Shuttle) + Jan Ors (crew) + Rage

    ReplyDelete
    Replies
    1. Yes, no more after-life Jedi effect for Jan Ors now.
      Cheers !

      Delete
  22. Program gets stuck (usually around the first time something takes damage or is in combat) with the following squads (two playthroughs).

    Garven Dreis + Plasma Torpedoes + R2-D6 + Integrated Astromech + Draw Their Fire
    Dutch Vander + Proton Torpedoes + Extra Munitions + R5-P9 + Guidance Chips
    Esege Tuketu + Proton Torpedoes + Extra Munitions + Recon Specialist + Guidance Chips

    Black Sun Soldier + Feedback Array
    Ruthless Freelancer + Zuckuss
    Palob Godalhi + Adaptability + Twin Laser Turret
    Contracted Scout + Deadeye + Plasma Torpedoes + Extra Munitions + 4-LOM + Overclocked R4 + Feedback Array + Guidance Chips

    ReplyDelete
    Replies
    1. Ok, I tried but it seems to work ok for me (both sides played by me). One squad was played by the AI ?

      Delete
  23. Bug report
    Everytime I use a Tie Adv. Prototype program gets stuck. I tried that ship in different squads now. Protypes only and Inquisitor with Jax and Vader. Everytime the Prot. gets to choose an action the programm stucks.
    Cheers
    Joscha

    ReplyDelete
    Replies
    1. hmmm, I've tried Tie Adv. Prototype, but I cannot see a bug so far. Can you post your squad composition next time it happens, there's probably a bug with an upgrade...
      Cheers!

      Delete
  24. Bug report
    Everytime I use a Tie Adv. Prototype program gets stuck. I tried that ship in different squads now. Protypes only and Inquisitor with Jax and Vader. Everytime the Prot. gets to choose an action the programm stucks.
    Cheers
    Joscha

    ReplyDelete
    Replies
    1. It was just a plain Inquisitor ? seems to work now (as far as I can see it). Cheers !

      Delete
  25. Bug Report,
    I cannot even start a game. only my ships show up, no asteroids or obstacles, enemy ships, or even the side bars indicating which ships are on the map.

    ReplyDelete
    Replies
    1. Just reload the page, normally it works. If you have never seen the page (it never worked), probably a compatibility issue with your browser. You can try to upgrade it, if possible.

      Delete
  26. Bug Report:

    Dash is not presented with a Boost (when EU is equipped) or Barrel Roll option when his initial Movement lands him on an Asteroid. Only Focus and Target Lock are given, which is moot since not be able to move off the obstacle will result in his not firing anyways.

    ReplyDelete
  27. This comment has been removed by the author.

    ReplyDelete
  28. Bug report:
    With the following squads, Bossk was able to perform a 0 stop 4+ turns in a row, accumulating up to 7 stress tokens.

    Ruthless Freelancer + Fire-Control System + Inertial Dampeners
    Ruthless Freelancer + Fire-Control System + Inertial Dampeners
    Bossk + Veteran Instincts + Dengar + 4-LOM + Gonk + Engine Upgrade

    Syndicate Thug + Autoblaster Turret + Extra Munitions + Bomb Loadout + R4 Agromech + Seismic Charges
    Guri + Lone Wolf + Autothrusters
    Prince Xizor + Veteran Instincts + Autothrusters + Virago + Inertial Dampeners + Fire-Control System

    ReplyDelete
  29. Bug Report

    Dash Rendar no longer can boost or barrel roll on asteroids.

    ReplyDelete
  30. Amazing work man :)
    Two issues that I noticed though:
    1. PtL+Adv Sensors are behaving weird
    2. For boost you should be able to declare direction before it's executed (like in the rules); I wanted to boost right, but it automatically boosted left cuz right was obstructed and I ended up flying off the board next turn :D

    ReplyDelete
    Replies
    1. Thank !
      1- For PTL + Adv Sensors, you can choose to move or perform one of the action. If you choose an action, PTL triggers and you can do another action (the console tells you when it's a ptl action). Otherwise, you can start with a move, and then potentially 2 actions. You can skip any action (skipping the first does not trigger ptl).
      There is one strange possible scenario, though: action + move + ptl action. Well, this should not occur, I'll correct it at some point. The AI cannot use this sequence anyway.
      2- For boost/roll, I agree, sometimes the automatic choice, that should help, is not really helpful :-( I'm not too fond of a solution where users will need to always do one more click, though, for the few cases where it does not work. Now there is a "back" button working :-)
      Cheers !

      Delete
  31. Electronic Baffle doesn't work properly. After performing a red maneuver, the control immediately jumps to the next ship, which has a "!" icon for using Electronic Baffle. Clicking the "!" icon removes the stress and does a damage to the previous ship, but you then cannot perform any actions with the previous ship even though the stress was removed by Electronic Baffle.

    This also makes it so that you have to use Electronic Baffle every time you do a red maneuver, even if you don't want to take a damage to remove a stress.

    ReplyDelete
  32. It seems that Assault Missles will hang the game after firing them...

    ReplyDelete
  33. Bug report: Loading a saved squad with the Mist Hunter title does not grant the barrel roll action.

    ReplyDelete
  34. If a ship has used its action on Marksmanship, does not have a focus, and spends a target lock, the focus results are rerolled. It would be better to leave them, so Marksmanship can do its thing, lest they come up blank on the reroll.

    ReplyDelete
    Replies
    1. Same with Keyan Farlander with a stress token. You don't want to reroll focus results in this case either.

      Delete
    2. Yes, now reroll effects do not reroll focus for Keyan (when stressed), Glitterstim, Marksmanship, Han(crew, when targeting). It does not interfere however with "must reroll" effects, such as Han Solo, R4-B11, R7 Astromech, Elusiveness, Zuckuss (crew).

      Delete
  35. Bug report:
    * Visual and actual size of debris (and possibly asteroids as well?) differs. I have several examples when it is obvious that you cleared the debris but get a stress token anyway.

    ReplyDelete
  36. This comment has been removed by the author.

    ReplyDelete
  37. Getting the Shaken Pilot critical hit plus an ion token means that there are no maneuvers available to choose, so you can't advance the game. When ionized, you don't really choose the maneuver, so the conflict wouldn't really come up.

    ReplyDelete
  38. Bug report: Tel Trevura pilot ability did not trigger as expected. Program also doesn't end game when all ships are destroyed on one side.
    Squads:
    Blue Squadron Pilot + Fire-Control System + Flechette Cannon + B-Wing/E2 + Gunner
    Blue Squadron Pilot + Fire-Control System + Mangler Cannon + B-Wing/E2 + Gunner
    Blue Squadron Pilot + Fire-Control System + Mangler Cannon + B-Wing/E2 + Gunner

    NDru Suhlak + Veteran Instincts + Cluster Missiles + Glitterstim + Guidance Chips
    Trandoshan Slaver + 4-LOM + Dengar + Zuckuss
    Tel Trevura + Deadeye + Proton Torpedoes + Extra Munitions + Boba Fett + R4 Agromech + Guidance Chips

    ReplyDelete
    Replies
    1. Tel Trevura should work better now, even with a Hull upgrade. Cheers !

      Delete