This week I’ll be writing about how I and my group went on how to create a spawning system for our enemies, power ups and anything we might need to add into our game.
I’ll also be writing on how I evolved the system from a something very rudimentary and basic to a more flexible system.
For our game we needed a spawning system that would have to be expandable and flexible.
As this was something I needed to create pretty early on in our project I had to make something that was easy for me to begin and to learn with.
For the very first iteration I barely had a system for spawning enemies as all I did was to put the enemies outside the camera view in Unity at specific point to see how it would look when they came in view of the player.
After just testing out how it could look, the second version was to have enemies spawn in endlessly as at that time we needed something to show at our playtesting. What we had was our basic enemy that would only move one direction would spawn in at a random height in the play area but only be moving from the right edge of the screen and move towards the left of the screen.
This enemy would spawn about six at a time and have about three to four seconds between them to clear them out of the game area before new ones came in.
After about two waves of this enemy would have spawned only two of our second enemy would spawn also at a random place at the right edge. As this enemy would chase the player and not leave the game area we had hoped that other people would have an basic idea of how the game played.
This went well as it gave us some ideas on how a very chaotic system would look for handling enemies.
Our game designer had already written down some of his ideas on how the waves would look and what positions the enemies would have.
So I had to improve how the system would work.
Having a time based system and a system that would be able to be expandable I made a system where you would be able to put in a number in a “for loop” that would place in Unity a list with that many waves and inside those wave you would have to define what times it would begin and end. Inside those waves you could put in a new number for another loop that would define how many enemies would be in it. Here you would be able to define the position for each of those enemies as well as the timing between them.
What it became was a system that was able to be what we needed although maybe a bit to cluttered.
This is something that I want to improve more as it’s not as flexible as it could be but perfectly usable within our group.
Baloo S. Beckman