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.
Bro did NOT want to get Obyn down
bro did -3M damage
that's crazy
came from ISAB
And this is what can happen if you fail to use a big enough data type and don't use saturated math operators. 😁
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
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.
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?
Yeah the number wouldn’t be big enough to be negative
i aint smart enough for this wtf
so how do you get multiple heros
Mods, in a real game you would buy and sell heroes 7 times which does the same job.
Dammnnnn
thats funny as shit wow
fake boar fr
Holy Charon real?