First post, fish game

Hi. I am the designer in team shadhavar. Today I will be talking about the enemy wave/spawn system that I both designed and coded.

The game that me and my group are making is wave based, that is to say enemies attack the player in waves. When designing the wave system there were three main principles I wanted to stick to; the enemies should not spawn on top of eachother, waves should be easy to design and the system should be autonomous.

In order to make sure that enemies don’t all spawn ontop of eachother I created three spawn points that function as anchor points, additionally I made sure that all enemies had an offset from the spawn point. When an enemy spawns they first get randomly assigned to a spawn point, then they get a random offset that moves them away from their spawn point. In theory a spawn system with both multiple spawn points and a random offset, makes the chances of enemies spawning directly ontop of eachother very small. However, since I did not want  the offset to be too large, I restricted it’s possible numbers to a pretty small window, this means that even though enemies don’t spawn ontop of eachother they still for the most part overlap. I could probably improve the spawning location part of the code by adding an additional step to the system, which when an enemy spawns checks if there is any overlap with other enemies and then adjusts accordingly. However improving the spawn system when it already works has a lower priority than implementing other features.

spawn-system-demonstrationThe reason why it was important to make sure that all enemies did not spawn on top of each other, was to give the player a way of estimating how many enemies a wave contained. If enemies which function using the same straight forward AI would have spawned on the exact same location and not collide with each other, the chances are that they would all take the same path when trying to get to the player, resulting in an immeasurable blob of enemies.

In order to make the wave system easy to use for designing waves, I designed the code in such a way that you only have to copy and paste four lines of code and change som values. The values in question that need changing are: what wavenumber it is, how many enemies of type 1 should the wave contain and how many enemies of type 2 should there be. Because of the way the the code has been designed there is now an easy way to create as many waves as you could possibly want. If we were to add more enemies or things that would be affected by the wave system, the accessibility of the system would still not change.

Finally the waves and spawn system were created to be autonomous, so that the game would continue to throw waves at the player for as long as there are waves left in the system. The way the system is autonomous is pretty straight forward, whenever a wave spawns the system counts how many enemies spawned and whenever an enemy dies it counts how many enemies have died.  If the amount of enemies that have died are equal to the amount of enemies spawned, the system initiates the next wave, it continues to loop like this until there are no more waves left. The autonomous nature of the system also helps the simplicity of designing waves, because no matter how many wave you create you won’t have to change any other part of the code than the wave designing portion.

Hope this gave you some insight into my wave system and my design process.

About Ludvig Baummann Olsson

2016 Game Design