informa
/
Featured Blog

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

Carnivore Land is all about fast paced action. So, how to fill the world with enemies? We decided on a spawning system inspired by Left 4 Dead, which features dynamic enemy spawn locations and behaviours.

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 Itch.io as early access at: http://dwcrew.itch.io/carnivore-land

You can vote for Carnivore Land on Steam Greenlight if you like it: http://steamcommunity.com/sharedfiles/filedetails/?id=454770185

For more information please visit http://carnivoreland.com/

Latest Jobs

Sucker Punch Productions

Bellevue, Washington
08.27.21
Combat Designer

Xbox Graphics

Redmond, Washington
08.27.21
Senior Software Engineer: GPU Compilers

Insomniac Games

Burbank, California
08.27.21
Systems Designer

Deep Silver Volition

Champaign, Illinois
08.27.21
Senior Environment Artist
More Jobs   

CONNECT WITH US

Register for a
Subscribe to
Follow us

Game Developer Account

Game Developer Newsletter

@gamedevdotcom

Register for a

Game Developer Account

Gain full access to resources (events, white paper, webinars, reports, etc)
Single sign-on to all Informa products

Register
Subscribe to

Game Developer Newsletter

Get daily Game Developer top stories every morning straight into your inbox

Subscribe
Follow us

@gamedevdotcom

Follow us @gamedevdotcom to stay up-to-date with the latest news & insider information about events & more