EFHIII / balatro-calculator

A tool for calculating the score of a hand in Balatro
MIT License
68 stars 10 forks source link

Stable joker order #16

Closed emerald000 closed 5 months ago

emerald000 commented 5 months ago

Is your feature request related to a problem? Please describe. There are often multiple joker orders that are the best. The calculator currently picks one of those randomly even if the current configuration is also the best. It makes it annoying to either always switch the jokers to match the calculator, or spend the time to figure out if the current setup is the same score and keep it if it is.

Describe the solution you'd like Prioritize the inputted order of jokers if it is as good as the best solution. That way, you know when the calculator outputs a different order that your current one is sub-optimal.

Additional context https://efhiii.github.io/balatro-calculator/?h=wAAAAEKk

If you keep clicking the "Optimize Jokers" button, you see that half the time the calculator keeps the order and half the time switches the first two jokers.

This is a regression from the engine rewrite, as it was working as I would expect before it.

I haven't tried with cards that care about hand played order, but if the same problem applies a similar fix would be welcome.

EFHIII commented 5 months ago

I believe this is a side effect of the work being split up into multiple threads that finish in a random order. Adding the threadID as an extra check for if a hand is "better" in the event of ties should resolve this.