For those unfamiliar with the term "procedurally generated game", this simply refers to a game in which the levels have not been designed and packaged with the game. Instead, the levels are generated each time they are loaded. A lot of care has been taken to make sure that the levels in Couch Heroes vs The Dungeon are not “random” but in fact follow very specific rules on what actually should make up a level.
One of the common issues with procedurally generated games is they can sometimes feel monotonous if the programmer has not taken great care to keep the game interesting. We decided that our primary means of disrupting the monotony would be to ramp the levels in difficulty to make the game more and more interesting the further into the dungeon you go. When you consider that a procedurally generated game has an infinite amount of levels, it can seem like a very daunting task to try and program a difficulty ramp. As you will see in the following steps, the key is to keep it as simple as possible at first.
Start With A Minimal Amount Of Variables
Just like our philosophy with all programming, it is best to start as simply as possible. Begin with the bare minimum amount of variables that you believe you can ramp in order to make the game more difficult. Instead of trying to tackle an infinite amount of levels from the beginning, we decided to really focus in on the first 20 levels to establish the ramp. For Couch Heroes, we decided to start with 3 variables:
QUANTITY OF SPAWNERS
In a complete guess-and-check fashion, we varied the number of initial spawners on level 1 until we felt that we got enough coverage on the map that you would at least encounter some creeps on the way to exit, but not so many that anyone should not be able to make it past level 1. We followed a similar technique on level 20, but this time we assumed that a player all the way at level 20 should face a significant challenge to reach the exit. Once we established this value we just created a linear ramp that could be followed for all levels. We, of course, had to put a cap on the maximum number of spawners for both performance reasons and so that no level would ever be impossible to beat. All spawner locations are completely random, but do take into account the location of everything else on the map so they are not placed on top of anything else.
TYPES OF CREEPS AVAILABLE
From our initial game design, each creep type has a specific amount of hit points required to die, so I started by ordering them from easiest to hardest. There are 14 total creeps and we decided to introduce them to the game one at a time. So in designing levels 1 - 20, we picked 6 random levels that would not get a new creep introduced. Each level also has access to each previously introduced creep. As a starting point, we made it completely random as to which creep type would occupy each spawner position.
WHETHER OR NOT THERE IS A REVIVAL TOWER
As a starting point, the revival tower was removed from the 6 levels that did not get a new creep introduced.
Be Conscience Of The Audience You Are Building For
At the project kick off meeting for Couch Heroes vs The Dungeon we made a decision that we were going to build a casual game that anyone would be able to jump right into and require very little knowledge to be able to play. It was important to keep this in mind in designing the level ramp because we are not designing for people that will dedicate countless hours to mastering the game; instead we are focused on people who will hop in and play for 30 minutes to an hour per session just to unwind or pass some time. Knowing this, we could not design the level ramp to make the game too difficult too quickly, because our casual gamers would get frustrated because they are not willing to spend the time to become an expert.
Iterate, Iterate, Iterate
As it goes with anything when you use the guess-and-check approach, we were not correct with our initial ramp. The game was way too easy. One tester made it all the way to level 16 once without firing a single attack and just sprinting for the exit. It was concluded that more variables were needed.
INITIAL CREEPS SPAWNED ON LEVEL LOAD
Originally, no creeps were spawned until just shortly before the spawner was visible to the player. This made it so that you could just sprint right past the spawner and the creeps would not have a chance to catch you. We corrected this issue by spawning a set number of creeps immediately when the level loads. Similar to the quantity of spawners, we established a linear ramp for this number by guess-and-check on levels 1 and 20 and by putting a maximum cap on the number for the same reasons as before.
This change was exactly what we needed to get the difficulty right where we wanted it for levels 1 - 20. Now, at level 21, we decided that we needed to add in some additional difficulty to make the game really challenging for the dedicated players that managed to make it this far. We are still using the same ramp on the previous variables, but with the maximum caps, the game starts to level out. For our next iteration, we decided to start varying the rate at which the creeps would spawn starting at level 21.
CREEP SPAWN RATE
We left the spawn rate constant for levels 1 - 20 because we had already zeroed in on the difficulty that we wanted to achieve. We decided to spend the next 15 levels or so ramping up the spawn rate all the way to the point that it matches the player attack rate. What this means is that, at a certain point in the game, you will no longer be able to stand directly in front of spawner and just keep shooting creeps and hope to ever destroy the spawner. As soon as you kill the creep directly in front of the spawner, another creep will be spawned. Once you reach this point, it will be necessary to be able to shoot and maneuver simultaneously so that you can side step a creep to get a clear shot at the spawner.
While this addition most of time made the game significantly more difficult in the higher levels, we discovered an issue with one of our assumptions for the ramp. We originally decided to randomly choose a creep type from the list of available types. While this worked well in the lower levels, there were plenty of occasions on higher levels where we would get a lot of small skeletons (the easiest creep) and very few large dragons (the most difficult creep). So for our final iteration, we changed the probability of getting certain creeps in levels starting at 21.
PROBABILITY OF EASY/DIFFICULT CREEPS
To start with, we separated the creeps into 2 groups: easy and difficult. Starting at level 21, we start ramping up the probability that a difficult creep will be selected over an easy creep. We ramp this slowly all the way to 95%. So, by the time you reach the 40’s, there is a pretty small chance you will ever see a small skeleton again.
Designing around these 3 keys will get you well on your way to designing a good level ramp for a procedurally generated game. However, you should keep in mind that item 3 does not have to be finished even after releasing the game. We are currently working on a set of updates for the game which will include an additional variable in the level ramping. We will be varying the size and shape of the map as well. Larger maps will make it more difficult to locate loot and find exits. We will also be manipulating the shape of the map in higher levels to make it more difficult. With a square map, there are a lot of different paths that can be taken to get to the exit. However, with a more rectangular map, players will be guided down a more narrow path and forced to interact with more creeps.
Apple, Apple TV, Siri Remote and tvOS are trademarks of Apple Inc., registered in the U.S. and other countries. App Store is a service mark of Apple Inc.