On this page
  1. Related
  2. Games

Enemies enter play in two ways. Placed enemies are listed in the level and created as the screen reaches them. Generators create enemies over time, from a pipe, a door, or off screen, until something stops them.

  • GeneratedSuper Mario Bros.: The Lost Levels (1986). A new Lakitu flies in sooner than in Super Mario Bros. once none is on screen.1Factorio (2016). Biter spawners turn the pollution they absorb into attack groups, and biters found new nests over time.2,3,4,5

Games

GameYearHowNote
Super Mario Bros.: The Lost Levels1986Generateda new Lakitu flies in sooner than in Super Mario Bros. once none is on screen
Factorio2016Generatedbiter spawners turn the pollution they absorb into attack groups, and biters found new nests over time
Every claim about this mechanic, by game (11)
Super Mario Bros.: The Lost Levels 1986While Lakitu's stretch of a level runs, the game checks every 128 frames whether a Lakitu is on screen. When none is, it counts the check, and on the third it sends a new Lakitu if an enemy slot is free (if none is, it tries again at the next check); the count starts over when a Lakitu is set up. The new one flies high in worlds 1 to 6 ($20) and lower in worlds 7 to 9 and A to D ($60). When one is on screen, the same check leads to the Spiny throw, not covered here.Code
Enemy spawning and set-up (EnemiesAndLoopsCore through InitJumpGPTroopa) are Super Mario Bros.'s with these changes: ProcLoopCommand reads 12 loop entries where Super Mario Bros. reads 11, and takes each loop's number of checks from a new MultiLoopCount table where Super Mario Bros. special-cases world 7; ProcessEnemyData skips a check in world 9 and gives one enemy code a piranha plant set-up; InitHammerBro checks the world; LakituAndSpinyHandler brings Lakitu back once LakituReappearTimer reaches 3, where Super Mario Bros. waits until it reaches 7, and brings him back lower on the screen in worlds 7 to 9 and A to D; InitBowser first erases any other Bowser; InitPiranhaPlant patches the plant's palette and pipe distance, green in worlds 1 to 3 and red from world 4 and in A to D; InitJumpGPTroopa starts the jumping paratroopa at x speed $F4 where Super Mario Bros. uses $F8. Of its 27 regions, 15 differ only in their addresses and 5 are byte for byte the same.Code
Mega Man 3 1990Mega Man 3's check_new_enemies is the enemy half of Mega Man 2's _find_objects, instruction for instruction, with new RAM and table addresses: both take the screen's left and right edges, then on the side the screen moves toward spawn each placement that comes into range and on the other side move a second cursor past placements left behind. Mega Man 3 drops Mega Man 2's matching walk over a separate item list and the switch to the stage bank around it. The spawn routine each calls starts the same way, skipping a placement already in a slot and taking a free one, and then differs: Mega Man 2 fills the slot from per-type tables in its fixed bank, and Mega Man 3 skips a placement marked defeated and copies the type's properties from bank 0.Code
Mega Man 4 1991Mega Man 4's enemy spawn engine is Mega Man 3's check_new_enemies instruction for instruction, moved from bank 26 at $9C00 to bank 56 at $8000; only the addresses of the stage's placement tables and one zero-page variable ($2E in Mega Man 3, $2F in Mega Man 4) differ.Code
Mega Man 5 1992Mega Man 5's spawn engine walks its stage's spawn list ahead of and behind the camera with Mega Man 4's code, instruction for instruction; only the addresses differ: the stage's placement tables, the two list cursors ($9E and $9F in Mega Man 4, $AD and $AE in Mega Man 5), the scroll direction flag ($2F, $AC), and the four window temporaries, two bytes higher.Code
Mega Man 5's routine that spawns an enemy from a spawn list entry follows Mega Man 4's step for step: the same checks for a live copy and the no-respawn bitmap, and the same slot fill from the entry's position and the parameter tables for its code, with the tables and temporaries at other addresses. It changes two things: it keeps the spawn code in the object's $0510 byte, which Mega Man 4 clears, and it masks bit 7 off the flags parameter and, when that bit is clear, ends by calling entity_facing_to_flags.Code
Mega Man 6 1993Both games walk a stage's sorted spawn list with two cursors, one for each side of the screen, comparing the scroll position with each entry's screen and X position, but Mega Man 6's spawner is new code. Mega Man 5 reads fixed tables in the stage bank ($A9FF, $AA7F, $AB80), keeps its cursors in $AD and $AE, and treats codes from $C0 up as palette and CHR commands; Mega Man 6 reaches each stage's lists through pointers it sets in $74-$7F from tables in bank $3A, keeps its cursors in $0649 and $064A, and skips entries whose bit in $0650 marks them used.Code
Factorio 2016A spawner absorbs pollution at 20 units plus 1% of its chunk's pollution per update. Each unit has a pollution cost to join an attack: a small biter 4, a medium 20, a big 80, a behemoth 400, and spitters 4, 12, 30 and 200. An attack group gathers for 1 to 10 minutes and holds at most 200 units.Code
Spawners, not factories, turn pollution into attacks: each update a spawner absorbs 20 plus 1% of its chunk's pollution (the wiki gives two versions of when it stops or what it takes instead, below), and after absorbing a certain amount it sends one of its units to a gathering point; the gathered group attacks after 1 to 10 minutes. The absorbed pollution pays for sending units, not for spawning them.Wiki
A spawner keeps up to 7 units of its own and spawns one every 6 seconds at evolution 0, quickening to every 2.5 seconds at evolution 1.Code
Enemies expand: between 10 and 60 minutes apart, shorter as evolution rises (60 minutes at evolution 0, 10 at 1, on the curve −e² + 2e), a group of 5 to 10 units times 8 to the power of evolution (so 40 to 80 at evolution 1, at the default enemy base settings; 2.1 also scales it with the map's base-size setting) sets out to a chunk 3 to 5 chunks out from the enemy bases already there, where its members turn into new spawners and worms, one every 30 seconds.Code

References

  1. ^While Lakitu's stretch of a level runs, the game checks every 128 frames whether a Lakitu is on screen. When none is, it counts the check, and on the third it sends a new Lakitu if an enemy slot is free (if none is, it tries again at the next check); the count starts over when a Lakitu is set up. The new one flies high in worlds 1 to 6 ($20) and lower in worlds 7 to 9 and A to D ($60). When one is on screen, the same check leads to the Spiny throw, not covered here.Codedoppelganger's SMB2J disassembly
    How we know
    7251LakituAndSpinyHandler:
    7252          lda FrenzyEnemyTimer    ;if timer here not expired, leave
    7253          bne ExLSHand
    7254          cpx #$05                ;if we are on the special use slot, leave
    7255          bcs ExLSHand
    7256          lda #$80                ;set timer
    7257          sta FrenzyEnemyTimer
    7258          ldy #$04                ;start with the last enemy slot
    7259ChkLak:   lda Enemy_ID,y          ;check all enemy slots to see
    7260          cmp #Lakitu             ;if lakitu is on one of them
    7261          beq CreateSpiny         ;if so, branch out of this loop
    7262          dey                     ;otherwise check another slot
    ⋮
    
    sm2main.asm lines 7251–7288 at 9c40114 · upstream ↗
    7234SetupLakitu:
    7235      lda #$00                   ;erase counter for lakitu's reappearance
    7236      sta LakituReappearTimer
    
    sm2main.asm lines 7234–7236 at 9c40114 · upstream ↗
    928   ldx #$14                  ;set offset to decrement only frame timers
    929   dec IntervalTimerControl  ;if interval timer control not expired, branch
    930   bpl DecrTheTimers         ;to skip and thus decrement only frame timers
    931   lda #$14
    932   sta IntervalTimerControl  ;otherwise reset interval timer control to 20 frames
    933   ldx #$23                  ;and load offset to decrement frame and interval timers
    
    sm2main.asm lines 928–933 at 9c40114 · upstream ↗

    Checked against the evidence by its author, an AI model, 2026-10-26.

    Checked by a second AI model, 2026-10-26.

    In the claim ledger

  2. ^A spawner absorbs pollution at 20 units plus 1% of its chunk's pollution per update. Each unit has a pollution cost to join an attack: a small biter 4, a medium 20, a big 80, a behemoth 400, and spitters 4, 12, 30 and 200. An attack group gathers for 1 to 10 minutes and holds at most 200 units.Codefactorio-data 2.1.23
    How we know
    174    absorptions_per_second = { pollution = { absolute = 20, proportional = 0.01 } },
    
    base/prototypes/entity/enemies.lua line 174 at 39dbd0f · upstream ↗
    103    absorptions_to_join_attack = { pollution = 4 },
    
    base/prototypes/entity/enemies.lua line 103 at 39dbd0f · upstream ↗
    346    absorptions_to_join_attack = { pollution = 20 },
    
    base/prototypes/entity/enemies.lua line 346 at 39dbd0f · upstream ↗
    406    absorptions_to_join_attack = { pollution = 80 },
    
    base/prototypes/entity/enemies.lua line 406 at 39dbd0f · upstream ↗
    467    absorptions_to_join_attack = { pollution = 400 },
    
    base/prototypes/entity/enemies.lua line 467 at 39dbd0f · upstream ↗
    574    absorptions_to_join_attack = { pollution = 12 },
    
    base/prototypes/entity/enemies.lua line 574 at 39dbd0f · upstream ↗
    631    absorptions_to_join_attack = { pollution = 30 },
    
    base/prototypes/entity/enemies.lua line 631 at 39dbd0f · upstream ↗
    688    absorptions_to_join_attack = { pollution = 200 },
    
    base/prototypes/entity/enemies.lua line 688 at 39dbd0f · upstream ↗
    131      -- manual groups created through the API are unaffected.
    132      max_unit_group_size = 200
    
    base/prototypes/map-settings.lua lines 131–132 at 39dbd0f · upstream ↗
    106      -- pollution triggered group waiting time is a random time between min and max gathering time
    107      min_group_gathering_time = 3600,
    108      max_group_gathering_time = 10 * 3600,
    
    base/prototypes/map-settings.lua lines 106–108 at 39dbd0f · upstream ↗

    Checked against the evidence by its author, an AI model, 2026-10-26.

    Checked by a second AI model, 2026-10-26.

    In the claim ledger

  3. ^Spawners, not factories, turn pollution into attacks: each update a spawner absorbs 20 plus 1% of its chunk's pollution (the wiki gives two versions of when it stops or what it takes instead, below), and after absorbing a certain amount it sends one of its units to a gathering point; the gathered group attacks after 1 to 10 minutes. The absorbed pollution pays for sending units, not for spawning them.WikiFactorio Wiki: Pollutionrevised
    How we know
    If a chunk's pollution is greater than 20, each enemy spawner absorbs 20 + 0.01 * [chunk's pollution] every 64 ticks, otherwise it absorbs 3 times the amount of pollution needed for the most expensive unit it can spawn for the current evolution factor. … After a certain amount of pollution is absorbed the spawner sends one of its biters/spitters to a rendezvous point. … Every 1 to 10 minutes (random) the mustered biters launch an attack.
    Spawners · archived copy ↗
    Every 64 ticks, spawners absorb pollution until they have absorbed more than 3 times the amount needed to send the most expensive unit at the current evolution level.
    Spawners (absorption) · archived copy ↗
    Note that absorbing pollution is not for spawning biters, but for sending biters to an attack group.
    Spawners · archived copy ↗

    Checked against the evidence by its author, an AI model, 2026-10-26.

    Revised after a check by a second AI model, 2026-10-26.

    In the claim ledger

  4. ^A spawner keeps up to 7 units of its own and spawns one every 6 seconds at evolution 0, quickening to every 2.5 seconds at evolution 1.Codefactorio-data 2.1.23 · Factorio Wiki: Enemies
    How we know
    177    max_count_of_owned_units = 7,
    
    base/prototypes/entity/enemies.lua line 177 at 39dbd0f · upstream ↗
    203    -- With zero evolution the spawn rate is 6 seconds, with max evolution it is 2.5 seconds
    204    spawning_cooldown = {360, 150},
    
    base/prototypes/entity/enemies.lua lines 203–204 at 39dbd0f · upstream ↗
    This interval (spawning_cooldown in the enemy-spawner definition) is interpolated between 360 (0 evolution) and 150 (1 evolution) game ticks (= 6 to 2.5 seconds).
    Evolution · archived copy ↗

    Checked against the evidence by its author, an AI model, 2026-10-26.

    Checked by a second AI model, 2026-10-26.

    In the claim ledger

  5. ^Enemies expand: between 10 and 60 minutes apart, shorter as evolution rises (60 minutes at evolution 0, 10 at 1, on the curve −e² + 2e), a group of 5 to 10 units times 8 to the power of evolution (so 40 to 80 at evolution 1, at the default enemy base settings; 2.1 also scales it with the map's base-size setting) sets out to a chunk 3 to 5 chunks out from the enemy bases already there, where its members turn into new spawners and worms, one every 30 seconds.Codefactorio-data 2.1.23 · Friday Facts #445 · Factorio Wiki: Enemiesrevised
    How we know
    48      -- Distance in chunks from the furthest base around.
    49      -- This prevents expansions from reaching too far into the
    50      -- player's territory
    51      max_expansion_distance = 5,
    52      min_expansion_distance = 3,
    
    base/prototypes/map-settings.lua lines 48–52 at 39dbd0f · upstream ↗
    83      -- Size of the group that goes to build new base.
    84      settler_group_min_size = 5,
    85      settler_group_max_size = 10,
    86      -- Exponential factor used to determine the size of the settler group based on the evolution factor.
    87      -- The size is calculated as:
    88      -- size = random(min_size, max_size) * (evolution_group_size_factor ^ evolution_factor)
    89      evolution_group_size_factor = 8.0,
    ⋮
    91      -- Ticks to expand to a single
    92      -- position for a base is used.
    ⋮
    94      -- cooldown is calculated as follows:
    95      --   cooldown = lerp(max_expansion_cooldown, min_expansion_cooldown, -e^2 + 2 * e),
    96      -- where lerp is the linear interpolation function, and e is the current evolution factor.
    ⋮
    
    base/prototypes/map-settings.lua lines 83–101 at 39dbd0f · upstream ↗
    So for 2.1.13 we have increased the cooldowns: 30 seconds by default, and 10 seconds for Deathworld.
    Build base behavior · archived copy ↗
    Modify group size dependent on the map generator biter base size.
    Expansion groups were too small · archived copy ↗
    336    - Increased expansion group build base cooldown from 5 seconds to 30 seconds.
    337    - Reduced early game max enemy expansion group size from 20 to 10.
    
    changelog.txt lines 336–337 at 39dbd0f · upstream ↗
    When the expansion group reaches its target, each unit will begin dying in sequence to randomly create a spawner or a worm after some delay.
    Expansion · archived copy ↗

    Checked against the evidence by its author, an AI model, 2026-10-26.

    Revised after a check by a second AI model, 2026-10-26.

    In the claim ledger