efhiii / balatro-calculator Goto Github PK
View Code? Open in Web Editor NEWA tool for calculating the score of a hand in Balatro
License: MIT License
A tool for calculating the score of a hand in Balatro
License: MIT License
Description of the bug
Having Lucky Cat freezes the calculator entirely. Cards can't be added, hands can't be optimized, etc.
It seems sometimes the plasma deck calculation isn't properly truncating the average of chips + mult before squaring it.
I had aces over kings full with plasma deck in game with base values for hand, and it scored 2304 which is 48 * 48. Calculator is showing 48.5 * 48.5
This seems to happen with many different variations of hands with the plasma deck, I think in game always just takes the floor value after finding the average of chips + mult.
Incorrect examples with full house -
https://efhiii.github.io/balatro-calculator/?h=AACgAKGCMCYLQGgQ
https://efhiii.github.io/balatro-calculator/?h=AACgAKGCMCYDgXAQ
Incorrect Example with a 3 of a kind - Shows 31.5 * 31.5 but should be 31 * 31
https://efhiii.github.io/balatro-calculator/?h=AADAAMCCECIE
balatro-calculator/calculator.js
Line 2737 in 716c458
This line, I believe the floor is being done after it squares the average, but it should be done before squaring the average, it should be Floor((chips + mult)/2)**2, but this line is doing Floor((chips + mult)/2)**2)
Description of the bug
Aces don't trigger Odd Todd because they are stored as a value of 12 which fails the odd check.
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=gADJEAAQMA
Description of the bug
There should be UI for how many times a hand has been played.
This is necessary for Supernova, Obelisk, and some boss blinds
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=QAAkByKAAoYDQCgJACA
https://efhiii.github.io/balatro-calculator/?h=YAAZVAAYGDKzgAVAyFAADsBAAKAsBQADASAwCwEQA4ABQADQAFAAFAAH
Calculator says this should result in just over a million points, however, it actually scores 693k
Hologram at 4.5X, Glass at 1.5, Cowboy Boots should be +5 (not +7) as screenshot was taken after the two gold cards triggered.
The breakdown seems to look like it's counting the polychrome multiple times (ah no, just the card face is missing) the Baseball Card (a Rare joker) counting itself.
Discounting that extra 1.5X does reduce the score to the correct value (simulated by dropping Glass down a value point).
Description of the bug
Card Sharp should have UI for if a poker hand has already been played
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=gADW
Currently the only boss blind supported by the calculator is "The Flint", but there are a handful of other bosses that affect what your highest scoring hand would be.
Regular bosses:
Ante 8 bosses seem like they might be more difficult to implement, but I've listed the relevant ones anyway:
Description of the bug
Use of Ancient Joker leads to the calculator to spin and never give any resulting optimal hands.
Steps To Reproduce
Add Ancient Joker as one of the Jokers you have. I haven't tested with only Ancient Joker, but at the time of trial -- here was my setup:
https://efhiii.github.io/balatro-calculator/?h=oACuUoALzoABwH9qAADJFAAwAAzA6CEFwHgaAHAAHAALAARAAkABIACwAHAANAAR
See for yourself.
Removing Ancient Joker allowed the calculator to resume and work.
Is your feature request related to a problem? Please describe.
Sometimes, it's desirable to make an un-optimal play for the sake of holding onto/getting rid of cards. Being able to still optimize the rest of the cards would be nice.
Describe the solution you'd like
A lock/unlock button somewhere around cards
Description of the bug
At a certain hand size -- I think it's around 10 or 11 cards -- both of these checkboxes cannot both be on. Is this intentional?
Description of the bug
Currently, the Hiker joker does nothing. I'm guessing the easiest way to implement a working solution for this is to make it so that every tick of Hiker's value gives the current hand +4 chips. Annoying maybe to simulate and always change, but I don't see an elegant solution otherwise.
Description of the bug
The button doesn't actually work. I've tried in both Firefox and Chrome. I get a spinning mouse icon after I hit it in either case.
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=YADQxiYVsYAbAwCQAKGCMCYLQYgVA8AYDgAUAAUAASAAoAAEBgAAWAAYAAWAAEgANAAN
Description of the bug
After playing a hand using the button, the calculator stops functioning.
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=4ADQxiYbArYwAwA5QAASAAFgVASA4CwEwEQEgRACgACgACQAFAAAgMAACwADAACwAAkABoABoA
This is a link to what it looks like post-"Play Hand" is hit. Before that, it works just fine.
Is your feature request related to a problem? Please describe.
Making all of the changes after a hand can be annoying if that's the use-case being used.
Describe the solution you'd like
Change state values to reflect what they'd be after the hand was played.
e.g. remove played cards from hand, disable DNA if applicable, increment the current hand's number of times played.
Additional context
#8 (comment)
Description of the bug
https://efhiii.github.io/balatro-calculator/?h=oABQEQN7CCMwAAAAAOAAEAFA
For example, add a King of hearts. It won't appear, but your hand will show 1/8.
Arrows for changing the position of cards is not super intuitive or UI-friendly. Being able to click and drag similar to in-game would be nice.
Description of the bug
In the Breakdown tab, Foil Jokers get text that says "+30 chips". However, you're appropriately calculating with 50 chips, so this is just a typo.
At this point, since you have the Play Hand button, you might as well increase Ice Cream Joker when you use it.
Zany Joker currently triggers on a Pair. It should only trigger if 3 cards are the same rank, not 2.
Description of the bug
Swashbuckler gives the wrong bonus.
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=QABJFSA
Expected behavior
In this example, the only other joker is Golden Joker with a sell value of 3. The mult bonus should be 3. It is currently 2.
Prune permutations that are provably identical in the optimization search.
Hi, I'm just wondering where you found the formula and the constants that give you the chips/mult for each hand, for each hand level:
function incrementLevel(inc, handIndex)
{
const hand = hands[handIndex];
const div = document.getElementById(hand.id);
hand.level += inc;
if(hand.level < 0) hand.level = 0;
hand.mult = Math.max(1, hand.s_mult + (hand.level-1) * hand.l_mult);
hand.chips = Math.max(0, hand.s_chips + (hand.level-1) * hand.l_chips);
div.children[2].innerText = 'lvl.'+hand.level;
div.children[2].style.backgroundColor = hand.level === 1 ? handColors[0] : handColors[((Math.ceil(Math.abs(hand.level)/6)*6+hand.level+4)%6)+1];
div.children[4].children[0].innerText = numberWithCommas(hand.chips);
div.children[4].children[1].innerText = numberWithCommas(hand.mult);
redrawPlayfield();
}
Thanks!
Noticed the calculator would show some sub-optimal hands when I had Fibonacci. When manually selecting Aces the breakdown doesn't show Fibonacci triggering.
Description of the bug
DNA copying cards that have card-in-hand effects should be considered
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=QABkC0IAAgqg
Flower Pot currently triggers if there are played cards of each suit. It should only trigger if there are scored cards of each suit.
Description of the bug
Raised Fist Joker just doesn't work.
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=QAB4CCBAAWIEQKgZAMCIEgGA
Description of the bug
If you have Spare Trousers Joker and you play a hand with either two pair or flush house, it increases the value of Spare Trousers, as it should.
However, if you have Spare Trousers Joker and you play a hand with a regular flush that happens to contain two pairs in it, it does not increase the value of Spare Trousers as it should.
Additionally, one thing you might want to consider is that when calculating the hand with Spare Trousers in it, Spare Trousers updates first before the score is calculated. You're not currently doing that.
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.
A Reset button? Something to clear all jokers, entire hand, set all hand values to level 1?
name: Bug report
about: Report any hands that are miscalculated or other bugs
title: ''
labels: bug
assignees: ''
Description of the bug
Plasma deck not working and breaking down properly at high values(?)
Steps To Reproduce
Trying to calculate Meaty's legendary hand I noticed a discrepancy near the end of the calculation's breakdown leaking onto the actual result itself
https://efhiii.github.io/balatro-calculator/?h=0AA2hgDAhBYwKd2O7EcIEQigACGHpAR227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtu23bbtt227bdtoAJyAQAcAAgAAAw
Expected behavior
After observatory that goes 1,675 X 8.4521e133
It is expected for mult to half itself and be given to chips for a result of 4.2261e133 X 4.2261e133 --> this result should finally give 1.7859e265 (calculated by hand)
Instead we get NaNeInf X 8.4521e133, NaNeInf could just be a visual bug which would be okay, but the mult is still not halved --> the final result then given is 7.1439e2665, which is clearly the calculation of 8.4521e133 squared
Screenshots
Additional context
It is hard to be 100% certain there is a problem in the calculation, there might just be a problem in the breakdown itself, but it's a good bet to imagine something is up at that place too. The calculation itself is a nightmare though so things are hard to verify, I checked some of the code, which seemed right at surface level but I got lost at big adds and could not find sight of a NaNeInf in code itself, maybe I missed it or maybe that's part of the oversight for chips. Good luck and thank you for the help!
I am not certain the screen worked so I will join a copy too externally. If there is a problem within this bug report feel free to contact me on discord, my @ is anguigui
This is my first time submitting anything on a public git repo so sorry if I messed up something
Description of the bug
At different zoom levels (I assume screen widths), the modifiers for playing cards disappear.
Steps To Reproduce
I can replicate it on FireFox with the responseive design mode, by setting the screen resolution at 1280 x 800 (the Laptop with MDPI Screen preset), and going to the cards tab. This does also happen at my laptop's native resolution which I think is 1805 pixels wide. Zooming in and out seems to also cause it to appear and disappear.
Expected behavior
It should show at all times
Description of the bug
Currently does nothing.
Description of the bug
Royal Flush is a different type of hand than Straight Flush
This is relevant for Card Sharp, Supernova, and Obelisk and some Boss Blinds
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=wADWBIDkUABQwGgFASAE
Expected behavior
hand text should be Straight Flush
Description of the bug
I don't think your Spare Trousers Joker is appropriately flagged as an Uncommon joker, because it doesn't trigger with Baseball Card joker.
Description of the bug
Why do queens always appear all the way on the left even though as a rank, they are supposed to go in between Kings and Jacks? Even if you have Aces or Kings in hand, a Queen will always appear all the way on the left.
Description of the bug
At a certain hand size -- I think it's 9 cards -- the Optimize Hand checkbox immediately toggles. So it will go on if it was off before and it will turn off if it was on before. Is this intentional? I'm guessing no. If it were up to me, I'd want it to never toggle on/off automatically without my input.
Description of the bug
Flower Pot Joker does not take into account Splash Joker counting all cards present across different suits.
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=YADQxiYbArYOUgADAJAAqIDgbAhBMDoEvCoDgAUAAUAAcA
Is your feature request related to a problem? Please describe.
Instead of just the lowest and highest possible scores, show the mean and median scores. Also allow optimizing for:
Additional context
https://efhiii.github.io/balatro-calculator/?h=YAAQAgMACAEATAQAKAAYAIAAHAgYgJAQ
Description of the bug
Track how much money is earned through the course of a hand.
The amount of money effects Bootstraps and Bull.
Gold cards and vampire can also effects things.
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=EAAoFEOkaQtgaAZD8A
Description of the bug
Steel card gets played for a lower score.
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=AABAAJ9M-UAAoA
Additional context
Optimizing that hand lowers the score by playing the steel card.
Description of the bug
I think this is a bug. I noticed that multipliers in hand in "any" order don't cause the score to change.
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=YADSFyFGJAAVyYADpzQAFSJAAtNColgIwU0EQHAcAgADgACgAFAACgAF
Expected behavior
Moving glass card to the right/left of polychrome cards - shouldn't that change the score? It doesn't. However, the score itself IS the optimized score. It just doesn't show the hand in the order it's supposed to.
I don't know if this is a good idea or not; if you hate it, no problem. A button to put all played cards back into hand. I know at this point, adding a lot of buttons and UI features might just be feature creep. I get that. The more busy the UI looks, the worse it potentially looks. Just an idea. Spitballing.
Description of the bug
I think Baseball Joker calculations are inaccurate -- I think you are calculating x1.5 mult for every Common Joker. The card reads x1.5 mult for every Uncommon Joker.
Steps To Reproduce
Add a random hand and optimize it. Add Baseball Joker. Add an Uncommon Joker that wouldn't effect the Multiplier. Note the Multiplier doesn't increase (when it should). Add a Common Joker that wouldn't effect the Multiplier. Note the Multiplier does increase (when it shouldn't).
Here's a situation where it happened:
https://efhiii.github.io/balatro-calculator/?h=gAA2DAAHMCYPQeq1AKAAFA
It optimizes to AAKK which is worth 246 chips. If you manually change the hand to AAQQ, the score jumps up to 830 chips.
If you put Two Pairs to level 1 instead of 2, it correctly optimizes to AAQQ.
Description of the bug
Raised Fist Joker doesn't play extra cards to get rid of them from hand.
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=QABBDYBAAwwJgLA5B0CIFAE
Optimize Hand shows the 3 of a kind (8s) alone, but playing the 2 and 3 with it will raise the score.
Description of the bug
The low card used by Raised Fist should be placed to the left of any X mult effects to maximize score, but the breakdown can arbitrarily place it in different in-hand positions leading to different score results.
Strangely, the card seems to always be displayed in the same (non-optimal) position regardless of the position actually used for calculations. This may be a separate issue tied into #25.
Steps To Reproduce
https://efhiii.github.io/balatro-calculator/?h=YAB5RAAZiIABedwAIigABBh9JgAJAAkIlV8s5A6A0HoLlLAAAcA
https://efhiii.github.io/balatro-calculator/?h=YAB5RAAZiIABedwAIigABBh9JgAJAAkIlVrA5ZyB0FyjQegAAcA
https://efhiii.github.io/balatro-calculator/?h=YAB5RAAZiIABedwAIigABBh9JgAJAAkIlgKr5ZyB0FyjQegAAcA
These 3 links show the exact same hand with different calculations.
Expected behavior
The optimal in-hand order should always be used (since manual re-ordering is not allowed), and the order used should be displayed correctly.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.