Spawn

From Terraria Wiki
(Redirected from World spawn point)
Jump to navigation Jump to search
Desktop versionConsole versionMobile version
This is the main page whose information applies to the Desktop, Console, and Mobile versions of Terraria.
For the differences of this information on Old-gen console and 3DS, see Legacy:Spawn.
This article is about the player's spawn location. For details about respawn timers of players after dying, see Death § Respawn. For the spawning mechanics of other entities, see NPC spawning.

The world spawn point is where players appear in a newly created world or when joining a multiplayer server. It is defined during world generation and is usually within a few tiles of the horizontal center of the world, in the surface layer. It is almost always located in the Forest biome as more hazardous biomes cannot appear at the world's center.

A player's spawn point is initially the world spawn point, but can be changed by crafting a Bed, placing it in a house and pressing the Open / Activate button on it. The spawn point is where players respawn after dying, where a Magic/Ice Mirror (or its upgrades) or Recall Potion will teleport them, and where they appear when entering the world. Once the house the Bed is in is broken or Open / Activate is pressed on the Bed a second time, the player's spawn point reverts back to the world's initial spawn point.

Minimap icons
Map Spawn.png
World spawn point
Map Bed.png
Player's spawn point

The world spawn point is marked by a green arrow icon on the minimap, and the player's spawn point is marked by a bed icon.

World spawn point

World generation

During world generation, the game selects one of the blocks it has generated as the world spawn point.[1]

The world always has an even number of tiles horizontally – 4200, 6400, or 8400, depending on world size. Therefore, the horizontal center of the world is a line between two tiles. When selecting the world spawn point, the game picks a random vertical tile column that is up to five tiles to the left of this central line and up to six tiles to the right of it. The block with the highest altitude in this vertical column is designated as the world spawn point.

However, if the block is below the surface layer or if the tile above it contains any liquid, then it is discarded. In that case, the game again picks a random tile column, though it now increases the possible range by 1 – so now any vertical tile column that is up to six tiles to the left of the horizontally central line and up to seven tiles to the right of it can be randomly selected. Again, the topmost block in the selected vertical column is designated as the world spawn point, and if that block does not meet the conditions either, it is discarded as well. The process is repeated until a valid block is found, with the possible horizontal range (i.e. how far the random selection can possibly stray from the horizontal world center) being increased by 1 tile every time.

As a result, the world spawn point will always be in the surface layer or higher and will never be covered by liquids. It will usually be located within a few tiles from the world's horizontal center, but can potentially end up further away from it.

Secret world seeds

In Celebrationmk10 worlds, a point at the beach of either Ocean is used as the basis instead of the world's center.

In Don't dig up worlds, the game selects the world spawn point as normal and then moves it down to the lowest tile of open air, which means on the island of Ash Blocks in those worlds.

Teleporting to the world spawn point

When the player enters the world, respawns after dying, or uses a Recall Potion, Magic/Ice Mirror, Cell Phone, or Shellphone (Home), they will be teleported to (or appear at, in the case of entering the world) the world spawn point – so long as they currently have no manually set spawn point at a Bed. If the player has obstructed the world spawn point (e.g. by placing blocks in the area) or has mined the world spawn point block (leaving the spawn point in midair), the game will attempt to teleport the player to a different location nearby.

The process for determining the teleportation target is described below. The tiles in the world are modeled as a Cartesian coordinate system, with the y-axis oriented downwards and the origin (0, 0) being the top-left tile. In this model, the world spawn point is assumed to be located at coordinates (x, y).

  • First, the game checks the 3×3-tile square above the world spawn point, i.e. from (x-1, y-3) to (x+1, y-1). If this area contains any solid blocks or liquids, the teleportation target is considered obstructed.[2]
    • If the world spawn point is obstructed, the game checks the 30 tiles directly above it (moving upwards from (x, y) to (x, y-29)) for an unobstructed location, i.e. a block where there are no solid blocks or liquids in the 3×3-tile square above it.[3]
      • If such a block is found, it is used as the target onto which the player will be teleported.
      • Otherwise, the obstructed world spawn point will be used as the teleportation target, placing the player inside of solid blocks.
    • If the world spawn point is not obstructed but is in midair, the game will search a 3×50-tile rectangular area below the world spawn point (from (x-1, y) to (x+1, y+49), moving downwards, checking each row from left to right) for a solid block. The first block found will be used as the teleportation target.[4]
      • If no solid block is found in this area, then the world spawn point will be used as the teleportation target, placing the player in midair.

Shellphone (Spawn) exception

The Shellphone (Spawn) also teleports the player to the world spawn point. The game follows the same process outlined above, with one exception: If the world spawn point is obstructed and no eligible block is found in the 30 tiles above it, then the game clears the world spawn point. With the other teleportation methods, the player would be placed inside the obstructing blocks at the world spawn point, but when using the Shellphone (Spawn), the obstruction is cleared by the game first.[5]

All solid blocks within the 3×3-tile square above the world spawn point will be destroyed and dropped as items. Liquids will be removed as well, but filled storage items and their supporting blocks will remain intact.[6] The player might still end up inside of solid blocks this way.

Tips

  • It might be useful to build a shelter over the world spawn point so that the player is provided some amount of safety if they happen to respawn at the world spawn point, like when their manually set spawn point is inadvertently reverted back to the initial world spawn point. Similarly, it should be avoided to dig directly underneath the world spawn point, as players respawning there will inevitably fall down.
  • It is possible, albeit extremely rare, for the world spawn point where the player first spawns to be located on a Floating Island. In this case, it is highly advisable to use the available blocks to create a staircase to the ground. If there happens to be a Lucky Horseshoe or Fledgling Wings in the Skyware Chest, then equipping that item allows jumping down without taking fall damage.
    • Alternatively, one could also generate a new world.

History

  • Desktop 1.4.0.1:
    • Added icons for the world spawn point and bed spawn point on the minimap.
    • Players can now spawn up to 30 tiles above their spawn point if the location is covered by blocks, rather than destroying those blocks.
    • Since the Snow biome now generally generates further away from the world center, it is now significantly less likely for players to spawn in one.
  • Desktop 1.2.4: It is now much more likely that the player will spawn on a flat clean surface when creating a new world.
  • Desktop 1.2.0.2: If a Bed is placed somewhere that would cause the player not to spawn without breaking through blocks, they will now get a message when trying to set the spawn point letting them know the Bed is not in a suitable position.
  • Desktop 1.0.1: Spawning no longer destroys Chests that are placed on ground that is removed due to spawn point clearing.

References

  1. Information taken from the Desktop version Desktop 1.4.4.9 source code, method GenerateWorld() in Terraria.WorldGen.cs. The related world generation pass is called "Spawn Point".
  2. Information taken from the Desktop version Desktop 1.4.4.9 source code, method Spawn_IsAreaAValidWorldSpawn() in Terraria.Player.cs.
  3. Information taken from the Desktop version Desktop 1.4.4.9 source code, method Spawn_GetPositionAtWorldSpawn() in Terraria.Player.cs.
  4. Information taken from the Desktop version Desktop 1.4.4.9 source code, method Spawn_DescendFromDefaultSpace() in Terraria.Player.cs.
  5. Information taken from the Desktop version Desktop 1.4.4.9 source code, method Shellphone_Spawn() in Terraria.Player.cs.
  6. Information taken from the Desktop version Desktop 1.4.4.9 source code, method Spawn_ForceClearArea() in Terraria.Player.cs.