Health regeneration

> “Time heals all wounds.
>
> — A loading screen tip
>
>

This page discusses how the player **health regeneration** mechanism works, and how equipment and buffs affect the regeneration rate.

If the player is not hit for a short time, health starts regenerating until the player is hit again. The rate at which the player regenerates health is dependent on five factors:

1. The player's maximum health: a higher maximum health means a faster regeneration rate.
2. Movement: if the player is standing still, their regeneration rate is increased by a factor of ×1.25.
3. Rest: if the player is lying on a bed or sitting on a chair or sofa, their regeneration rate is boosted by a factor of ×1.5.
4. Time since the player was damaged: the more time that has passed since the player was last damage, the higher their regeneration rate; this caps at 60 seconds (1 in-game hour) after which the regeneration rate no longer rises.
5. Buffs and debuffs: for a feel you can have a look at the detailed explanation below, but keep in mind that the numbers do not represent health regeneration directly; they are just factors (higher is better).

The time the player has to wait until regeneration starts is highly variable from roughly 1/10th of a second to 17 seconds (32 seconds on Expert Mode) and is again dependent on maximum life, movement, and buffs/debuffs.

## Details

Health regeneration (HR) is determined by the following formula:

and gives the health per second the player regenerates.

The formula can be split in to 3 parts and a bit of rounding:

1. The `regen` part consists of:
	* `*healthmax*`: maximum Health of the player.
	* `*time*`: factor for the time that passed until the last hit. A detailed definition can be found in the detailed explanation.
		+ The `*time*` value starts at 0, and rises by 1 every 5 seconds for the first 30 seconds. After that, it rises by 1 every 10 seconds, to a maximum of 9. (0<=time<=9) That means this part is 0 for at the first 5 seconds, but reaches 6 after 30 seconds, and 9 after 60 seconds. This does not consider the Shiny Stone buff, which can raise the time value to a maximum of 38, and alters the algorithm in other ways (see below).
2. The `buffs` part:
	* `*buff*`: modifiers from the buffs and debuffs. All "R+n" values from the Buff and Debuff section can be added here (the n-part). (There are some buffs which affect other parts of the algorithm; again, see below.) This is the easiest part as the buffs are just added to the regeneration.
3. The `special` part consists of:
	* `*move*`: either 0.5 if the player is moving or 1.25 if the player is standing still.
	* `*rest*`: 1, except if the player is sitting on a chair or lying on a bed, in which case it is 1.5.
	* `*expert*`: 1, except if the player is in expert mode and doesn't have the well fed buff, in which case it is 0.5.

All this is rounded to the nearest whole number and finally divided by 2 to get the regeneration per second.

The player will regenerate HR per second, not considering the 2 buffs Shiny Stone and Rapid Healing. This means if the player has HR=0.5 they will regain 1 health per 2 seconds and if the player has HR=5 they will regain 5 health per second. (Technically, rather than 5 health per second, they will get 1 health every 12 ticks of game time.)

### Notes

* Buffs can help to reduce the time when the regeneration starts.
* A starting player will start regenerating health after 12 seconds (17 seconds on expert mode) if standing still or 17 seconds (32 expert mode) while moving. After consuming their first Heart Crystal, this drops to 7 seconds while standing still.

## Technical explanation

The player has these health regeneration stats:

* Regeneration Time (**RT**): How long the character has been regenerating for. This normally increases +1 per tick, capped at 3600, and resets to zero when the character takes damage (stopping regeneration).
* Regeneration Rate (**R**): Hit Points (HP) regenerated per tick (1 point of **R** is equal to 0.5 HP/s). This increases the longer the **RT** (the longer the player has been avoiding damage).
* Regeneration Counter (**RC**): Increases by **R** per tick, becomes 120 or over, or -120 or less, it will be reduced or increased by 120, and player will gain or lose 1 health.

The Regeneration Rate (**R**) determines how fast the **RC** changes. **R** is normally 0 or positive, but could be negative if the player is inflicted with any life-draining debuffs, like Poisoned.

### Calculation

The base Regeneration Rate (**R**) is mainly determined by the Regeneration Time (**RT**), player's max Health (**mHP**), and whether player is standing or moving.

**First,** The **RT** is converted to an *Effective Regeneration Time* (**eRT**).

* If **RT** <= 1800, each 300 **RT** boosts **eRT** +1.
* If **RT** > 1800, each 600 **RT** above 1800 boosts **eRT** +1.

Here is an illustration of the relationship between **RT** and **eRT**:

**Then,** the base Regeneration Rate `**R** = (mHP / 400 * 0.85 + 0.15) * eRT`

* If the player is standing still, **R** will be multiplied by 1.25.
* If the player is moving, it will be multiplied by 0.5.

**Finally,** it will be rounded to the nearest whole number.

So, for a brief conclusion: the longer player not getting hurt, the higher maximum health player has, the higher for the natural health regeneration rate. Also, standing still gives a 2.5X healing bonus compared to moving. Using an item does not count as moving.

After all of the above, if the player is in Expert Mode and does **not** have a Well Fed buff, **R** will be multiplied by 0.5.

## Item and buff effects

**R** is also affected by other items and buffs.

