Schwag bonus

From Binding of Isaac: Rebirth Wiki
Jump to: navigation, search

Schwag bonus[edit | edit source]

Schwag bonus depends, as you might already know, on the raw amount of pickups you collected throughout the run; it has an upper limit and it's tied to the Item penalty. On the daily leaderboards you can often see high-ranking people sporting considerable amounts of schwag points, obtained through the means of some kind of "break", as well as many cheaters forging their bonuses as much as the integer limits allows them to.

How Schwag is computed[edit | edit source]

The game computes the schwag bonus on every engine update, plus once more before showing the final score from a daily run, and it's defined as follows:

+-Minimap::Render()
| Game::End()
'-+-> ScoreSheet::Calculate()
    '~> ScoreSheet::get_swag_points_bonus()

SchwagBonus = GoldenHearts              // 12 max
            + 10 * (RedHeartsContainers // 24 max
                 +  RedHearts           // 24 max
                 +  SoulHearts          // 24 max
                 +  BlackHearts         // 12 max
                 +  EternalHearts       //  1 max
                 +  Coins)              // 99 max
            + 20 * (Keys + Bombs)       // 99 max
            + PickupBonus               // unlimited (???)

You can easily see how Schwag usually caps at 5,452 when not considering the PickupBonus.


The Pickup bonus[edit | edit source]

Every time you collect a pickup that is used in the formula above (HP containers, any kind of heart, coins, bombs, keys and batteries) another value is computed: this value is uncapped and can reach the limits of a signed integer, and keeps the tally of everything you've picked up so far. Every consumable has its own value:

Entity_Pickup::handle_collision()
'-> ScoreSheet::AddPickup()
Pickup type Variant Points
Hearts half 1
eternal 1
half-soul 1
red 2
soul 2
black 2
golden 2
scared 2
blended 2
double 4
Coins penny 1
double 2
lucky 2
nickel 5
dime 10
Bombs single 2
double 4
golden 35
Keys single 6*
double 4
golden 35
Batteries

* bug, should be 2

Once this value is computed, the game will obtain a "final pickup bonus" to add to the formula above and return the definitive amount of Schwag:

p = pickup_bonus;
i = 1.0f;
j = 0.0f;

do {
    k = j;
    x = p < 100.0f ? p : 100.0f;
    j = ((x * i) * 2) + k;
    i *= 0.98;

    if (i <= 0.001f)
        break;

    p -= 100.0f;
} while (p > 0.0f)

In short, the game is taking the uncapped tally of all the pickups and computing a capped value out of it in order to somewhat limit the Schwag bonus by taking a 2% off at every iteration; that's the reason why Schwag bonus doesn't get much higher after a certain threshold. At around 34,500 pickup points Schwag will cap and no longer increase, because $i (which is used to multiply the bonus) will only lead to a 0.1% increase on the total bonus (* 0.001), completely worthless and offset by both the Time and Item penalties munching at your points.


The maximum obtainable Schwag bonus[edit | edit source]

Let's assume you've lucked out and obtained a Blank Card + Jera combo with plenty of batteries, a room full of single keys , bomb packs and dimes, golden bombs and golden keys, 12 golden hearts scattered here and there and 1 eternal heart:

24 hp containers
12 red hearts
 0 soul hearts
 0 black hearts
12 golden hearts
 1 eternal heart
99 coins
99 bombs
XX golden bombs
99 keys (single)
XX golden keys

SchwagBonus = 12                // golden
            + 10 * (24          // hp containers
                 +  24          // red hearts
                 +  0           // soul
                 +  0           // black
                 +  1           // eternal
                 +  99)         // coins)
            + 20 * (99 + 99)    // bombs + keys
            + 10,877            // from 34,889
            = 16,329 points

16,329 points seems to be the upper limit for the Schwag bonus. Adding more pickup points doesn't seem to affect it past that value, even with preposterous amounts (1,874,919,423) Schwag will always cap at 16,329.