Skip to content

kleinfreund/balatrolator

This branch is up to date with main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7e6865b Ā· Feb 24, 2025
Jan 18, 2025
Jan 6, 2025
Jan 15, 2025
Feb 24, 2025
Feb 26, 2024
Feb 26, 2024
Jan 25, 2025
Jan 15, 2025
Feb 26, 2024
Jan 15, 2025
Jan 15, 2025
Jan 18, 2025
Jan 18, 2025
Jan 15, 2025
Jan 12, 2025
Jan 18, 2025
Feb 24, 2025
Feb 24, 2025
Jan 18, 2025
Feb 26, 2024

Repository files navigation

Balatrolator

Tests passing

Balatrolator is a score calculator for Balatro. It's a fan project and not affiliated with the makers of Balatro.

Tip

Example score showcasing a hand played by haelian on 2024-02-26 18:13 (UTC).

Features

  • Game features: Supports all score-influencing game features (and has tests for a lot of them)
  • Luck: Calculates worst case, average, and best case scores when odds are in play (read more below: Tell me the odds: how probabilistic effects are handled)
  • Saves: Save hands in the browser and load them later to compare different hand variations. You can also export saves as JSON files and import them again.
  • Share URLs: Share your score! The current hand is persisted in the URL and the saves.
  • Quality of life: Duplicate jokers/playing cards or set their play count to input high-scoring endless game hands.

Non-features

  • No hand optimizations: the goal of this calculator is to predict/verify scores (i.e doing the math). I leave being clever to you. šŸ¤” (Also: I might change my mind on this. šŸƒ)

Documentation

Tell me the odds: how probabilistic effects are handled

Balatrolator always returns deterministic scores and doesn't roll any ā€œdiceā€ when probabilistic effects (e.g. lucky card) are at play. Instead, it gives you scores for three ā€œluck modesā€:

  • no luck: the lower bound
  • all luck: the upper bound
  • average luck: the score you can expect with perfectly average luck

ā€œNo luckā€ means probabilistic effects never contribute anything to the score. Lucky cards never apply their +Mult value; Bloodstone never applies its xMult value.

ā€œAll luckā€ means probablistic effects always contribute to the score. Lucky cards always add their +Mult value; Bloodstone always applies its xMult value.

ā€œAverage luckā€ means probabilistic effects are counted with the scores that you can expect on average. That is, the resulting score is the one you would get as if you would play the same hand an infinite amount of times and averaged the resulting scores. In other words, a lucky card's +Mult value of 20 with standard odds of 1 in 5 would add 4 (20 * 1/5). ā€œOops! All 6sā€ jokers do factor into this math: having two instances of that joker would raise the odds of a lucky card's +Mult effect to 4 in 5 and so the value scored would be 16 (20 * 4/5).

Of special note is the case when there are enough instances of the ā€œOops! All 6sā€ joker to guarantee an effect in the game. In that case, the three luck modes become irrelevant and the score is calculated the same way it would in ā€œall luckā€ mode.

Contributing

Contribution guidelines for this project

Development

Calculate score via CLI

After cloning this repository, run the following to calculate a score with a Balatrolator save export in JSON format.

node --experimental-strip-types balatrolator.ts 'Current hand.json'