What happens if you drink a Lifeforce Potion with negative HP in Terraria?
Terraria: Lifeforce Potion + Negative HP = ???
terra’s brainrot continues
Join my discord! We do stuff sometimes: https://discord.gg/yJrCt9YFz5
Credits:
Thank you to fili_pk on Discord for suggesting the idea that formed this idea.
Resources:
Terrasavr – https://yal.cc/r/terrasavr/
TerraPlrEdit – https://terra-plr-edit-page-92fe42.gitlab.io/
Chapters:
0:00 Introduction
0:47 What does the Lifeforce Potion… do?
1:35 What is an “integer underflow”?
2:09 Underflowing the HP value with Lifeforce!
3:37 YOU CANNOT GET 601 HP.
4:17 The weirdest freeze I’ve seen yet.
5:50 Conclusion & Outro
Music:
OMORI – A Place by the Lake
OMORI – H20:HCL
OMORI – Poems In The Fog
Mods and Packs:
Foundry & Alchemy (Pack) – https://steamcommunity.com/sharedfiles/filedetails/?id=2440505684
Fancy Lighting [Ultra Preset] (Mod) – https://steamcommunity.com/sharedfiles/filedetails/?id=2822950837
Stanberry Font (Pack) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2559652586
Stormdark UI (Pack) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2448259079
DragonLens (Cheat Mod) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2939737748
Better Zoom (QoL) –
https://steamcommunity.com/sharedfiles/filedetails/?id=2562953970
Character Stats (QoL) –
https://steamcommunity.com/sharedfiles/filedetails/?id=3033200611
Terraria: Lifeforce Potion + Negative HP = ???
43 Comments
Omori music jumpscare
The fog bridge when first going to deep well with Mari
Oh yeah, whatever you do dont try to import negative hp characters into tmod because it will delete all your characters. Idk why tho
That swear sounded weirdly similar to shounic for some reason
4:59 terrasteel swearing jumpscare
did u play omori and using its music?
You kinda sound like another YouTuber called “ISAB”
That freeze left me cackling 😂
400th like 🌚
whats in that Homework 1 folder
HELLO FROM THE NEW REPUBLIC OF OOFLAND🫡
Y'know, I feel like Re-Logic wouldn't even have any insight on this absolute madness.
What about with mana?
E
how much does the nurse cost if your health is one number away from the integer underflow?
3:05, aww I wanted to see what happens when it passes 0. I'm guessing the value changes too quickly, but I was curious if it would spontaneously kill you.
So for the freeze, thanks to the blessing of modding tools, it appears that UI/FancyClassicPlayerResourcesDisplaySet uses the Clamp function to limit the display to 20 hearts, while neither UI/HorizontalBarsPlayerReosurcesDisplaySet nor UI/ClassicPlayerResourcesDisplaySet do, so they end up drawing about 84 million bar segments / hearts. The reason you need to be above MIN_INT + 400 is that in UI/PlayerStatsSnapshot, the game uses your "unboosted life" and "unboosted life – 400" to determine your life fruit situation; If you're below that threshold, the math sees you as having 400 million life fruit, which will require a lot of max health to draw even a single segment / heart. (Though I suspect this code path breaks in another way too)
What happens when lifeforce runs out?
terrasteel cursing arc
I don’t understand how YouTubers answer one question but makes it 6 minutes long, just give it to me straight.
1+1 =?
1+1 is a very interesting question, but first we need to understand what one is. One is a number. This is because it is! So what is 1+1 ? Before we answer this, I want you to remember, what does the plus sign mean? I mean we’ve all seen it before but what does it do and where can we find it? If we go to a shop, we can find a calculator but that’s not all, we have to find the sign. This is tricky, you can find the coordinates by asking a friend or using your eyes. Oh, what’s that? I don’t have friends. For some reason my eyes found two. One was tilted on its side. So we can conclude 1+1 doesn’t = ? It’s the meaning of life. Or window. I’ll never answer this question because I need my pay check.
JUST SAY 2, THE FREAKING ANSWER AAAAAAA
So you can have 2 billion hp but you can't have 601… alright then
Bunch of mods can give you 601 hp
Imagine someone sends both of video's to at least one of terraria devs and they… idk, experement/fix? Contact ya after finding out what happened with the half fps thing?? Mayhaps.
Please stop reading max integer value, I'm getting bored
language! /j
3:00 I want to see what happens when you regen enough to hit 0. Also can buffs increase this regen speed?
Jumpscare rahhhh
Can you do all this testing, but with negative mana next?
Omg OMG IS THAT OMORI MUSIC
I do wonder if regenerating up from the underflow will cause you to die if you hit 0, despite regenerating and not taking damage.
do it in infernum mode
Real ones know that gronk was gonna be here instead of the video
deathpull potion
if you set your hp to 496 – 499 and use a life fruit and a life force potion you can get 601 – 604 max health but it will reset back to 500/600 once you leave the world
Did you have 14 DAYS of bleed in those last clips or am I dumb?
Although terraria rejects characters with > 600 hp, I feel like it is possible to get more than 600 via stat editor mods. I have seen terraria servers where you can get over 600 hp and the game is completely fine with it.
I would have expected life regeneration when underflowing with lifeforce to kill you, right?
In the previous video, once natural regeneration kicks in it would instantly kill you, because that change in HP triggers the check for death, and so having less than 0, you die, right?
So why does regenerating with negative HP on a positive max HP not kill you? Maybe it only calls on reductions to HP, so positive regeneration doesn't trigger it. In that case I imagine you'll still die on one hit from anything until your HP is positive.
I'm curious to see what Starbound thinks when you set any of the stats to negative or a super high positive number.
There are many ways to achieve this, Starbound is easy to mod so I could have it be an armor piece or something
I'll try this sometime today
Now it's mana bar time
You get banished.
So basically Deadpool?
Edit: Immediately after posting this I saw that someone else had already posted it earlier. Oh well
Looking into the code, I’m pretty sure the slowdown happens from the draw code (all of which is in the namespace Terraria.GameContent.UI.ResourceSets). For classic style, line 73 of ClassicPlayResourcesDisplaySet.cs is a for loop that iterates based on the player’s statLifeMax2 (adjusted max health) stat and the life per heart, and in it draws the hearts for each iteration. For bars style (HorizontalBarsPlayerResourcesDisplaySet.cs), ResourceDrawSettings are used (a struct in the same namespace), which has another for loop (line 36) based on elementCount, which is set based on ElementCount (they’re two different things, but that might just be weirdness from the decompiler idk), which is set to _hpSegmentsCount + 2 for the background and to _hpSegmentsCount for the filling in horizontal bars (lines 111 and 121), so basically the same issue. For fancy style (FancyClassicPlayreResourcesDisplaySet.cs), ResourceDrawSettings are used again, this time twice, once for the top row and the bottom row. This time they’re set based on _heartCountRow1 and _heartCountRow2. These are set in lines 309 and 310 of the file, using Utils.Clamp() with a minimum of 0 and maximum of 10. In this case, it will only draw a number of times between 0 and 10 inclusive for each of the two rows, which is why that ui style specifically does not lag the game. As an added fun fact, based on the code I think the same thing would happen with mana, except in this case it would cause lag in the fancy style too since Utils.Clamp() isn’t used.
Can you have a positive to negative int overflow with T mod?
I hate how yt doesn't show me your vids sometimes.