Screeps Wiki
Advertisement

The spawn is a building which can store energy and spawn new creeps. An AI can request the spawn to spawn new creeps. When enough energy is available in its storage device, the required energy will be subtracted from it and use it to spawn new creeps. The spawn is important because it's one of the first elements available in the game that can be used.

Spawns only have 300 energy of storage space that can be used to spawn creeps. Spawning creeps that require more energy to build requires the use of extensions that should be placed in the same room, each of which can increase the limit by 50 energy when filled.

Compared to earlier implementations of the game, only the cost of the creeps itself will be subtracted from the spawn and surrounding extensions.

Behavior[]

  • The spawn accepts energy from creeps, allowing the energy to be stored. Stored energy can be used to build new creeps.
  • The cost needed to spawn a creep is subtracted from its storage device.
  • If the cost is higher than the energy stored, the spawn order will be ignored (ERROR_NOT_ENOUGH_ENERGY will be returned from spawn.createCreep as return value if the cost is too high).
  • The total spawn time of a creep is the number of body parts * 3 ticks. This can be seen by selecting the spawn that is creating the creep.
  • You can only spawn a creep with body size MAX_CREEP_SIZE or below. The MAX_CREEP_SIZE is currently defined as 50.

Spawn named Spawn1 on a territory

Specs[]

  • Max storage: 300 energy
  • Storage at start: 300 energy
  • Health: 5000 hits
  • Max spawns per room: 3
  • Costs 5000 labor to build, taking 1000 seconds to build with one WORK body, while consuming 5000 energy.

Api[]

Methods[]

  • canCreateCreep(body [, name])
  • createCreep(body [, name [, memory]])
  • recycleCreep(target)
  • renewCreep(target)
  • transferEnergy(target, [amount])
  • destroy()
  • notifyWhenAttacked(enabled)

Properties[]

  • energy
  • energyCapacity
  • hits
  • hitsMax
  • id
  • memory
  • my
  • name
  • owner
  • pos
  • room
  • structureType
  • spawning

References[]

Advertisement