Hero bug deals millions of damage to bosses when sold (explanation in description)

แชร์
ฝัง
  • เผยแพร่เมื่อ 5 ต.ค. 2024
  • You may get removed from leaderboards if you use this, be warned. Only level 14+ heroes work on solo, level 20 will damage less than lvl 14.
    explanation:
    In Bloons TD 6 (BTD 6), the boss "Lych" has a mechanic where it heals based on the tiers of towers sold. The healing calculation is as follows:
    1. **Healing Calculation**:
    Heal = tiers * boss_hp
    Here, `tiers` is the number of tiers of the tower being sold, and `boss_hp` is the current health of the boss.
    2. **Overflow Issue**:
    The game uses a 32-bit signed integer to store the heal value.
    The maximum value a 32-bit signed integer can hold is 2,147,483,647.
    If the heal value exceeds this maximum, it will overflow. In programming, when a signed integer overflows, it wraps around to a negative value due to the way integer overflow is handled in two's complement representation.
    3. **Scenario Analysis**:
    *Scenario 1: Selling a Tower with 15 Tiers*
    Let's say the boss has 144 million health (144,000,000).
    You sell a tower with 15 tiers (level 14 hero).
    Calculation: heal = 15 * 144,000,000 = 2,160,000,000
    Since 2,160,000,000 exceeds 2,147,483,647 (the maximum for a 32-bit signed integer), an overflow occurs.
    After overflow, heal wraps around to a negative value, specifically -2,136,313,344.
    Final heal = -2,136,313,344 / 100 = -21,363,133.44 (approximated)
    Therefore, the boss would effectively receive damage of approximately 21.36 million hp due to the negative heal.
    *Scenario 2: Selling a Tower with 13 Tiers*
    Calculation: heal = 13 * 144,000,000 = 1,872,000,000
    1,872,000,000 is less than 2,147,483,647, so no overflow occurs.
    Final heal = 1,872,000,000 / 100 = 18,720,000
    In this case, the boss would heal for approximately 18.72 million hp.
    4. **Conclusion**:
    Selling a tower with 15 tiers causes the heal calculation to overflow a 32-bit signed integer when multiplied with the boss's health.
    The overflow results in a negative heal value, which translates to damage against the boss in the game mechanics.
    Selling a tower with 13 tiers or any lower number of tiers will not cause an overflow, and the heal value will be positive, resulting in actual healing for the boss.

ความคิดเห็น • 17

  • @AJThePurpleBoy
    @AJThePurpleBoy 3 หลายเดือนก่อน +2

    Bro did NOT want to get Obyn down

  • @ohhi687itsme8
    @ohhi687itsme8 3 หลายเดือนก่อน +5

    bro did -3M damage

  • @Lawrence_Zhou
    @Lawrence_Zhou 3 หลายเดือนก่อน +4

    that's crazy

  • @lucifer_morningstar..
    @lucifer_morningstar.. 3 หลายเดือนก่อน +1

    came from ISAB

  • @TechSY730
    @TechSY730 3 หลายเดือนก่อน +1

    And this is what can happen if you fail to use a big enough data type and don't use saturated math operators. 😁

  • @supremechaosbeing2696
    @supremechaosbeing2696 3 หลายเดือนก่อน +1

    i mean does it work without mods to place more heroes? your reasoning sounds like it should but why not just test it on a real game? if all I have to do is buy 14 levels on a hero then that sounds easy as hell

    • @boartd6
      @boartd6  3 หลายเดือนก่อน +1

      Yes, you can buy level to lvl14 and sell a hero 7 times. In this video I just had 7 heroes placed down to just have to sell them all so d20 subgon could kill the boss without 7 lych souls spawning.

  • @Dartus_MonkusIII
    @Dartus_MonkusIII 3 หลายเดือนก่อน +1

    So this bug only works on the tier 5 elite lych that had 144 mil hp? If you sold the hero on a tier 5 normal lych the boss would heal normaly correct?

    • @Floeflayfloe
      @Floeflayfloe หลายเดือนก่อน

      Yeah the number wouldn’t be big enough to be negative

  • @sayoriigd
    @sayoriigd 3 หลายเดือนก่อน

    i aint smart enough for this wtf

  • @christophergovek3699
    @christophergovek3699 3 หลายเดือนก่อน

    so how do you get multiple heros

    • @boartd6
      @boartd6  3 หลายเดือนก่อน +1

      Mods, in a real game you would buy and sell heroes 7 times which does the same job.

  • @somnathbhattacharya2819
    @somnathbhattacharya2819 3 หลายเดือนก่อน

    Dammnnnn

  • @mikshake5774
    @mikshake5774 3 หลายเดือนก่อน

    thats funny as shit wow

  • @chartreusecharon
    @chartreusecharon 3 หลายเดือนก่อน

    fake boar fr

    • @boartd6
      @boartd6  3 หลายเดือนก่อน +1

      Holy Charon real?