r/BG3Builds • • Oct 07 '25

Specific Mechanic Karmic Dice - an in-depth look

EDIT: Several points in the original post were wrong and have been edited accordingly. Please read my post here instead: https://www.reddit.com/r/BaldursGate3/comments/1ovj329/everything_you_ever_wanted_to_know_about_karmic/

Through looking at the decompiled code I think I've built an understanding of how the Karmic Dice option really works. Enabling this option does two things:

  • It replaces the discrete uniform distribution with a Gaussian with mean 10.5 and standard deviation 19/6 (results are rounded and truncated to [1,20]). Edit: This applies only to damage rolls
  • Anytime a failed roll occurs, a "debt" equal to the chance of success1 accrues. If this debt is positive, for any subsequent rolls there is a chance of a guaranteed roll outcome.

This works as follows: before each roll, if the debt is positive, a random number is drawn from a Gaussian distribution with mean 0.5 and standard deviation 0.25 Edit: a uniform distribution. If the calculated hit chance is greater than (1 - min(debt/DebtRange, 1)) times this number, the roll is guaranteed to succeed and the debt is reduced by an amount equal to~~ two times the hit chance~~ Edit: two times (1-p) (this number is moddable). In that case a roll is drawn from a uniform distribution from the minimum dice roll required to succeed up to 20. In particular, if the chance to pass is 5% or lower, this is guaranteed to be a critical hit!

Edit: This section will need to be reworked We are now in a position to explain the observations made by /u/akdavidxy nearly three years ago. Using the AC23 dataset, he seems to have recorded ~43 attack rolls each from opponents with total modifiers 3, 4, and 5, representing hit chances of 5%, 10%, and 15%, respectively. Assuming all rolls were made in one sitting, and each modifier comes from one character (the debt is counted per character), I threw together a quick MATLAB script and performed that sequence of attack rolls 10.000 times. I received an overall crit hit chance of 15% matching his result of 14.7% very closely, and an overall hit chance of 26.8% vs. his 31.7%.

Some further notes:

  • Like I alluded to above the magnitude of the Karmic Dice can be modded. The Data keys"[..]DebtRange" divides the debt as (1 - min(debt/DebtRange, 1)) and is set to 1 as default. The RollStreamSuccessDebtConsumeMultiplier controls how much the debt is decreased after a guaranteed roll outcome. Set it to zero for guaranteed hits (after enough debt has accrued).

  • Unmodded the hit (and crit) chance for a displayed hit chance of 5% tends to 33% when Karmic Dice is on and you pommel an enemy indefinitely

  • The extreme effect of Karmic Dice displayed above is not realistic in actual gameplay (how often do you let an enemy punch you 43 times?) and the effect is probably much more subtle.

  • I can confirm that Karmic Dice does not apply to failures. There is a failure debt in the code but it is not increased on successfull throws.

I hope this was interesting to some of you in this community. I know it's not exactly build related but I think it is suitable for posting here regardless.

Footnotes:

1 Under some circumstances this calculated chance is not accurate. In particular the reroll feature from Halfling's Luck is not included, and the added hit chance from any additional dice (such as Bless) is underestimated. This effect is amplified if the roll is made under disadvantage, and the displayed hit chance can be 20-30 percentage points lower than the actual hit chance.

129 Upvotes

24 comments sorted by

View all comments

1

u/[deleted] Nov 23 '25

[removed] — view removed comment

1

u/JRandall0308 Dec 10 '25

It tends to turn itself back on after updates, but shouldn't be doing so every time you start the game.

It likely applies to everyone including enemies because you think this code is complex now? imagine splitting it between players and enemies. (Especially when "enemy" is an amorphous concept in this game.)

Not the OP - just an interested bystander.

1

u/[deleted] Dec 11 '25

[removed] — view removed comment

1

u/JRandall0308 Dec 11 '25

You need to think like a busy game developer. Which is easier and less prone to error:

Karmic dice apply to all dice rolls

Karmic dice only apply to “the player”, and we need to keep track of “the player” from now on, on every die roll; and also decide what happens when the player is temporarily not under control (madness, dominate, etc.) yet rolls dice, and and and