Dice rolling question
Moderators: dorpond, trevor, Azhrei
Dice rolling question
Okay, I'm basing this question on a situation I haven't experienced yet (and don't really think will happen too soon in my game even, but I just love theories)...
I'm talking about the Gauntlets of Destruction + Vorpal Weapon combo:
The Gauntlets allow you to reroll all dice from your melee damage that come up as 1. In the parser, that would look like XdYr2, I believe.
Vorpal weapons allow you to roll again whenever you get the maximum number on your damage dice, which would look like XdYe.
Question is: Can these features be mixed in the current parser? I have tried XdYr2e and XdYer2; both are accepted by the parser, but it ignores the second instruction (so XdYr2e = XdYr2, and XdYer2 = XdYe).
(Oh, and I got a roll of 23 out of a [1d4e] test roll.)
I'm talking about the Gauntlets of Destruction + Vorpal Weapon combo:
The Gauntlets allow you to reroll all dice from your melee damage that come up as 1. In the parser, that would look like XdYr2, I believe.
Vorpal weapons allow you to roll again whenever you get the maximum number on your damage dice, which would look like XdYe.
Question is: Can these features be mixed in the current parser? I have tried XdYr2e and XdYer2; both are accepted by the parser, but it ignores the second instruction (so XdYr2e = XdYr2, and XdYer2 = XdYe).
(Oh, and I got a roll of 23 out of a [1d4e] test roll.)
Okay, this is only a partial solution, because you are indeed correct that the two functions do not play nice (HEY DEVS!!!).
So here's what you can do:
Which gives:
The problem is this: if the vorpal weapon is supposed reroll on a second four you are stuck because you need a loop, and maptool doesn't support that yet. Until we get scripting language support, loops are likely out of the question. You could do a nested if for multiple layers, but that's only going to take you so far...
Here's an example (for two levels):
which gives this as a possible output:
Again, though, you need to be careful, because this only goes as many levels as you nest it, and I think beyond two levels it gets VERY tricky, and my logic may be just a bit off (actually I KNOW it is because there is a problem in the code that I'm not sure how to get around. Maybe mathemagician will pop in here and try to figure this out?). Hmm... See if you can spot the problem.
So here's what you can do:
Code: Select all
[pR=1d4r2][if(pR==4, 1d4r2+4, pR) ]
Code: Select all
«pR=1d4r2 = pR = 4 = 4 »« if(pR==4, 1d4r2+4, pR) = 6 »
Here's an example (for two levels):
Code: Select all
[pR=1d4r2][if(pR==4, if(1d4r2==4, 1d4r2+8, pR+4), pR) ]
Code: Select all
« pR=1d4r2 = pR = 4 = 4 »« if(pR==4, if(1d4r2==4, 1d4r2+8, pR+1d4r2), pR) = 11 »
0+0=1, for very unstable CPUs.
Code: Select all
[dR=1d4r2][pR=1d4r2][if(pR==4, if(dR==4, 1d4r2+8, pR+dR), pR) ]
Code: Select all
[cR=1d4r2][dR=1d4r2][pR=1d4r2][if(pR==4, if(dR==4, if(cR==4,1d4r2+12, pR+cR+dR), pR+dR), pR) ]
Code: Select all
« cR=1d4r2 = cR = 4 = 4 »« dR=1d4r2 = dR = 4 = 4 »« pR=1d4r2 = pR = 4 = 4 »« if(pR==4, if(dR==4, if(cR==4,1d4r2+12, pR+cR+dR), pR+dR), pR) = 15 »
Really, until we have looping, there is no fix.
0+0=1, for very unstable CPUs.
-
- Cave Troll
- Posts: 62
- Joined: Mon Jun 12, 2006 4:39 pm
- Location: Peoria, AZ
the problem is, if the die explodes, you need to also add 1 for every reroll, which there really isn't a way to do other than massive nested if statements right now.
Although if I think about it...
damage = 1d3
damage = damage + celling(damage/3)
may just work
but, since you need 2 macro lines to do this, it would make integrating with pre-built macros very difficult.
Although if I think about it...
damage = 1d3
damage = damage + celling(damage/3)
may just work
but, since you need 2 macro lines to do this, it would make integrating with pre-built macros very difficult.
Actually, from a statistical standpoint, I think that's probably correct, I wonder if the die roller would handle that better?Richard Weimer wrote:Maybe you're not considering that a 1d4 weapon that re-rolls all 1's is identical to a weapon that does 1d3+1 damage? Wouldn't that work easier, or am I missing something?
However, from a purely mathematical standpoint, that is not the same as 1d4e, especially when the d4 has two chances of being rolled twice. I'm a bit fuzzy on my probability logic, so I'm not going to go into the details of it, but I'm CERTAIN that 1d4r2e is probabalistically different than 1d3e+1 (or however you choose to write that).
I'll leave the exact probabilities to people more inclined to the exact numbers--I'm far too likely to make a serious error, but I'm going to state for the record that while I as a DM would allow the switch, I would do it knowing that I am screwing with the probabilities in this case. But if you are going up to say a 1d8r2e, then you have a BIG problem. D7e+1 works, but the probabilities are different, and I'm not sure HOW different. The bigger the die, the LESS certain I am that I would allow it. Or maybe I would disallow it on smaller dice, but allow it on bigger dice, I'm not certain. But you are changing the chances of BIG damage, and that's something a DM needs to be aware of.
0+0=1, for very unstable CPUs.
And you are right too...dangit!TK wrote:the problem is, if the die explodes, you need to also add 1 for every reroll, which there really isn't a way to do other than massive nested if statements right now.
Although if I think about it...
damage = 1d3
damage = damage + celling(damage/3)
may just work
but, since you need 2 macro lines to do this, it would make integrating with pre-built macros very difficult.
Ah, the problems with this.
0+0=1, for very unstable CPUs.
-
- Cave Troll
- Posts: 62
- Joined: Mon Jun 12, 2006 4:39 pm
- Location: Peoria, AZ
Maybe I'm not thinking straight. The probability of rolling any particular number on a die is the same as any other (discounting slight variance with the particular die in question such as balance, smoothness, center of gravity, etc.).Orchard wrote: However, from a purely mathematical standpoint, that is not the same as 1d4e, especially when the d4 has two chances of being rolled twice. I'm a bit fuzzy on my probability logic, so I'm not going to go into the details of it, but I'm CERTAIN that 1d4r2e is probabalistically different than 1d3e+1 (or however you choose to write that).
So, the odds of rolling either a 2, 3, or 4 on a d4 are all the same. Isn't that, by definition, a d3? All that you're varying by increasing the die size is the probability of the die having to be re-rolled because it did not roll a 2, 3, or 4 on its previous roll. I could, for instance, roll a percentile (1d100) die, and reroll any values other than a 2,3, or 4, and have the same probability of any of these three numbers being rolled when I'm done (although the amount of rerolls doing so would be horrendous.. )
Last edited by Richard Weimer on Fri Aug 15, 2008 2:33 pm, edited 2 times in total.
-
- Cave Troll
- Posts: 62
- Joined: Mon Jun 12, 2006 4:39 pm
- Location: Peoria, AZ
It sounds possible, but I'm not familiar enough with the macro script to see how easy this would be to implement. Good catch, though.Orchard wrote:And you are right too...dangit!TK wrote:the problem is, if the die explodes, you need to also add 1 for every reroll, which there really isn't a way to do other than massive nested if statements right now.
Although if I think about it...
damage = 1d3
damage = damage + celling(damage/3)
may just work
but, since you need 2 macro lines to do this, it would make integrating with pre-built macros very difficult.
Ah, the problems with this.
While this makes sense at first, I have to disagree with you. You do not really get 2 chances to roll the highest number on the die, since you only reroll the die when you roll a 1. So the only roll that really matters is the roll that you don't roll a 1 on.Orchard wrote:Richard Weimer wrote: However, from a purely mathematical standpoint, that is not the same as 1d4e, especially when the d4 has two chances of being rolled twice.
Another way to think of this is to say to yourself "The probability of me rolling a 4 on a d4 when I know that I rolled a 1 is 0%". Then on your reroll, you have an equal probability of rolling any of the numbers.
- Mathemagician
- Dragon
- Posts: 666
- Joined: Tue May 22, 2007 2:27 pm
1d3+1 is statistically the same as 1d4 reroll 1s, at least, I think so .
However, 1d3e+1 does not achieve what you want. It needs to be 1d3e+(n+1), where n is the number of times the explode rerolled on a 3.
So...
{damage=1d3e}
{damage= damage+ceil(damage/3)}
Should do it, as was proposed above, without the e
However, 1d3e+1 does not achieve what you want. It needs to be 1d3e+(n+1), where n is the number of times the explode rerolled on a 3.
So...
{damage=1d3e}
{damage= damage+ceil(damage/3)}
Should do it, as was proposed above, without the e
I disagree.Richard Weimer wrote:Maybe I'm not thinking straight. The probability of rolling any particular number on a die is the same as any other (discounting slight variance with the particular die in question such as balance, smoothness, center of gravity, etc.).Orchard wrote: However, from a purely mathematical standpoint, that is not the same as 1d4e, especially when the d4 has two chances of being rolled twice. I'm a bit fuzzy on my probability logic, so I'm not going to go into the details of it, but I'm CERTAIN that 1d4r2e is probabalistically different than 1d3e+1 (or however you choose to write that).
So, the odds of rolling either a 2, 3, or 4 on a d4 are all the same. Isn't that, by definition, a d3? All that you're varying by increasing the die size is the probability of the die having to be re-rolled because it did not roll a 2, 3, or 4 on its previous roll. I could, for instance, roll a percentile (1d100) die, and reroll any values other than a 2,3, or 4, and have the same probability of any of these three numbers being rolled when I'm done (although the amount of rerolls doing so would be horrendous.. )
Yes the odds of rolling a 2, 3, or 4 on a d4 are the same--BUT this is NOT the same as a d3 because the chances of rolling those on a d4 is, and always will be 25%. There is a probability path here. You have 2 ways to reach a 4, two ways to reach a 3, two ways to reach a 2, and 0 ways to reach a 1. The question is, do you KEEP rerolling ones or not? If the answer is yes, then we have an infinite regression loop, and I THINK you are back to the 33% probabilities. Maybe. I can't really tell because my logic isn't that good. But if you DO not re-roll ones, then it's a very different story.
So then it's
4-->2 ways
3-->2 ways
2-->2 ways
1-->1 way
-------------
4 sides. ACK! You do the math! 9/4ths?
That is not the same as a d3 at all.
But if we go back to rerolling ones an infinite number of times, I think we regress to the d3 situation, but I'd want to see a mathematical proof of that. That said, I'm not certain I have the knowledge to write one.
0+0=1, for very unstable CPUs.
The issue here is that you are saying that each "way" you can roll a 4/3/2 is of equal probability. On my first roll, I have a 25% chance of rolling a 4. If I roll a 1, (which I had a 25% chance to do) then I have a 25% chance to roll a 4 on that roll, but for the overall probability I need to multiply it by the probability of a reroll (so 25% * 25%). If it so happens that I roll a 1 a third time, then I have 25% of rolling a 4 on the third reroll...Orchard wrote: So then it's
4-->2 ways
3-->2 ways
2-->2 ways
1-->1 way
-------------
4 sides. ACK! You do the math! 9/4ths?
That is not the same as a d3 at all.
So we would write this as a sum for n=1 to infinity of 1/4^n.
This sum approaches 33%, which also happens to be the chance of you rolling a 3 on a d3