Namespaces

Variants
Views
Actions

Game mechanics

From Terraria Wiki
Jump to: ,
It has been suggested that this page/section be rewritten.
Reason: "Page has become bloated; cluttered appearance. Still more mechanics to add. Technical issues. See discussion."


Contents

[] Player mechanics

[] Attack Speed

in Terraria is handled like : additive bonuses except the cap is at 4 times original speed. However , or the time it takes to swing (attack) or use an item, is reduced instead of increased. Use time of 30 is slower than use time of 10. See for an organized view of this.

Max increased attack speed (for melee) is +81% using set (29), (12), (5), (10), (5), and total of 5 accessories reforged to (20).

Even though most tools are also melee weapons, increasing "melee attack speed" via accessories and armors will not increase mining speed; however, the set bonus from will increase mining speed. indicates that the "+% speed" from the "Common" category of weapon on pickaxes do increase the mining speed of the pickaxe, so if you have a surplus of resources it is a good idea to keep re-crafting your pick until you make one with a "+% speed" bonus on it. Similar testing still needs to be done for axes and hammers.


Game mechanics
 
 •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •

[] Defense

is the number that determines how much damage can be absorbed per hit. Damage the player takes is reduced by half their defense value, rounded up.

Defense can be increased by equipping and , or temporarily boosted by consuming and

[] Mechanics

Defense (or Defense Rating) gives an arithmetic reduction in damage: i.e. reduces damage by a fixed amount per hit (as opposed to a geometric damage reduction, which reduces damage by a percentage).

[] Formula

The formula is:

Damage Reduction = ROUND_UP(Defense * 0.5)

For example, with 10 (or 9) Defense, a 20 Damage attack is reduced by 5, to 15 Damage.

[] Strategy

Because of this, high Defense is particularly effective against low damage attacks, which can be reduced almost completely, but not as effective against high damage attacks, where the reduction is just flat. This also means that added defense gets increasingly more important. A jump from 10 to 20 defense has smaller benefits on average than a jump from 30 to 40 defense.

[] Monsters

Monsters have the same Defense mechanics as players. Monsters with high defense will take virtually no damage from low damage weapons (e.g. take 5 damage from the with ). Accordingly when fighting high defense monsters, high damage weapons are preferable.

[] Armor and Accessory Defense

See for full list.


[] Notes

  • No attack can be reduced to less than 1 Damage.
  • Defense applies to all forms of damage, including, but not limited to , gravity influenced blocks ( and ), , , , and .
  • on accessories can increase the defense of an accessory by up to 4 points.


Game mechanics
 
 •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •


[] Fall Damage

refers to the damage a player character sustains upon falling a large distance. It is one of the basic game mechanics. Fall damage occurs only if the "fall distance" exceeds a fixed threshold, beyond which the damage amount varies linearly with the distance traveled past said threshold. If the damage amount is greater than or equal to the player's current health, he or she upon impact.

Perhaps surprisingly, the player's vertical speed upon impact has no bearing on fall damage. Fall damage works the same way for all solid surfaces, but does not occur when submerged in or . It is mitigated by the player's .

[] Formula

In the basic case—falling through air directly onto a solid surface, without the use of special accessories or potions—fall damage is affected by exactly two variables: fall distance and Defense. No damage is sustained if the fall distance is less than or equal to 25 blocks (50 feet). Beyond this distance, 10 additional damage is sustained for each block traveled (or 5 damage for every foot). Thus, assuming a distance greater than 25 blocks (and no Defense), the formula for calculating fall damage is

damage = 10(h - 25)

where h is the total fall distance (in blocks). To factor in the player's Defense rating, simply apply it in the normal way:

damage = MAX( 1, 10(h - 25) - ROUND_UP(d/2) )

where d is the Defense rating. Note that the MAX function clamps the result to a minimum value of 1, because an injury always causes at least 1 damage, regardless of Defense.

[] Negation/strategies

There are four major ways of negating fall damage and three minor.

[] Stopping the fall

