
Post by thealmightymudworm on Mar 21, 2014 18:48:01 GMT
From TUFFF (August 2011)...



Post by thealmightymudworm on Mar 21, 2014 18:50:15 GMT
From TUFFF (after some teething troubles)... ...if you're interested in how it works...well that second page calculates the probability of winning one attack round based only on SKILL levels. And the third page (labelled "sheet 1") calculates the probability of winning the battle taking into account STAMINA. It uses the binomial distribution (used to calculate the probability of N successes from M trials, with probability of success P.) In this case N is number of hits its takes to kill your enemy, M is max number of attack rounds (that don't end in a draw) that the battle can last, and P is the probability of winning an attack round. The chance of winning is equal to the probability of winning N or more attack rounds out of a maximum of M rounds. (The only reason I have knowledge of the binomial distribution is that I studied statistics at university!) I had a model that calculated probabilities for multiple monsters, but I wasn't convinced it worked properly, so I left it out.



Post by thealmightymudworm on Mar 21, 2014 18:52:20 GMT
From TUFFF... Thank you for this calculator, Jamus. I like this  now you can find out if your combats are fair. The probabilities are very interesting. If my opponent and I both have a stamina of 14, then you have a 50% chance of winning if your skills are the same. If your skill is 1 lower, then the probability is reduced to 17.78%. If your skill is 2 lower, the probability becomes 3.29%. If my opponent and I both have the same skill and my stamina is 14, then I have a 61.28% of winning if my opponent's stamina is 12 and 72.56% of winning when their stamina is 10. A seemingly small change has a huge effect on combat probability in Fighting Fantasy.
It works for me, but I cannot download it in its active form (you may have intended that people don't download it)



Post by thealmightymudworm on Mar 21, 2014 18:53:26 GMT
From TUFFF... OK. Finally cracked it. Two Words



Post by thealmightymudworm on Mar 21, 2014 18:55:40 GMT
From TUFFF... Thank you for this calculator, Jamus. I like this  now you can find out if your combats are fair.
The probabilities are very interesting. If my opponent and I both have a stamina of 14, then you have a 50% chance of winning if your skills are the same. If your skill is 1 lower, then the probability is reduced to 17.78%. If your skill is 2 lower, the probability becomes 3.29%.
If my opponent and I both have the same skill and my stamina is 14, then I have a 61.28% of winning if my opponent's stamina is 12 and 72.56% of winning when their stamina is 10.
A seemingly small change has a huge effect on combat probability in Fighting Fantasy.
It works for me, but I cannot download it in its active form (you may have intended that people don't download it) Thanks slloyd, you make a good point about the huge impact of a small change in stats. I find it fascinating that some ff authors could think up and write these great encounters and adventures but would then neglect the aspect of balancing the combats and dice rolls so that the player has a good chance of finishing the adventure. Maybe part of it was because they didn't have time to playtest their books, being so focussed on trying to finish writing all the references before the deadline. I have no problem with people downloading it  I'm just not sure how to make it available to download. Is there a way to add an attachment? Also, Sylas, how did you fix the problem?



Post by thealmightymudworm on Mar 21, 2014 18:57:47 GMT
From TUFFF... I'm not entirely sure, jamus. The calculator required some kind of popup, and I had mine set on Block Fidgeted with something else next and, VOILA! Accidents do happen and aren't always bad.
Also, in straight battle it is pretty accurate, but it doesn't factor in your special power of LUCK. Obviously a low LUCK score won't be used often, but having a score of 10 or more can turn a battle in your favour despite a minor SKILL disadvantage. Two Words



Post by thealmightymudworm on Mar 21, 2014 18:58:31 GMT
From TUFFF (April 2012)... Quite fun instrument this Probability Calculator, amazing congratulations jamus, I wonder how it would do with more than one opponent



Post by thealmightymudworm on Mar 21, 2014 18:59:35 GMT
From TUFFF (Oct 2012)... Ouch, I'm sorry to say that your calculation of win/draw/loss (or just win/loss) for each round of combat appears to be incorrect. Send me an email alsander400(at)yahoo(dot)com and I will send through an excel speadsheet showing a table of all possible combinations and their weightings. This spreadsheet calculates a %win/loss per round and the final % win/loss per battle. Your method makes the effect of any changes larger than it already is.



Post by thealmightymudworm on Mar 21, 2014 19:00:28 GMT
From TUFFF (Nov 2012)... Hi Alsander, thanks for your post. Looking back at the revision history, I see that someone (on the 26 July) has changed some crucial numbers in the second sheet, which has stuffed up the calculations. The column 'Probability of rolling this Attack Strength' was changed so that numbers 1  6 had a 1/6 chance of being rolled, and 8  12 had a 0% chance of being rolled  which makes no sense when you are rolling two die to determine your attack strength. Anyway that is what was stuffing up the calculations. I have fixed it up now. Cool, glad you like it Offm



Post by thealmightymudworm on Mar 21, 2014 19:01:23 GMT
From TUFFF... I've checked your totals against mine in a number of different scenarios and they now match perfectly. As both my probability calculator and yours were developed independently, it gives me a level of confidence that they are correct. Now I can start on the next step in my (mad) quest to work out the probability of successfully winning against Razaak in Crypt of the Sorcerer.



Post by nathanh on Mar 22, 2014 12:02:42 GMT
In case anyone is interested, I've written a probability calculator that works for single or multiple combats (using the rollseparatelyforeachopponent rules) and returns the probabilities of ending up on every possible final Stamina score, rather than just win probability. You can even feed this output into another combat to get the results of two successive combats, and so on.
I also have a function that calculates whether and how you should use Luck in a particular battle to optimize your win probability for that battle (you can manually lock the number of times it's allowed to use Luck if you want to preserve some Luck).
These aren't implemented in something nice like a spreadsheet though, they're implemented in R because that's what I use for my day job.



Post by deadshadowrunner on Mar 22, 2014 14:11:35 GMT
The luck one sounds interesting.



Post by drmanhattan on Jun 13, 2021 11:03:26 GMT
In case anyone is interested, I've written a probability calculator that works for single or multiple combats (using the rollseparatelyforeachopponent rules) and returns the probabilities of ending up on every possible final Stamina score, rather than just win probability. You can even feed this output into another combat to get the results of two successive combats, and so on. I also have a function that calculates whether and how you should use Luck in a particular battle to optimize your win probability for that battle (you can manually lock the number of times it's allowed to use Luck if you want to preserve some Luck). These aren't implemented in something nice like a spreadsheet though, they're implemented in R because that's what I use for my day job. I am interested! Is it on GitHub? what would be cool is then to divide up the results into an Nd6 single roll table so you’d get “dead” as one result and the others would be the different possible stamina losses (or use a % table for d100)



Post by nathanh on Jun 20, 2021 19:45:56 GMT
Sadly I just had it saved locally and I don't think I preserved it. I'll have a look through my FF folder to see if I salvaged anything. I don't remember exactly how I did it but it'd be one of two approaches:  A recursive function: e.g. if you and your foe have 4 stamina, and you have a 0.6 chance to strike the next hit and 0.4 chance to receive the next hit, then your probability of winning is 0.6 * (probability of winning in a 4 stamina vs 2 stamina fight) + 0.4 * (probability of winning in a 2 stamina vs 4 stamina fight). So define a function probWinFight(pHit, myStamina, theirStamina) as (0.6 * probWinFight(pHit, myStamina, theirStamina  2) + 0.4 * probWinFight(pHit, myStamina  2, theirStamina)) [with a special case where myStamina = 0 or theirStamina = 0 so that it eventually stops]. If you want to work out your distribution of ending stamina values, this would take more effort, but a positive side is that it's relatively easy to include luck: in each call you calculate a version where you don't use luck that round and a version where you do, and take whichever gives a higher probability.
 Observing that a combat is a Markov chain where each round you either move to the state where you stamina is 2 lower or your opponent's stamina is 2 lower (ignore drawsthey get in the way), or you stay in the same state if one side is dead. The states in the Markov chain are the stamina pairs, so for the above example there are 8 states: 4 4, 4 2, 2 4, 2 2, 4 0, 0 4, 2 0, 0 2. Construct a transition matrix for these 8 states, observe there can be a maximum of 3 decisive rounds, so raise the transition matrix to the power 3. Advantage of this approach is that outofthebox it tells you the probability distribution of your ending stamina, and allows you to conveniently chain together multiple combats simply by multiplying the corresponding transition matrices. Disadvantage is that it will be much more demanding to work out how to use luck. I think this is the route I chose, but I have no memory of how I tackled the luck question.

