danaxcanvas.blogg.se

Screeps spawn creep code
Screeps spawn creep code











Repairing is done to target damaged structures. If a creep does not have any CARRY body parts, it cannot provide the necessary energy to build the structure. If a creep does not have any CARRY body parts, or it reaches its carrying capacity, it cannot hold the energy harvested, and will instead drop the energy to the ground.Ĭreeps can construct structures on construction sites, at a rate of 5 points/tick, costing 1 energy/point, per WORK module. Creeps are able to harvest energy at a rate of 2 energy/tick per WORK module. Harvesting is performed on energy source tiles. During these 9 ticks the creep will have the following values of fatigue: 44,38,32,26,20,14,8,2,0.Ĭreeps with the WORK body part can perform a variety of tasks. During the following 8 ticks creep will not be able to move, but it could move at 9th tick when fatigue value reaches zero. W = 2 + 3 = 5 (CARRY with 0 energy does not count as weight)Īfter move, creep will get 44 fatigue, which then with every tick will be decreased by 2*M=6. Time between moves is 2 ticks.Īnother example: creep has 3 MOVE parts, 2 WORK parts, 3 ATTACK parts, 1 CARRY part, 0 energy, stepping into swamp: But in the next next tick fatigue will drop to zero and creep will be able to move. Creep will not be able to move in the next tick. Time between moves is 1 tick.Īnother example: creep has 1 MOVE part and 2 ATTACK parts, stepping into plain:Īfter move, creep will get 2 fatigue. So after move, creep will not get any fatigue and it will be able to make next move in the next tick. Minimum time between moves could be calculated using the following formula:įor example, when creep has 1 MOVE part and 1 WORK part, when stepping into plain: Creep can make next move at the same moment when its fatigue value has reached zero. K = terrain factor (0.5x for road, 1x for plain, 5x for swamp)Īfter that, with every game tick creep's fatigue is reduced by 2*M, until its value reaches zero. W = creep weight (Number of body parts, excluding MOVE and empty CARRY parts) The initial fatigue value, which is acquired after move, could be calculated using the following formula: This would prevent the creep from making any further movements, until fatigue value drops to zero.Īs a rule of thumb for the number of MOVE body parts to reach the maximum speed: a creep needs half the number of non-MOVE body parts travelling on road, the same number of non-MOVE body parts travelling on plain and 5 times the number of non-MOVE body parts travelling on swamp. Creep's speed cannot be more than 1 per tickĭepending on proportion of number of MOVE body parts to other body parts which a creep has, and also on type of terrain the creep is stepping into, the creep might acquire non-zero fatigue.Creep cannot move, if it was spawned without MOVE body parts, or if its all MOVE body parts were destroyed by enemy. Creeps must have at least one active MOVE body part to be able to move.You cannot control creeps of other players. Creep cannot walk into a wall, a structure (unless this is its own ramparts or a container), or into another creep (unless the other creep moves to another tile during the same tick).A creep having fatigue will not move until its fatigue reaches 0.However, there are restrictions that might limit the creeps to be able to do so: A creep can therefore do both in 1 tick.ĪI can order a creep to move. Important to note is that rangedAttack is separate from attack and heal. heal or repair or build or attack or harvest.Not all actions can be executed, for example a creep can't heal and attack in 1 tick. These will then be executed in a fixed order. If a part takes 100 points of damage, it will be completely disabled - the creep may no longer use that part's ability.Ĭreeps will get several actions scheduled to execute per tick. It is important to note that the order in which parts are added to a creep is important! The sequence of parts dictate which components will be damaged first when a creep is attacked. This provides a cheap way to add hit points to a creep. No effect other than the 100 hit points all body parts add. Restores 12 hit points/tick at short range (1 tile) or 4 hits/tick at a distance (up to 3 tiles).

screeps spawn creep code

Short-ranged attack (1 tile).Īttacks a target creep/structure. Weighs nothing when empty.Īttacks a target creep/structure.

screeps spawn creep code

Consumes 0.01 energy/hit repaired, rounded up to the nearest whole number. Builds the designated structure at a construction site, at 5 points/tick, consuming 1 energy/point. Gathers 2 energy/tick.Ĭonstructs a target structure. Each part has weight, which increases creep fatigue as it traverses terrain tiles, with the exception of the MOVE module the more parts a creep bears, the more difficult it is for it to move. These components each provide the creeps with 100 hit points and a corresponding ability. Creeps are composed of a sequence of one to fifty of the seven different body parts.













Screeps spawn creep code