The first and most obvious is to "break" the fall before hitting the ground. Using items such as , , , , or will cause the fall distance counter to reset upon use, negating the damage. You can also make a pool at the bottom of your descent, useful for hellevators, or put . Cobwebs slow you down, so if you put it right before you land, you will not suffer any damage.

[] Preparing the terrain

Another alternative is to prepare the terrain in such a way as to not take fall damage at all: Placing inside shafts so that the fall distance never exceeds 25 blocks. Other alternatives include cushioning the ground: or a depth of 3 of will stop the player's fall, without damage. As of version 1.0.6, will break off after pushing them. This makes water the more desirable choice as the player would take the cobwebs with them.

[] Accessories

The is an accessory that negates fall damage. It can be found in chests. They can be very handy when exploring chasms. It can also be combined with an to make the , which has the benefits of both the Skull and the Horseshoe while taking up only one accessory slot.

Once the player has found a Grappling Hook and/or a Cloud in a Bottle, the Lucky Horseshoe loses some of its usefulness, and can potentially be swapped out, although having one equipped is always a good safeguard.

The and also offer complete fall damage immunity on top of their flight, slowfall, and stacking with , effectively rendering the obsolete once obtained.

[] Featherfall Potion

The makes players fall more slowly and negates fall damage, even when its slowing effect is temporarily canceled out by the player holding the down key.

[] Cobweb parachute

By falling next to a wall and placing a under you before you land, you can negate all of the fall distance above the cobweb you placed. This is almost never used because cobwebs can only be placed over a background wall piece or by a block, but cobwebs are easier to come by than other items so that makes them good to start with.

[] Bucket parachute

