Gamasutra is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Gamasutra: The Art & Business of Making Gamesspacer
arrowPress Releases

If you enjoy reading this site, you might also want to check out these UBM Tech sites:


A spawning system for Carnivore Land inspired by Left 4 Dead.

by John Kelesidis on 06/05/15 01:00:00 pm   Featured Blogs

1 comments Share on Twitter    RSS

The following blog post, unless otherwise noted, was written by a member of Gamasutra’s community.
The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.


From the early stages of the design of Carnivore Land, we were against the idea of having enemies spawn in fixed locations in the game. Having enemies in fixed locations would have killed any replay value because as soon as you learn the spawn locations and patterns, the enemy waves become super repetitive.

Instead, we created a randomized spawning system inspired from the spawning system of Left 4 Dead. We have created a central entity that handles all the enemy spawns and chooses where and how many enemies to spawn based on a set of predefined values and random attributes. Confused? Let me explain.

We have the player object. The player object is the center of the spawning system. All enemies are spawned around him. We also have a vector of where the player is looking and where he is moving towards. Let’s say that the spawn manager entity selects to spawn enemies to the back of the player movement vector and close enough to him so that they will attack from behind. Also, it selects that the spawned enemies of the wave will be very aggressive and will start chasing the player as soon as they are spawned. So it selects a random location to the back of the movement vector of the player and checks for validity. A spawn point is valid if it is on the level’s navigation mesh. If the point is not valid, it tests a new random location and retries, until it finds a valid point or a counter is reached where it retries at a randomized later time. If the spawn point is valid, it checks the spawn point of the next enemy for validity, etc.

The following picture depicts the valid spawn area for the enemies behind the player. The red area is invalid because it is inside the camera view, while the green area is valid because it is behind the player and outside of the camera view.

The following picture depicts invalid and valid spawn points in the aforementioned valid area. The red points are invalid because they are on top of non-navigable obstacles, while the green point is a candidate spawn location.

The following picture depicts the camera view for the aforementioned enemy spawn scenario.

The spawn manager entity controls the following features of the spawned enemies:

  • Health

  • Movement speed

  • Attack speed

  • Attack strength

  • View range

  • Movement state (chase the player, stand still or wander the level)

Also, the spawn manager controls how many enemies will spawn at each wave by monitoring the previous spawned waves. So if the previous wave was packed (a lot of enemies or high strength enemies), it will spawn less, more weak enemies.  

But how the spawn manager decides what and where to spawn? Weights and probabilities. All of the attributes that are controlled by the spawn manager are weighted randomized. When a wave is spawned, these weights are changed to reflect the probabilities of the attributes that the next waves will have.

Regarding the spawn location of the enemies, the spawn manager uses a similar weighted system to select in which direction from the player the enemies will be spawned. Also, there is a timer based weight on the look direction of the player. For example, if the player is still then, after a small interval, there is a greater probability for enemies to be spawned in the direction that the player is looking.

To sum up, the enemies are spawned by a central entity that monitors past spawned waves and player behaviour. The system uses a weighted randomized mechanism to choose the location, the numbers and the attributes of the spawned enemies.

Carnivore Land has been released on as early access at:

You can vote for Carnivore Land on Steam Greenlight if you like it:

For more information please visit

Related Jobs

Ringtail Interactive
Ringtail Interactive — Stockholm, Sweden

Technical Artist
SideFX — Toronto, Ontario, Canada

3D Software Developer (Maya plugin)
Pixologic, makers of ZBrush
Pixologic, makers of ZBrush — Los Angeles, California, United States

3D Graphics Programmer

Loading Comments

loader image