Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
#958478 31/07/25 03:02 PM
Joined: Sep 2023
Location: Los Angeles
D
stranger
OP Offline
stranger
D
Joined: Sep 2023
Location: Los Angeles
I’d love to know how it’s possible to get a NEGATIVE result on a d20 roll. I’m talking about the actual die roll, not the total after modifiers. I have a screen shot of this happening to me but, of course, I have no idea how to attach a pic to this thread. (Apparently, you can only link to URLs?)

Long story short, I attacked an enemy and my die roll BEFORE any modifiers was a -2. To add insult to injury, I even had ADV on the attack.

Dice only have positive numbers on them. So how can this happen?

And if anyone can explain how to attach a pic from my phone to this thread, I’d be happy to show proof that this happened.

Joined: Oct 2020
old hand
Offline
old hand
Joined: Oct 2020
I rolled a 69 once, after modifier.
That means the dieroll would have been a number from between 59 and 64.
I 've seen this happening once , and I have 2700 hrs of play.

https://forums.larian.com/ubbthreads.php?ubb=showflat&Number=958393#Post958393

The only way I know to attach a pic. is to register with a picture gallery site , upload your pic there and embed the link.

Joined: Nov 2023
T
addict
Offline
addict
T
Joined: Nov 2023
Originally Posted by Demogoth
And if anyone can explain how to attach a pic from my phone to this thread, I’d be happy to show proof that this happened.

Upload the picture to an image hosting site (Google will easily find you a plethora of free to use ones). Afterwhich you will then have a URL to use for the BBCode to link the image.

Originally Posted by Demogoth
Dice only have positive numbers on them. So how can this happen?

It shouldn't. All dice rolls are positive integers. It's only modifiers that can be negative.

So either something bugged out, or some negative modifiers were still being applied to your initial die roll.

Joined: Mar 2020
Location: Belfast
veteran
Offline
veteran
Joined: Mar 2020
Location: Belfast
Originally Posted by Demogoth
Long story short, I attacked an enemy and my die roll BEFORE any modifiers was a -2.
I usually use Imagur to share images on forums.

That's impossible. But the game could be applying some unusual modifiers (like a temporary debuff perhaps, like from for example "Bane"?) to the roll. Either way, it should be detailed in the combat log.

Joined: Sep 2023
Location: Los Angeles
D
stranger
OP Offline
stranger
D
Joined: Sep 2023
Location: Los Angeles
Trying to post the screenshot...

https://imgur.com/a/7Xy9rZD

Joined: Sep 2024
S
journeyman
Offline
journeyman
S
Joined: Sep 2024
Interesting. Assuming there's no valid hidden thing that might allow a d20 to yield something outside the range of 1..20, the programmer in me wonders how that could happen.

1. Display issue. But the math adds up, so probably not.
2. So many modifiers, maybe that overwhelms some max array length, and a garbage location is used. I'd do 100 or 256 or some ridiculous, but still tiny by modern computers, size. Check if there's a hard coded max, and is this at it? Watch for 1-off issues.
3. Bug in the karmic dice roll. It dinged you but too much, forgetting to clamp it to 1 minimum. (Maybe a reroll got another 1 and subtracted more karma?)

Having said that, their internal dice roll API is probably off the shelf, or modeled on one, and probably has an API like:

int roll_dice(int diceSize, int offset)

where size = 20, say, and offset, usually 0, then adds or subtracts that amount from the result. I would also look into all uses of this API at the second parameter. I would expect it to be unused, and, say, the - 1 of d20 - 1, would be handled outside that beyond early code drafts. But maybe some legacy thing crept in, or some supplied param that should always be 0 in the data load that got overlooked.

Yes, I mixed underscores and camel notation!

Last edited by Shadowbart; 01/08/25 07:00 PM.

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5