By using a to pick up water and then drop it below you during a fall, you will find that you are falling almost as slow as the water, thus not "actually" falling. This can be good for spelunking into large caves and the corrupted area due to many of these places often having water on the bottom and you can often salvage the water you drop. (You could do this with lava too but if you don't have the buff active during the whole thing you would take lava damage and would probably die.)

[] Sand ladder

If there is an area with a large drop or may be hazardous (such as a pool), gather a lot of (the number of blocks you want to avoid falling or more). When you reach an area you want to go down, drop sand down there until it has stacked up to a desirable level, jump onto the pile of sand and then mine the sand block you're standing on.

[] Maximum fall damage

Maximum fall damage

Although there is no maximum cap on fall damage, there is a limit to how big your map can be.

On a large world you can take up to 23270 damage if falling from the top of the map to the bottom. This would mean falling down 2352 blocks (after 25 blocks). So from the bottom of the map to the top of the map (that a player can have access to) is 2352 blocks + 25 + 2 (because you land on your feet, you have to account for your body and head too) which makes a large world 2379 blocks in height, or 4758 feet (again, that a player has access to. There is space outside of the boundaries for monsters to spawn and where a can fly).


Game mechanics
 
 •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •


[] Health

is the player's life in the game and is represented by hearts at the top of the screen (each heart represents 20 health). Each character starts with 100 maximum health (5 hearts), but that can be increased to a maximum total of 400 (20 hearts) by using . It will take a total of 15 life crystals smashed and used to reach maximum health. When a character's life reaches 0, occurs.

[] Taking damage

The player loses health when they take damage from enemies, environmental hazards, falling or drowning. After taking damage, the player will begin to flash. During this brief period the player is prevented from taking additional damage.

[] Enemies

Main article:

Enemies such as , and typically deal damage by touching the player. Other, more powerful enemies such as or can also damage the player via projectiles. Damage from enemies typically inflicts on the player, sending them flying through the air away from the source of the damage.

[] Environment

In addition to enemies, the environment of Terraria itself can cause damage to the player. and the thorns that grow in the and areas hurt the player when touched. The heat from and blocks will also deal damage to the player. is particularly dangerous as it causes serious damage but does not knock the player back, instead lighting them leaving them to sink further into the lava to take additional damage.

[] Falling

Main article:

Falling from a height of more than 25 blocks (50 feet) also causes damage to the player. Falls from greater heights will do more damage than short falls.

[] Drowning

Main article:

Staying in water for too long will cause the player's health to swiftly drain away due to drowning.

[] Preventing damage

Main articles: and

By wearing armor and equipping certain accessories players can increase their defense which decreases damage taken. In addition to simply decreasing damage, some items can mitigate or eliminate certain forms of damage. All accessories can have that grant up to 4 defense in addition to their other bonuses and functions.

Item Type Notes
Accessory Gives the player 1 extra defense.
Accessory Grants immunity to fire-based blocks and gives the player 1 extra defense. This includes , and , but not .
Accessory Prevents knockback from damage and gives the player 1 extra defense. By preventing knockback this allows the player to have full use of the brief post-damage invincibility time.
Accessory Combines the functions of the and . The Obsidian Shield gives the player 2 extra defense.
Accessory Negates all falling damage.
Accessory Combines the functions of the and . It does not, however, give any defense.
Accessory Allows the player to double-jump. Though this does not directly prevent damage, if used before hitting the ground it can eliminate falling damage.
Armor Greatly extends underwater breathing (1 minute and 34 seconds instead of 22 without equipment).
Accessory Allows the player to "swim" by jumping while in the water as though standing on a surface. This makes it much easier to avoid drowning.
Accessory Combines the functions of the and . It is equipped in an accessory slot rather than an armor slot, allowing the player to equip a more defensive helmet.
Item Allows the player to breathe near the surface of water, and makes the decrease over a period of 44 seconds(Instead of 22, without equipment). By placing this item on your action bar and selecting it, you will be able to breathe if the top of the reed is above the surface of the water.
Item Shoots out a hook that pulls the player to distant ledges. By grappling to a wall or the ground right before landing after a long fall, you can prevent all falling damage.
Item An upgrade to the that shoots faster and can sustain three grapples at the same time. Its role in damage prevention is the same as that of the Grappling Hook.
Item Arguably a superior form of the which performs the same role. Additionally, it can fire two hooks at once and provides illumination when attached to a surface.
Potion Increases defense by 8 for 5 minutes.

[] Restoring health

Lost health can be regained in many ways. If the player has access to a then they can ask her to heal them to full by paying her a fee based on how much damage has been taken. There are also several items that can be used to heal the player. The player will automatically start regenerating health after a short period if no damage has been taken, and it will do it faster while standing still.

Item Notes
Hearts restore 20 health instantly when collected and cannot be placed in the .
Restores 15 health when used. Shares a cooldown with most other consumable healing items.
Restores 25 health when used. Shares a cooldown with most other consumable healing items.
Restores 50 health when used. Shares a cooldown with most other consumable healing items.
Restores 100 health when used. Shares a cooldown with most other consumable healing items.
Restores 150 health when used. Shares a cooldown with most other consumable healing items.
Restores 50 health and 50 when used. Shares a cooldown with most other consumable healing items.
Restores 100 health and 100 when used. Shares a cooldown with most other consumable healing items.
Restores 20 health when used. Shares a cooldown with most other consumable healing items.
Increases maximum life by 20 and restores 20 health when used. Does not trigger the consumable healing item cooldown. Cannot be used if the player's maximum life is at 400.
Slowly regenerates health when worn.
Regenerates 600 health over the course of 5 minutes.
Restores 20 health when used. Shares a cooldown with most other consumable healing items.

Note that healing effects will not exceed your maximum health and any healing beyond the maximum is lost. It is advisable to avoid overhealing when healing items are scarce.

Almost all consumable restoration items are affected by a shared consumable healing item cooldown, excluding the Regeneration Potion. The cooldown is 60 seconds long and begins when a consumable healing item is used. During this period the player is not allowed to consume any more consumable healing items. This prevents players from bypassing hazardous areas, enemies, or surviving long, difficult battles through constant item consumption.

[] History

  • :
    • Player automatically regenerates health when not taking damage for some time.
    • Healing items give upon use.


Game mechanics
 
 •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •

[] Mana

is a resource used by the player when wielding and certain magical items. The player's current and maximum Mana is shown as a vertical meter of blue stars on the right side of the screen. Mana regenerates automatically, which happens more quickly when the player stands still.

Each character starts with zero maximum mana. Using (crafted from 10 ) increases the player's maximum mana by 20 permanently, up to a maximum of 200 (10 stars). Maximum mana can be further increased by certain armors, accessories, and buffs, up to a maximum of 400 (20 stars).

[] Items that consume Mana

In addition to all items listed in , using the following items also consumes Mana:

[] Increasing Mana

In order to use magic weapons more often, certain items can increase the maximum mana or reduce the cost of using magic weapons.

Item Notes
Increases maximum mana by 20 (1 star).
Increases maximum mana by 20 (1 star).
Increases maximum mana by 20 (1 star).
Increases maximum mana by 20 (1 star).
Increases maximum mana by 40 (2 stars).
Increases maximum mana by 60 (3 stars).
Increases maximum mana by 80 (4 stars).
Increases maximum mana by 100 (5 stars).
6% reduced mana usage.
8% reduced mana usage, uses mana potions automatically.
Increases maximum mana by 20 (1 star), 2% reduced mana usage, lasts 10 minutes.
Increases maximum mana by 20 (1 star).

[] Restoring Mana

Mana regenerates on its own when not in use, until the player's current maximum, which occurs more quickly while standing still. The mana regeneration rate depends on the amount of mana you have left - it regenerates at a much faster rate when your mana bar is nearly full than when it is nearly empty. In this regard, it is usually not a good idea to use all your mana at once. There are also several items that can be used to regenerate mana. Notice that the last star on the mana bar makes a pulsing motion.

Item Notes
Restores 50 mana when used.
Restores 100 mana when used.
Restores 200 mana when used.
Restores 50 mana when used. Shares a cooldown with most other consumable healing items.
Restores 100 mana when used. Shares a cooldown with most other consumable healing items.
Stars restore 100 mana instantly when collected and cannot be placed in the .
Increases maximum mana by 20 and restores 20 mana when used. Has no effect if used 10 times on a single character (In other words, if your maximum Mana without any 'artificial' increases (, , etc.) is 200).
Increased Mana regeneration, lasts 2 minutes.

Note that mana restoring effects will not exceed your maximum mana and any mana restore beyond the maximum is lost. It is advisable to avoid overusing of mana restoring items. Some of the mana restoring items share an item cooldown with each other and most other healing items. The cooldown is 60 seconds long and begins when the consumable item is used. During this period the player is not allowed to consume any more of those items. This prevents players from bypassing hazardous areas or enemies by constant item consumption.

[] History

  • : Fixed a bug where Mana wouldn't regenerate if you had 0 base mana.
  • :
    • Mana now recharges depending when how much you have in your mana pool. The more mana you currently have, the faster it recharges. It also recharges much faster when standing still compared to when moving.
    • Mana bar turned from purple to blue, along with most related items.
    • A sound effect signifies when it's become full and your character will emit a small glitter.


Game mechanics
 
 •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •


[] NPC mechanics

[] Monsters

[] Spawning

In Terraria, monsters will spawn off camera and pursue the player based on their . The rate at which monsters are spawned, the maximum number of monsters, and the type of monster spawned are all dependent on the , , of the ground, and other factors.

[] Spawn Rates

There is a 1 in "Spawn rate" chance a monster will spawn every game tick. There are 60 ticks per second, so a spawn rate of 600 means, approximately, a 10% chance of at least one enemy spawning per second, and a spawn rate of 100 means a 45% chance of at least one enemy spawning per second.

When the game is determining the maximum number of enemies in the area, the "Max Spawns" is used. Some enemies count towards this limit more than others. Most bats are considered half an enemy, and teleporting casters typically count as 3. Bosses count as 5. In general, large or special monsters count for more than one spawn.

The minimum (fastest) spawn rate under normal conditions is 60, and the maximum spawns is 15. The modifiers from and are set before these limits are checked. Goblin Sieges are a special case, they ignore any modifiers or limits to the spawning rates or number of spawns (including water candles/ battle potions).

Biome Spawn rate Max Spawns HM Spawn Rate HM Max Spawns
Surface (day) 600 5 540 6
Surface (night) 360 6 324 7
Surface (Blood Moon) 108 11 97 14
(dirt layer) 300 8 243 10
(stone layer) 240 9 216 11
600 10 162 15
Jungle (day) 240 7 216 9
Jungle (night) 144 9 129 11
Jungle (Blood Moon) 60 15 60 15
Jungle (dirt layer) 120 12 97 15
Jungle (stone layer) 96 14 86 15
Corruption (day) 390 6 351 7
Corruption (night) 234 8 210 10
Corruption (Blood Moon) 70 15 63 15
Corruption (dirt layer) 195 11 157 14
Corruption (stone layer) 156 12 86 15
Hallow (day) 600 5 540 6
Hallow (night) 360 6 324 7
Hallow (Blood Moon) 108 11 97 14
Hallow (dirt layer) 300 8 243 10
Hallow (stone layer) 165 12 140 14
Meteorite (day) 240 5 216 6
Meteorite (night) 144 7 129 8
Meteorite (Blood Moon) 60 12 60 15
Dungeon (dirt layer) 120 14 97 15
Dungeon (stone layer) 96 15 86 15
Goblin Siege 20 10 + 1.5 per player 20 10 + 1.5 per player


Additionally, the spawn rate will be modified by the number of active monsters in the area. The less monsters there are, the faster they will spawn. If there are less than 20% of the maximum number of spawns, the spawn rate will be multiplied by 0.6. If less than 40% the spawn rate is *0.7, 60% is *0.8 and 80% is *0.9. The spawn rate is sped up even more if below a certain depth or in a corrupted biome.

The presence of friendly NPCs greatly reduces the rate at which enemies spawn, and also reduces the maximum enemies as well. When 3 or more NPCs are present, no enemies will spawn. Special events such as Goblin Siege and Bloodmoon bypass this reduction.

Some biomes will override each other when determining the spawn rate. Corruption, Dungeon, Meteor and Jungle are all mutually exclusive spawn rates. Dungeon has the highest priority, then jungle, corruption, and finally meteor. For example, if a meteor hits the jungle, it will use jungle spawn rates.

[] Spawning Basics

Each player in game will spawn their own monsters. If two players are in the same area, monsters will appear twice as fast as they would with only one player.

[] Choosing a spot to spawn the monster

When the game decides to spawn a monster, it will first choose a random tile within a rectangle around the player. The maximum distance from the player it can choose from is 73 tiles to the left or right, and 45 tiles up or down. If the picked tile is solid block, it will try another one. If the picked tile has a wall that blocks monsters from spawning, it will also try another tile.

Once an empty tile is found, it moves down until it finds the ground. If there is enough space for a monster to be spawned at this location, this will be the tile it chooses. The exception to this is when the player is in an area where can be spawned. In this case the game does not attempt to find a ground tile.

The chosen tile is then checked to make sure it is not within the "safe" area around the player. Monsters cannot spawn less than 54 tiles away left or right, or 33 tiles up or down.

[] Choosing a type of monster to spawn

The type of monster spawned will depend on many factors including, but not limited to:

Certain events, such as can override or change certain rules about spawning. For example, spawning will not be stopped by walls that normally prevent spawning.


Game mechanics
 
 •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •


[] AI

The AI (or artificial intelligence) is the behavioral pattern exhibited by an NPC. For instance, the will always warp, shoot three times, pause for three seconds, and then warp again. Knowing the AI an enemy uses can provide an advantage in combat, as it offers an idea of how the enemy will attack and react in given scenarios.

In addition, additional AI is added for certain NPCs, such as the non-aggressive mode of surface slimes, the Eater of Souls' circling around the player, the Wandering Eye's acceleration, and the ranged attack of some Fighter AI mobs (added in ).

There are 39 different AI types:

[] Drops

When in the , all enemies have a chance to drop , and when killed in . Even enemies spawned from other areas will drop souls based on the current area. For example, a in the will drop a , not a .


Most monsters will typically drop a few stacks of coins after dying. Monsters that drop a large number of coins have a higher chance of dropping multiple stacks.

The total amount of money dropped is calculated using a "base value", which depends on the monster. A for example, has a "base value" of 100Copper Coin. The exact amount of money dropped is this number multiplied by 80-120%.

After the amount of money is determined, there are then a few chances for the number to be increased.

  • 20% chance of increasing by 5-10%
  • 10% chance of increasing by 10-20%
  • 6.67% chance of increasing by 15-30%
  • 5% chance of increasing by 20-40%

These increases are not mutually exclusive, and a monster may have its money increased several times. It is possible to get all increases at once, each one is rolled individually. The average amount dropped, therefore, is 119.5% of the "base" value.


[] Environmental mechanics

[] Day and Night Cycle

Times
Sunrise/Moonset Sunset/Moonrise
4:30 a.m. 7:30 p.m.
Duration
In-game Real-world
Day 15 hours 15 minutes
Night 9 hours 9 minutes
Picture showing: Moonrise, Midnight, Moonset and Sunrise, Midday, Sunset.

The day and night cycle of the Terraria world refers to the rising and setting of the Sun and , and the ways this can affect the world.

  • Day and Night each have their own respective theme music in some biomes.
  • Some surface enemies only spawn at night (see below).
  • Some sell unique items at night.

Note that the Sun in Terraria rises at the left of the map, even though the left is referred to in-game as "West" (the same for right/East). When a or the begin approaching, the messages shown hold true to this rule.

[] Time

  • All newly-created Worlds begin at 7:00 AM.
  • In-game time can be displayed by equipping a or , or can be checked from a .
  • One minute of in-game time lasts one second of real-world time, meaning one hour in-game lasts one minute real-world. One Terraria day therefore lasts 15 real-world minutes, and night lasts 9 real-world minutes.

[] Enemies

At the layer, unique enemies spawn at night. Nocturnal enemies will run or fly away when the day starts.

Additionally, many can only be summoned successfully and fought during the night, including , , , , and .

In contrast, can only spawn randomly during the day, though it can be summoned with the at any time.

[] Night-only enemies

[] Night-only enemies

[] Trivia

  • You can grab the sun or the moon on the title screen and move it around. This has no functional effect, although some players claim to be able to occasionally drag the sun around as a level is loading. However it will hover to the correct place, not effecting the time.
  • Before formal server software was released for Terraria, and while it was necessary to open a second window of Terraria to host a server, you could drag the sun or moon around to directly change the time of day within the server.
  • If you are wearing , the sun will appear to be wearing them too. Un-equipping the sunglasses will cause it to revert back. This has no functional effect.


Game mechanics
 
 •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •


[] Map size

Map size refers to the size of a Terraria world. Upon creation, you can select either "small", "medium", or "large" for the size of the map you generate.

Dimensions of the different map sizes are as follows: (one block = two feet)

Map Size in Feet Size in Blocks Floating Islands
Small 8400 x 2400 4200 x 1200 3
Medium 12800 x 3600 6400 x 1800 4-5
Large 16800 x 4800 8400 x 2400 5-6

[] Map Size Comparison

Different world sizes may be better suited for different purposes. Players may find that creating many small worlds may be more efficient than creating large worlds due to the amount of memory needed.

As of v1.1, the sizes of maps have been adjusted.

[] Advantages of Small Worlds

  • Getting to specific locations like the , and requires less walking.
  • Less digging is required to reach the .
  • are lower and therefore easier to find.
  • The world saves and loads faster.
  • Small worlds are more compact potentially making easier to find.

[] Advantages of Large Worlds

  • There is more space to build and explore.
  • There are more total chests and pots underground per world.
  • There are more floating islands.
  • The Dungeon is larger.
  • There are more chasms and . This also means there would be more ores to generate.
  • There are more to destroy, which drop unique and valuable items.
  • is longer, potentially giving more time to defeat the .
  • There is a larger amount of ore.

[] Lighting engine

: Size of the impassable borders that outline the map is based on the current lighting style, so if you change it by pressing F9 you can have additional space. Each border of the world is shortened by 16 blocks if you use White/Color light styles over Retro/Trippy.


Game mechanics
 
 •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •  •  •  •
 •  •  •  •  •  •