<aside> 🇨🇳

For Chinese:

小丑牌中无法战胜的分数机制—一次简单的游戏代码分析【中文版】

</aside>

The Game

Balatro

My Reddit Post

Balatro's 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))

$$ \begin{align*} \text{Write in math expression:} & \\ k & = 0.75\\ a & = 180000 \text{ (depends on scaling)}\\ b & = 1.6\\ c & = n - 8\\ d & = 0.2 * (n - 8 )\\ A & = \lfloor a \cdot (b + (k \cdot c)^d)^c \rfloor\\ A' & = A - \left( A \mod 10^{\lfloor \log_{10}(A) - 1 \rfloor} \right)\\ \end{align*} $$