Giter Site home page Giter Site logo

balatro-calculator's People

Contributors

citrusmarmelade avatar efhiii avatar larswijn avatar mgrinspan avatar wilsonthewolf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

balatro-calculator's Issues

Lucky Cat

Description of the bug
Having Lucky Cat freezes the calculator entirely. Cards can't be added, hands can't be optimized, etc.

Plasma deck calculation bug

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

return [Math.floor(((score.minChips+score.minMult)/2)**2), Math.floor(((score.maxChips+score.maxMult)/2)**2), score.minChips, score.minMult, typeOfHand];

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)

Baseball Joker counts itself as Uncommon

https://efhiii.github.io/balatro-calculator/?h=YAAZVAAYGDKzgAVAyFAADsBAAKAsBQADASAwCwEQA4ABQADQAFAAFAAH
image

Calculator says this should result in just over a million points, however, it actually scores 693k

20240317140908_1
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.
image

Discounting that extra 1.5X does reduce the score to the correct value (simulated by dropping Glass down a value point).
image

Comprehensive Boss Blind Support

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:

  1. The Hook "Discards 2 random cards per hand played". This could be handled similar to lucky cards where it shows a min/average/max value if you have card-held-in-hand effects.
  2. The Arm "Decrease level of played poker hand".
  3. The Psychic "Must play 5 cards". The calculator knows to use 4 cards with Square Joker or 5 with Splash (unless using fewer cards would score higher). Maybe that logic could be adapted for this as well.
  4. The Club/Goad/Window/Head "All {suit} cards are debuffed". These bosses are calculable as-is, but a per-suit toggle would be a nice UX improvement.

Ante 8 bosses seem like they might be more difficult to implement, but I've listed the relevant ones anyway:

  1. Amber Acorn "Flips and shuffles all Joker cards". This could be handled similar to lucky cards where it shows a min/average/max value if the order of your jokers matters.
  2. Verdant Leaf "All cards debuffed until 1 Joker sold". This could run all calculations once with all cards debuffed, and once for each possible missing joker. It would need to advise which joker to sell if that would score higher than not selling. This boss is technically calculable as-is, as a user could simply fill in the calculator once with all cards debuffed, and then again with all combinations of jokers.
  3. Cerulean Bell "Forces 1 card to always be selected". This is really just another reason to implement #9

Lock a card as played/not played

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

Poor optimize hand result

image

With the extra 7 (created with a Cryptid after checking hand, so updated the calculator). Swapping it for the Steel Queen, it scores higher.

image

Hiker Joker

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.

"Play hand" button

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)

Click & drag cards

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.

Foil Joker Modifier Typo

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.

Ice Cream Joker + Play Hand

At this point, since you have the Play Hand button, you might as well increase Ice Cream Joker when you use it.

Where did you find the formula for hand levels?

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!

Fibonacci Joker doesn't account to Aces

Noticed the calculator would show some sub-optimal hands when I had Fibonacci. When manually selecting Aces the breakdown doesn't show Fibonacci triggering.

Spare Trousers + Two Pair inside a Flush

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.

Stable joker order

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.

"Reset" Button

A Reset button? Something to clear all jokers, entire hand, set all hand values to level 1?

Plasma Deck


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
alt text

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

image-1

Card Modifier Selectors Dissapear at Different Zoom Levels

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

Screenshots
image

2024-03-14.16-25-08.mp4

Queen Rank Location

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.

Optimize Hand checkbox at a certain hand size?

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.

Optimize Hand / Hand Order

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.

All Cards Back In Hand

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.

Baseball Joker

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).

Raised Fist low card is sorted inconsistently

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.