Contact Info / Websites
A spawning system that keeps our game interesting [p1]
For those who have played 15 min Max (http://www.newgrounds.com/portal/view/641800) will be aware that the rooms in the game are spawned randomly, however, this is not entirely true.
The spawning system for the rooms in 15min Max is a bit more complicated! The spawning system for 15min Max works by unlocking room types, this is done so that the player has to pass certain room types in order to play others. This was also done to make it easier for the player to get used to the room types.
In this blog post I will go over the spawner and in the second part I will also provide some (pseudo) code for the spawner and discuss it.
Unlocking room Types
With 15min Max we wanted to have a ‘random’ spawner for the rooms, but not entirely random, we wanted to have some kind of system in which you had to ‘unlock’ room Types in order to get other types.
What is meant by this is, in 15min Max, when you play for the first time, the only room types that can spawn are the‘JumpRoom’ & the ‘SlideRoom’. And after compleing both of them, you can unlock a new (random) roomType. This is more clearly explained in the image below.
And after you have unlocked a (new) room type, the spawner can spawn a room randomly within the unlocked room types. So at the start the spawner can pick between Jump & Slide, after that between Jump & Slide & Drop (for example) and so forth.
So besides that we have the unlocking system, we also have different ‘levels’ for rooms. This is done to keep the game interesting and to give the player a good challenge. So the way that the room levels work is that; each room has a ‘minimum room score required’ and a ‘maximum room score required’. The ‘room’ score is the amount of times that that room type has been finished by max.
So for example: Jump room level 1 could have a minimum score of 0 and a maximum of 2. So then when you manage to finish Jump room 2 times, your score for the Jump room will be 2. Then when the spawner wants to spawn a Jump room, it should spawn Jump room level 2, which has a minimum score of 2 and a maximum of 4, because you then have a score of 2 on the Jump room.
But for the other room types, your score could still be 0, so that means that the spawner will only spawn a level 2 room for Jump, but not for Slide, Drop & others.
We also have an additional manual ‘level’ setting for the rooms. But I’ll get into that later.
The ‘Override’ Spawner
Eventhough that the current spawning behaviour seemed to work pretty well, there was another problem. It was really hard to test certain rooms (for example if we wanted to test Jump 4 how would we ever do that?). So in order to solve this problem we made an additional spawner, which has the same basic behaviour of the original spawner but some behaviour is overwritten.
So that means we have three spawners; one base spawner, one normal spawner which overrides some behaviour of the base spawner and one override spawner which overrides some behaviour of the base spawner.
And the override spawner does the same as the normal spawner, but then you can select which ‘room type’ you would like to spawn and at what ‘level’ it should start. And when Max passes a room, the level is just counted up so that the same room is spawned, but with the next level. This is shown in the image below.
So that’s pretty much it for this post, In the next post I’ll go over some pseudo code so that you can get an idea of how this actually works. You can follow us on twitter: https://twitter.com/Duckbridge to stay updated on our next blog post