kleinfreund / balatrolator

Score calculator for Balatro
https://balatrolator.com/
MIT License
4 stars 0 forks source link

Handle probabilities (i.e. 1 in N chance effects) #2

Closed kleinfreund closed 5 months ago

kleinfreund commented 6 months ago

Description

Handle the various probabilistic effects of things like the "Bloodstone" joker, lucky enhanced cards, etc. Currently, they're not taken into account at all.

Motivation

Some way to handle probabilities is definitely needed. Now I don't want to just roll the dice and have scores change based on whether, for example, a lucky card was triggered. I don't really have good ideas for this so far.

Some rough sketches:

Jokers:

Note that a lot of probabilistic jokers don't affect joker (e.g. Gros Michel)

Modifiers:

EFHIII commented 6 months ago

A range is what I went with for my calculator, but another feature that you might consider is showing the average scoring result which is probably more useful in cases where the range is very significant, for example: image

EFHIII commented 5 months ago

I now show a mean and median in mine: image

kleinfreund commented 5 months ago

I've added handling of probabilities in https://github.com/kleinfreund/balatrolator/commit/a5b71896573120b70ce240a5c88b1b189d4b0624. I went with the following approach:

The calculator now determines the score using three different luck "modes": no luck (i.e. the lowest score possible), average luck, and all luck (i.e. the highest score possible).

"No luck" means no probabilistic effects are activated. This represents the lowest possible score one can get. This "mode" effectively behaves as the calculator did before this change: lucky cards, Bloodstone, and Oops! All 6s don't (and didn't) increase the score.

"All luck" is the other extreme: all probabilistic effects are always activated and they always have the best possible effect (lucky cards always add their +Mult, Bloodstone always triggers, and Misprint always adds its highest +Mult).

"Average luck" tries to produce a more or less expected score value. Instead of actually rolling any dice (which would produce different values every time), the probabilistic effects/values are averaged during scoring:

Oops! All 6s doubles these effects (Lucky: 8 +Mult; Misprint: 11.5 +Mult, i.e. the same as it's not a 1 in N chance probability; Bloodstone: 5/3 xMult). I'm not totally sure, but I think one can't copy the Oops! All 6s effect, but I would need to check that.

EFHIII commented 5 months ago

You can't blueprint/brainstorm Oops! All 6s but you can have multiple of them and the effect stacks up to 100% chance.

Is there a reason not to the show the result of all modes at once (only when they're not all the same)?

Also, if Oops! All 6s makes the chance 100%, that probably aught to be reflected in the lower bound.

kleinfreund commented 5 months ago

Also, if Oops! All 6s makes the chance 100%, that probably aught to be reflected in the lower bound.

Good call. In my first iteration I wasn't handling multiple Oops! All 6s and consequently didn't bother "raising" the lower bound if your jokers make you chances guarantees (like 2x Oops! All 6s would for Bloodstone). I fixed that now. Works for both Bloodstone and lucky cards (however unlikely that is in practice).

Is there a reason not to the show the result of all modes at once (only when they're not all the same)?

It's somewhat arbitrary, but I don't see a strong reason to show the three results if they're the same anyway.