Menu
News
All News
Dungeons & Dragons
Level Up: Advanced 5th Edition
Pathfinder
Starfinder
Warhammer
2d20 System
Year Zero Engine
Industry News
Reviews
Dragon Reflections
White Dwarf Reflections
Columns
Weekly Digests
Weekly News Digest
Freebies, Sales & Bundles
RPG Print News
RPG Crowdfunding News
Game Content
ENterplanetary DimENsions
Mythological Figures
Opinion
Worlds of Design
Peregrine's Nest
RPG Evolution
Other Columns
From the Freelancing Frontline
Monster ENcyclopedia
WotC/TSR Alumni Look Back
4 Hours w/RSD (Ryan Dancey)
The Road to 3E (Jonathan Tweet)
Greenwood's Realms (Ed Greenwood)
Drawmij's TSR (Jim Ward)
Community
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Resources
Wiki
Pages
Latest activity
Media
New media
New comments
Search media
Downloads
Latest reviews
Search resources
EN Publishing
Store
EN5ider
Adventures in ZEITGEIST
Awfully Cheerful Engine
What's OLD is NEW
Judge Dredd & The Worlds Of 2000AD
War of the Burning Sky
Level Up: Advanced 5E
Events & Releases
Upcoming Events
Private Events
Featured Events
Socials!
EN Publishing
Twitter
BlueSky
Facebook
Instagram
EN World
BlueSky
YouTube
Facebook
Twitter
Twitch
Podcast
Features
Top 5 RPGs Compiled Charts 2004-Present
Adventure Game Industry Market Research Summary (RPGs) V1.0
Ryan Dancey: Acquiring TSR
Q&A With Gary Gygax
D&D Rules FAQs
TSR, WotC, & Paizo: A Comparative History
D&D Pronunciation Guide
Million Dollar TTRPG Kickstarters
Tabletop RPG Podcast Hall of Fame
Eric Noah's Unofficial D&D 3rd Edition News
D&D in the Mainstream
D&D & RPG History
About Morrus
Log in
Register
What's new
Search
Search
Search titles only
By:
Forums & Topics
Forum List
Latest Posts
Forum list
*Dungeons & Dragons
Level Up: Advanced 5th Edition
D&D Older Editions
*TTRPGs General
*Pathfinder & Starfinder
EN Publishing
*Geek Talk & Media
Search forums
Chat/Discord
Menu
Log in
Register
Install the app
Install
Community
General Tabletop Discussion
*Pathfinder & Starfinder
Skill Challenge success calculator
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="DClown" data-source="post: 4312890" data-attributes="member: 70244"><p>The previous code snippet appears to be a dart thrower algorithm from a cursory glance. To be honest a dart thrower was the first thing I coded just to get a general idea, so I'm not saying anything derogatory besides the fact that its inaccurate and has a more complex implementation then the recursive solution. The original poster got around a recursive solution by forcing all of the skill values to be the same. This makes the processing time dependant on a few factoral calculations for the corresponing number of combinations. The recursive solution allows entry of varying DCs, varying skill combinations, and varying number of successes with varying number of allowed failures.</p><p></p><p>I had two assumptions about skill challenges since i've only sat down with the PHB and havent cracked the DMG yet.</p><p></p><p>Do 1's and 20's still count as auto fail/success on skill challenge checks?</p><p>Are the skill challenge roll pattern primary/secondary/primary/tertiary repeat?</p><p></p><p></p><p>If so here is the complete algorithm. Its c++ but its easy to port since it really only has a single line of code that isn't setup, i/o, or proceedural. ( double probFail = (DC - skills[skillIndex%4]-1) * .05; )</p><p></p><p>With a little bit of work you can use this algorithm to vary the parameters so that you can enter a target success rate and spit out a reasonable number of success to fail ratios for a given DC.</p><p></p><p>[code]</p><p>#include <iostream></p><p></p><p>// globals for use with the recursive function</p><p>double successRate = 0;</p><p>int numToSucceed;</p><p>int numToFail;</p><p>int skills[3] = {0,0,0};</p><p></p><p>// function declarations</p><p>double calcSuccessRate(int successes, int failures, int DC, int skill1, int skill2, int skill3);</p><p>void recurseProbability(int successes, int failures, int DC, int skillIndex, double cummulativeProb);</p><p></p><p>// main</p><p>int main(int argc, char** argv)</p><p>{</p><p> int reqSuccesses = atoi(argv[1]);</p><p> int allowedFailures = atoi(argv[2]);</p><p> int DC = atoi(argv[3]);</p><p> int skill1 = atoi(argv[4]);</p><p> int skill2 = atoi(argv[5]);</p><p> int skill3 = atoi(argv[6]);</p><p> calcSuccessRate(reqSuccesses, allowedFailures, DC, skill1,skill2,skill3);</p><p>}</p><p></p><p>// wrapper for the recursive function, sets up globals</p><p>double calcSuccessRate(int successes, int failures, int DC, int skill1, int skill2, int skill3)</p><p>{</p><p> numToSucceed = successes;</p><p> numToFail = failures;</p><p> successRate = 0;</p><p> // do skill checks alternate primary / secondary/ primary / tertiary repeat?</p><p> // if not adjust the skill matrix accordingly</p><p> skills[0] = skill1;</p><p> skills[1] = skill2;</p><p> skills[2] = skill1;</p><p> skills[3] = skill3;</p><p> recurseProbability(0,0,DC,0,1.0);</p><p></p><p> std::cout << " successRate = " << successRate << std::endl;</p><p>}</p><p></p><p>// calculates the chance of success</p><p>void recurseProbability(int successes, int failures, int DC, int skillIndex, double cummulativeProb)</p><p>{</p><p> if ((successes+failures) >= numToSucceed+numToFail)</p><p> {</p><p> if (successes >= numToSucceed) successRate += cummulativeProb;</p><p> return;</p><p> }</p><p></p><p> // determine chance to fail</p><p> double probFail = (DC - skills[skillIndex%4]-1) * .05;</p><p> // are 20 auto success and 1 auto fail?</p><p> // if so then keep this, otherwise change .95 to 1, and .05 to 0</p><p> if (probFail >= 1) probFail = .95;</p><p> if (probFail <= 0) probFail = .05;</p><p></p><p> // this roll is a success</p><p> recurseProbability(successes+1, failures, DC, skillIndex+1, cummulativeProb*(1-probFail));</p><p> // this roll is a failure</p><p> recurseProbability(successes, failures+1, DC, skillIndex+1, cummulativeProb*probFail);</p><p>}</p><p>[/code]</p></blockquote><p></p>
[QUOTE="DClown, post: 4312890, member: 70244"] The previous code snippet appears to be a dart thrower algorithm from a cursory glance. To be honest a dart thrower was the first thing I coded just to get a general idea, so I'm not saying anything derogatory besides the fact that its inaccurate and has a more complex implementation then the recursive solution. The original poster got around a recursive solution by forcing all of the skill values to be the same. This makes the processing time dependant on a few factoral calculations for the corresponing number of combinations. The recursive solution allows entry of varying DCs, varying skill combinations, and varying number of successes with varying number of allowed failures. I had two assumptions about skill challenges since i've only sat down with the PHB and havent cracked the DMG yet. Do 1's and 20's still count as auto fail/success on skill challenge checks? Are the skill challenge roll pattern primary/secondary/primary/tertiary repeat? If so here is the complete algorithm. Its c++ but its easy to port since it really only has a single line of code that isn't setup, i/o, or proceedural. ( double probFail = (DC - skills[skillIndex%4]-1) * .05; ) With a little bit of work you can use this algorithm to vary the parameters so that you can enter a target success rate and spit out a reasonable number of success to fail ratios for a given DC. [code] #include <iostream> // globals for use with the recursive function double successRate = 0; int numToSucceed; int numToFail; int skills[3] = {0,0,0}; // function declarations double calcSuccessRate(int successes, int failures, int DC, int skill1, int skill2, int skill3); void recurseProbability(int successes, int failures, int DC, int skillIndex, double cummulativeProb); // main int main(int argc, char** argv) { int reqSuccesses = atoi(argv[1]); int allowedFailures = atoi(argv[2]); int DC = atoi(argv[3]); int skill1 = atoi(argv[4]); int skill2 = atoi(argv[5]); int skill3 = atoi(argv[6]); calcSuccessRate(reqSuccesses, allowedFailures, DC, skill1,skill2,skill3); } // wrapper for the recursive function, sets up globals double calcSuccessRate(int successes, int failures, int DC, int skill1, int skill2, int skill3) { numToSucceed = successes; numToFail = failures; successRate = 0; // do skill checks alternate primary / secondary/ primary / tertiary repeat? // if not adjust the skill matrix accordingly skills[0] = skill1; skills[1] = skill2; skills[2] = skill1; skills[3] = skill3; recurseProbability(0,0,DC,0,1.0); std::cout << " successRate = " << successRate << std::endl; } // calculates the chance of success void recurseProbability(int successes, int failures, int DC, int skillIndex, double cummulativeProb) { if ((successes+failures) >= numToSucceed+numToFail) { if (successes >= numToSucceed) successRate += cummulativeProb; return; } // determine chance to fail double probFail = (DC - skills[skillIndex%4]-1) * .05; // are 20 auto success and 1 auto fail? // if so then keep this, otherwise change .95 to 1, and .05 to 0 if (probFail >= 1) probFail = .95; if (probFail <= 0) probFail = .05; // this roll is a success recurseProbability(successes+1, failures, DC, skillIndex+1, cummulativeProb*(1-probFail)); // this roll is a failure recurseProbability(successes, failures+1, DC, skillIndex+1, cummulativeProb*probFail); } [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Community
General Tabletop Discussion
*Pathfinder & Starfinder
Skill Challenge success calculator
Top