For anyone wondering why it does less damage as you level up, the number of tiers increase, increasing the overflow and adding to the negative healing value(less damage), and because level 14 just barely overflows the integer limit, it does more damage
its so neat to see how a bug happens for once, instead of just knowing what happens, the guy explain why it happens, even if its just a simple buffer overflow
Integer overflow. A buffer overflow is when you run out of memory in an array (a buffer) but you keep on writing/reading in junk memory or worse, in important memory.
And most people ignore/dont care about the intricacies of it. I for one am all for seeing precisely why a bug happens. Even if the reason is pretty stupid/simple. Cause lets be frank, all code is spaghetti code under the right circumstances xD
2:05 The LVL20 sell did less damage because of the overflow math. 21 * 144,000,000 = 3.024 billion. That number when converted to 32-bit signed int overflows to -1.27 billion, which then converts to around 12.7 million HP damage. Therefore, you get less damage from selling a LVL20 hero than selling a LVL14 hero. And all of this could have been avoided if the programmers used either *unsigned* integers, which have a limit of just under 4.3 billion, or *long* integers, which have a limit of over 9 *quintillion.*
So does this work when a hero levels up naturally? If it's like how Least Tiers does it, the tier count would only go up if you spend money on a level, which it seems was the case in this example and the others.
NOTE: this bug only affects well HP buffed Lych and only this boss. EDIT: NOTE 2: this bug can be easily fixed with other calculation system that includes brackets or replace multiplication with division. Calculus will not overflow as easy if the number is firstly divided and then multiplied.
Why would they do something so complicated, they could easily just clamp the healing amount instead (assuming they have a good reason not to just use a type supporting larger numbers there)
@@Jonas-Seiler Thats kinda also an option, but scrapping idea of different size of healing for each tower sold is... erm... unnecesarry. It works totally fine now, just there is only a need to rework heroes. I don't say its gonna be complicated, im saying it needs not to be as simple. As far as i understand correctly the game now counts every single level of a hero as a tier, it just needs to make the game understanding that every 4th-5th level of a hero makes the hero being a tier higher. It doesn't even need to be visually experiencable. And this can be fit in very few lines of code no matter what programming language it is.
@@Jonas-Seiler I am guessing because the next signed bit is 64bit-signed , which have about 9.2x10^18, billion is about 1x10^9, thats a lot of wasted bit used to store 0 that will never be used. Reworking lych's healing makes more sense, or just dont make it 500% hp XD
cool... so I was trying to figure out how people were getting such low scores on the ranked leader board, glad to see the reason I could get all the way to t5 with the same number of tiers, but was completely unable to kill the last tier was bug exploiting...
A presumably easy fix for this would be that before Lich's HP is touched, it checks the final "heal" amount - if the number is under zero (would deal damage instead), heal to full instead.
Easiest way would be to change the integer from 32 bit to 64 bit, which would increase the max healing from 2 billion to 9 quintillion. Alternatively they could make the integer an unsigned int, which would double the max healing to 4 billion while also making it impossible for the healing value to be negative if it somehow overflowed anyway (it would loop around to 0 instead).
@@olixx1213 That wouldn't let Lych calculate how much it's supposed to heal, though That would mean it would heal nothing, which is less egregious than taking damage, but still not intended behavior
Divide the HP by 100 first, or just change the heal value from 32 bit to 64 bit. Edit: Generally though, you want to perform multiplication BEFORE division if possible, in order to mitigate any floating point rounding errors.
For anyone wondering why it does less damage as you level up, the number of tiers increase, increasing the overflow and adding to the negative healing value(less damage), and because level 14 just barely overflows the integer limit, it does more damage
People say Benjamin is the weakest hero in terms of damage, they were WRONG
technically, all heroes can do this so yeah he still the weakest
@@worminaround🤓
Benjamin is the 🐐
bro hacked his way into damaging lych
@@trickeddev thx
Ben casually doing 14 million damage and leaving:
It's more like, leaving, dealing 14 mil damage, coming back, stealing money, leaving, dealing 14 mil damage, and so on.
>deals 14m dmg
> -refuses to- elaborates
>leaves
So if I’m getting this right, then lunch is basically overdosing on healing
Edit: I decided it’s funnier not to fix the autocorrect issue lol
That's actually a great way to describe an overflow lol
Lunch
Lunch overdose
lunch
Lunch
This is truly a certified Mackanrules moment
its so neat to see how a bug happens for once, instead of just knowing what happens, the guy explain why it happens, even if its just a simple buffer overflow
Integer overflow. A buffer overflow is when you run out of memory in an array (a buffer) but you keep on writing/reading in junk memory or worse, in important memory.
And most people ignore/dont care about the intricacies of it.
I for one am all for seeing precisely why a bug happens. Even if the reason is pretty stupid/simple. Cause lets be frank, all code is spaghetti code under the right circumstances xD
@@fusionwing4208except for yan sim, it is alway a spaghetti code.
2:05 The LVL20 sell did less damage because of the overflow math. 21 * 144,000,000 = 3.024 billion. That number when converted to 32-bit signed int overflows to -1.27 billion, which then converts to around 12.7 million HP damage. Therefore, you get less damage from selling a LVL20 hero than selling a LVL14 hero.
And all of this could have been avoided if the programmers used either *unsigned* integers, which have a limit of just under 4.3 billion, or *long* integers, which have a limit of over 9 *quintillion.*
tbf devs probably didn't think they'd use numbers that big
hahahaha. That 600% boos hp came back to bite NK in the butt.
Aaah, good old integer overflow
Benjamin DPS OP
So does this work when a hero levels up naturally? If it's like how Least Tiers does it, the tier count would only go up if you spend money on a level, which it seems was the case in this example and the others.
Least tiers counts bought tiers. Lych uses the actual tiers.
bro thought he could trick us by making it look like the sub paragon did the integer cap damage. pretty cool touch tho lol.
NOTE: this bug only affects well HP buffed Lych and only this boss.
EDIT: NOTE 2: this bug can be easily fixed with other calculation system that includes brackets or replace multiplication with division. Calculus will not overflow as easy if the number is firstly divided and then multiplied.
Why would they do something so complicated, they could easily just clamp the healing amount instead (assuming they have a good reason not to just use a type supporting larger numbers there)
Couldn't they divide the hp amount by 100 first, then multiply the hp by tiers? That should solve the overflow issue entirely, no matter lych's HP
@@Jonas-Seiler
Thats kinda also an option, but scrapping idea of different size of healing for each tower sold is... erm... unnecesarry. It works totally fine now, just there is only a need to rework heroes.
I don't say its gonna be complicated, im saying it needs not to be as simple. As far as i understand correctly the game now counts every single level of a hero as a tier, it just needs to make the game understanding that every 4th-5th level of a hero makes the hero being a tier higher. It doesn't even need to be visually experiencable. And this can be fit in very few lines of code no matter what programming language it is.
@@Jonas-Seiler at that point why not just make healing an unsigned int so it's always positive and has double the max value
@@Jonas-Seiler I am guessing because the next signed bit is 64bit-signed , which have about 9.2x10^18, billion is about 1x10^9, thats a lot of wasted bit used to store 0 that will never be used. Reworking lych's healing makes more sense, or just dont make it 500% hp XD
the stats at the end said -700k total damage and i dont think thats normal
Who knew healing so much could do damage
cool... so I was trying to figure out how people were getting such low scores on the ranked leader board, glad to see the reason I could get all the way to t5 with the same number of tiers, but was completely unable to kill the last tier was bug exploiting...
NK: Yeah, I will be a good idea to put a boss with 600% hp!
*Insert monogatari tongue twister.*
If only I got this video while playing the actual boss
A presumably easy fix for this would be that before Lich's HP is touched, it checks the final "heal" amount - if the number is under zero (would deal damage instead), heal to full instead.
Could also take ABS of value for heal. That changes 1 bit (potentially) of the number with one check. Should see no performance changes
Just clamp the healing number or just make the integer 32 bit instead 16 so the max number is in the trillions
@@sunbleachedangelbtd6 already has a an integer of 32 bits lol
@@leonardotrujillo8661 I meant 64, my bad
Benjamin doing damage? Wow.
in the game summary it says you did -710925 damage. Which is kinda funny
Didnt know it would turn negative if you heal too much
That is an aspect of storing numbers as integers (positive or negative) and thinking they'll only be positive.
Extras secret strats!
So basically we are healing the boss so much to where it goes to less health than before 😭
No, the heal is so much that it ends up being negative. Else you could instantly kill the boss with your suggestion.
if you buy a hero level in least tiers, it does count as being bought a tier
yes, so does manually buying tiers
@@icenoviceliterally what he said
Who let Benjamin white cook the buffs 🔥 (I’m referencing to Walter whit in case someone has the joke fly over their head)
-710k damage is wild
here we go again
I got an update this morning... perhaps it got patched already. I didn't try it yet lol
Benjamin solos lych confirmed
This is cool af
lean
Where are the streams mr Isab
how exactly would they patch this? only way i could think is by nerfing licht to get around hitting the integer limit
Easiest way would be to change the integer from 32 bit to 64 bit, which would increase the max healing from 2 billion to 9 quintillion. Alternatively they could make the integer an unsigned int, which would double the max healing to 4 billion while also making it impossible for the healing value to be negative if it somehow overflowed anyway (it would loop around to 0 instead).
so does this also only work on t5 as well? since the max health of the boss matters
yeah, only on t5 elite
How can they patch it without changing Lych entirely
They could divide the HP by 100 first, then multiply it by the number of tiers
Easy patch
Just check if the number is negative before healing
@@olixx1213 That wouldn't let Lych calculate how much it's supposed to heal, though
That would mean it would heal nothing, which is less egregious than taking damage, but still not intended behavior
Divide the HP by 100 first, or just change the heal value from 32 bit to 64 bit.
Edit: Generally though, you want to perform multiplication BEFORE division if possible, in order to mitigate any floating point rounding errors.
Any boss HP is divisible by 100 tho, so there should be no problems
Is that how we get owned in ranked?
40mins, huh?
loving kids from saying second
Comment understand not can your I
tack shooter btd1 better
Tack shooter spam was so op they had to add lead bloon type
Cmon Isab why do you always wait for the event to finish before posting these videos?
stopping kids from saying first
YOU ARE SUCH AN INTERNET HERO OMG THANK YOU!!!(get a job niker)
ur just as cringe
First