• The VOIDRUNNER'S CODEX is coming! Explore new worlds, fight oppressive empires, fend off fearsome aliens, and wield deadly psionics with this comprehensive boxed set expansion for 5E and A5E!

WOIN Attribute -> Dice Formula

Morrus

Well, that was fun
Staff member
I’d like to make a little web tool to convert attributes to dice. Mainly so we can have an infinite scale rather than one as big as somebody can make a manual table.

My friend came up with this equation:

( -1 + SquareRootOf (1 + ( 8 * Stat ) ) ) / 2 = Number of dice (round them down)

So —

1) does that work?
2) how do I do that in PHP?
 

log in or register to remove this ad

TheHirumaChico

Explorer
I threw your formula, with a minor tweak or two { =TRUNC((SQRT((1+(8*Stat)))-1)/2, 0) } into Excel and the results match up to the numbers shown in the attributes table on p. 17 in WOIN:NOW book. But I'm no math whiz, so I don't know by looking at this if the formula will break at some point, like at a very high number. The key change to the formula is that you need to truncate/floor, not round, the result to get the number of dice.

I'm a Java programmer, don't really know PHP, but after a quick Google search I have come up with the following:
<?php
floor(((sqrt((1+(8*Stat))))-1)/2);
?>

You can test it out here: PHP Tryit Editor v1.2 (just replace the "pi()" in the page with my blue text above, and replace "Stat" with actual numbers to test). Hope this helps.
 
Last edited:




Remove ads

Top