Cracking Balatro's Scaling: The Code Behind Its Impossible Blinds

The Game

Balatro
The poker roguelike.
https://store.steampowered.com/app/2379780/Balatro/

My Reddit Post

Balatro's Unbeatable Ante: A Closer Look
86 votes, 18 comments.
https://www.reddit.com/r/balatro/comments/1ay74s2/balatros_unbeatable_ante_a_closer_look/

Summary

  1. Balatro becomes significantly more difficult starting from ante 11.
  2. Endless Mode truly goes on infinitely, and you can't really "beat the game.”

Incentive

It becomes exceedingly hard after reaching a certain ante level. I often find myself with a well-synergized deck, but suddenly, upon reaching the next level, the blinds become so large that the game feels unbeatable. I'm curious about how the game calculates its blind amounts.

I've extracted Lua files from the Balatro game files. Using the keyword “300” (the initial round blind amount), I located the **function get_blind_amount(ante)** in **misc_functions.lua**.

Discovery

Here’s the full function:

function get_blind_amount(ante)
  local k = 0.75
  if not G.GAME.modifiers.scaling or G.GAME.modifiers.scaling == 1 then 
    local amounts = {
      300,  800, 2800,  6000,  11000,  20000,   35000,  50000
    }
    if ante < 1 then return 100 end
    if ante <= 8 then return amounts[ante] end
    local a, b, c, d = amounts[8],1.6,ante-8, 1 + 0.2*(ante-8)
    local amount = math.floor(a*(b+(k*c)^d)^c)
    amount = amount - amount%(10^math.floor(math.log10(amount)-1))
    return amount
  elseif G.GAME.modifiers.scaling == 2 then 
    local amounts = {
      300,  1000, 3200,  9000,  18000,  32000,  56000,  90000
    }
    if ante < 1 then return 100 end
    if ante <= 8 then return amounts[ante] end
    local a, b, c, d = amounts[8],1.6,ante-8, 1 + 0.2*(ante-8)
    local amount = math.floor(a*(b+(k*c)^d)^c)
    amount = amount - amount%(10^math.floor(math.log10(amount)-1))
    return amount
  elseif G.GAME.modifiers.scaling == 3 then 
    local amounts = {
      300,  1200, 3600,  10000,  25000,  50000,  90000,  180000
    }
    if ante < 1 then return 100 end
    if ante <= 8 then return amounts[ante] end
    local a, b, c, d = amounts[8],1.6,ante-8, 1 + 0.2*(ante-8)
    local amount = math.floor(a*(b+(k*c)^d)^c)
    amount = amount - amount%(10^math.floor(math.log10(amount)-1))
    return amount
  end
end

To breakdown the function:

  1. There are three if clauses that set the initial amount for each round based on the scaling index, where 1 is the lowest and 3 is the highest. For example, the plasma deck has a scaling of 2. The remaining code in each clause is identical, initially setting a hard-coded amount based on the ante level before 8 (the conditions for ante <1 and ante ≤ 8).
b_plasma={name = "Plasma Deck",
					stake = 1,
					unlocked = false,
					order = 14,
					pos = {x=4,y=2},
					set = "Back",
					config = {ante_scaling = 2},
					unlock_condition = {type = 'win_stake', stake=5}
					}
  1. Then, the code sets parameters a, b, c, d using ante and constants to calculate the blind amount for ante > 8.
    local a, b, c, d = amounts[8],1.6,ante-8, 1 + 0.2*(ante-8)
    local amount = math.floor(a*(b+(k*c)^d)^c)
    amount = amount - amount%(10^math.floor(math.log10(amount)-1))

Written as equations, with a=180,000a = 180{,}000 for scaling 3:

k=0.75,b=1.6c=n−8,d=1+0.2(n−8)A=⌊a(b+(kc)d)c⌋A′=A−(A mod 10⌊log⁡10(A)−1⌋)\begin{gathered} k = 0.75,\quad b = 1.6 \\ c = n - 8,\quad d = 1 + 0.2(n - 8) \\ A = \left\lfloor a \left(b + (k c)^d\right)^c \right\rfloor \\ A' = A - \left(A \bmod 10^{\left\lfloor \log_{10}(A) - 1 \right\rfloor}\right) \end{gathered}
  1. As ante (n) approaches infinity, because c and d are linear functions of ante, A essentially grows beyond exponential rates, entering the realm of tetration. I find this concept intriguing, and further information on this advanced mathematical term is available on Wikipedia.
n nn=3nn^{\,n^n} = {}^{3}n

ante = 8

When examining the curve, it appears that before endless mode starts at 9, the blind amount remains manageable.

ante = 11

The difficulty escalates quickly after reaching 11. A glance at the graph shows the blind amount skyrocketing.

Discussion

There are still questions to be answered:

  1. Theoretically, what is the highest ante level a player can reach?
    1. Considering Lua's largest positive floating-point number is approximately 1.8e308, at ante level 38, the blind amount is ~1e289. This suggests that at ante 39, this number would exceed the program's computational capability. What happens if someone beats level 38? I will test this and update this post.
  2. What is the highest ante level that a player with an exceptionally lucky seed can achieve?
    1. After observing the growth of the blind amount, it's important to also consider the growth of a player’s deck. As shown in this video https://www.bilibili.com/video/BV1jH4y1J7Pv/, achieving 1e75 using Baron+ Mime + Brainstorm is possible. My initial assumption is that each player’s round can only grow the deck exponentially, thus, failing to surpass the game's imposed limit.

What are your thoughts?