View Full Version : Big Time Random Number Generator Coding Bug?
The_Phenx
09-08-2008, 12:18 PM
While joking around with the guild last night about how you can roll 5 1's in a row, I started doing the /roll 100d100 thing to see if the standard deviation was present, and it was till I made a type-0.
Which shouldn't have effected anything at all, but it does.
So Devs, whats the deal with this?
To test.
Do a /roll 100d100 and you should land somewhere +/- a couple hundred points of 5000
Do a /roll 100d0100 and you will land a number in the 3000 range...
The 0 should have no effect but it does. And it effects all rolls of any ammount and variation.
So I have found a flaw in the coding, not shure what that means, but its there, and figured I should bring it to your attention. Perhaps that is the stray bit that causes big spikes in low number rolling. Because the chances of rolling 6 ones in a row on a regular basis is astronomical.
Garth_of_Sarlona
09-08-2008, 12:31 PM
0100 is octal for 64, so you by rolling 100d0100 you are rolling 100 d64s which comes out averaging to 100*32.5 which is 3250, which matches your results.
I never realised DDO had octal dice until now... I call it a feature not a bug.
Garth
Raithe
09-08-2008, 12:35 PM
In some programming languages like C, putting a leading 0 in front of a number tells the parser that the number is octal, not decimal. The results you get from the /roll output will probably always be in decimal, however.
Your /roll 100d0100 is actually equivalent to /roll 100d64.
EDIT: Beat to the punch.
Depravity
09-08-2008, 12:38 PM
This messes up the ctrl-click purchasing from vendors too. What you're seeing is a the underlying libraries assuming you know some of the standard methods to enter numbers in alternate bases. Iirc, throwing a 0 in front switches to octal notation, so you're rolling 100d64. 100 octal = 8^2, instead of 10^2 like decimal notation.
Edit: *sigh* too slow. Also - checked and 0x works. 100d0x100 spits out values around 12,500. This definitely takes on "feature" status now. :)
The_Phenx
09-08-2008, 12:41 PM
See I knew I forgot all my C++ for a reason and went into design.
That explains a few things, but is this something that needs addressing?
I will leave that to the experts.
Laith
09-08-2008, 12:43 PM
I will leave that to the experts.the experts start telling noobs that the roll command is /roll 1d0100.
I'd insert a :D, but i can see it actually happening.
The_Phenx
09-08-2008, 12:47 PM
It is an obvious problem, do we need a different base system available to the number generator?
Garth_of_Sarlona
09-08-2008, 12:52 PM
all I know is, next time the chattering ring comes up, I'm rolling a 1d0x20 :)
Garth
The_Phenx
09-08-2008, 12:55 PM
ROFL makes me wonder how many times I've lost rolls to this and not paid enough attention.
Blagrak
09-08-2008, 01:34 PM
all I know is, next time the chattering ring comes up, I'm rolling a 1d0x20 :)
Garth
Why would you want to roll a d16 vs a d20? Are you trying to roll low?
Uproar
09-08-2008, 01:41 PM
Why would you want to roll a d16 vs a d20? Are you trying to roll low?
Um note the X. 020 would be 16. 0x20 would be 32. Correct?
Turial
09-08-2008, 03:40 PM
The question is why are there octal dice in a game that doesn't have a use for them?
Depravity
09-08-2008, 03:57 PM
The question is why are there octal dice in a game that doesn't have a use for them?
Because it runs so deep in the programming language/libraries it would be extra work to remove something that doesn't cause any actual errors. For all we know, the loot tables are expressed in powers of 2 (easy to handle with computers) vs powers of 10 (easy for dice), and that roll command is player access to the actual random number generator used in the rest of the game.
And as far as cheating goes - if you roll a d0x20, you're rolling a d32. That's 12 out of 32 rolls that will be above 20, or a 37.5% chance of getting caught cheating. Poor odds, that. Worse at 0x100 - that's 156 out of 256 chances at getting caught.
Blagrak
09-08-2008, 07:31 PM
Um note the X. 020 would be 16. 0x20 would be 32. Correct?
Yeah missed that
tihocan
09-09-2008, 09:22 AM
Sweet I guess I should start tipping the clerics with 02000 pp instead of 2000 :D
Tenkari_Rozahas
09-09-2008, 10:33 AM
Sweet I guess I should start tipping the clerics with 02000 pp instead of 2000 :D
sorry, I think it only works for the random dice generator, and I think you mean 0x2000pp >>
Powered by vBulletin® Version 4.2.3 Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.