Note: Despite drowning being similar to life-draining debuffs, it only resets the **RT** and does not affect the **RC** and **R**. It directly reduces Hit Points instead.

### Buffs

 Resting or Sitting
**RT** +10 per tick

These apply if the player doesn't have any life-draining debuffs:

 Band of Regeneration
Charm of Myths
Moon/Sun/Celestial Stone
Celestial Shell
Squire's Great Helm (On )
Solar Flare armor (each piece)
 Regeneration
Squire's Great Helm (On )
 Life Nebula | Sets **R** = 0 if it's less than 0  **R** +6 for each buff level (18 at the third level)

### Regen debuffs

* Feral Bite debuff: Base **R** is multiplied x0.5.
* Bleeding debuff: Keeps **RT** reset to 0, so base **R** remains at 0.

### Life-draining debuffs

These cancel the **R** boosts in the second table above, reset **RT** to 0, and reduce **R** by these values:

* Poisoned: -4
* On Fire!: -8
* Venom, Cursed Inferno, Frostburn: -12
* Burning: -60
* Suffocation: -40.
* Electrified: -8 (when standing still), or -32 (when moving).
* The Tongue: -100 only in Expert mode.

Note: If you are under the debuff of Burning or Suffocation, instead of losing 1 health when **RC** reaches -120, you'll always lose 5 health when **RC** reaches -600.

### Honey

 **R** > 0 | **R** boosted +2

* Which means Honey reduces the rate of any life-draining debuff.
* Honey additionally boosts **RT** +2 per tick (**RT** increase is 3× as fast).

### Shiny Stone

If the player is using items or not standing still, it will reset the multipliers of the Feral Bite debuff and Expert mode to 0.75 from 0.5. Both of them only reduce the regeneration speed by 25% instead of the previous 50%. It will also multiply base **R** ×1.1.

If the player is **not** using any items and almost standing still (it allows small amounts of movement), the following effects are applied **in addition** to those above:

1. If the player has any life-draining debuffs so that **R** is less than 0, **R** is reduced by half (if you also have Honey buff, then it increases **R** by 4 first(but no more than 0), then, **R** is reduced by half, finally, the Honey buff additionally increase **R** by 2.).
2. **R** +4.
3. **RT** +4 per tick.
4. If 90 < **RT** < 1800, **RT** is reset to 1800.
5. When **RT** > 3000, it will remove the **RT** cap, and every 300 **RT** above 3000 will boost **eRT** +1 (this part is capped at 30, so it will give an **eRT** maxed at 38 instead of the previous 9).
6. Finally, if **R** > 0, **RC** is boosted +1 per tick.

So, if the player is at 600 max HP, with the Shiny Stone and standing still, in Expert mode, without Well Fed:

* **R** = (600 ÷ 400 × 0.85 + 0.15) × 38 × 1.25 × 0.75 × 1.1 + 4 = 63
* **RC** is additionally boosted +1 per tick
* = 32 Hit Points per second regeneration rate.

### A more complex example

To illustrate how items, buffs and debuffs interact with each other, here is a more complex example:

Assume the player has the Venom, On Fire! debuffs, the Regeneration and Honey buffs, has the Shiny Stone and Charm of Myths equipped, is standing next to a Heart Lantern, and is standing still.

According to the above, here is how life regeneration can be determined:

1. The Regeneration buff and Charm of Myths increase **R** by 4 and 1 respectively, so, **R** = 5.
2. The life-draining debuffs cancel out the effect above and set **R** to 0.
3. The Venom and On Fire! debuffs reduce **R** by 12 and 8 respectively, so, **R** = -20.
4. Because **R** < 0, the Honey buff increases **R** by 6, so, **R** = -14.
5. As **R** is still less than 0, the Shiny Stone cuts it in half, so, **R** = -7.
6. Then the Honey buff, Shiny Stone, and Heart Lantern increase **R** by 2, 4, and 2 respectively, so, **R** = 1.
7. Because the player has life-draining debuffs, **RT** will remain at 0, so player will not have natural health regeneration.
8. As **R** is greater than 0, the Shiny Stone will provide the **RC** +1 per tick bonus.

Thus, the player has **R** + 1, and will gain health.

But, if the player places a Campfire nearby, it will give **R** +1 boost and give the player a 0.5 HP/s regeneration rate. In addition, because **R** > 0, the Shiny Stone will now provide a **RC** +1 per tick bonus, granting an additional 0.5 HP/s regeneration rate. Thus, the player will now have a 1.5 HP/s regeneration rate.

However, if the player has the Rapid Healing buff (which gives the **RC** +6 per tick effect and does not affect **R**) instead of placing a Campfire, the Shiny Stone will not provide the **RC** +1 per tick bonus. So instead, the player will have a 3.5 HP/s regeneration rate.

## References

1. ↑ Information taken from the PC 1.3.5.3 source code, method `UpdateLifeRegen()` in `Terraria.Player.cs`. There may be inaccuracies, as the current  PC version is 1.4.4.9.
2. ↑ A tick is a time unit countable by the software. Most of *Terraria*'s updating logic happens every tick. A tick has the length of 1/60th of a second, hence there are 60 ticks in a second and 3600 ticks in a minute.