Creating tools for Designers

When working on a project with designers, it is important to create tools for them to use when designing levels. This makes it a lot easier for them to design your levels and saves them from using needless energy when crafting level after level when you could have spent a little time crafting some small features.

In my most recent project EGONE I failed to do this and the designers on my team had to spend more time than desired when making levels for our game. This was unfortunate and could have been avoided with a simple level generator. With a little bit of maths implemented in the right way, designers could have had a much easier time and a lot more time to spend doing other things rather than placing objects through an empty game scene.

20170503_094238.jpg

After discussion in class, we came up with an idea for how I could have made it easier for designers working on our game and that was to create a level generator script. This script would place certain items throughout a game scene, making a random level. Certain things in this level would be able to be changed by designers to better suit their vision for the game. Ideally, the list of variables that designers would be able to edit through this script are:

  • Width of Ramps
  • Height of Ramps
  • Ramp Offset
  • Obstacle Item Select
  • Obstacle Item Offset
  • Distance between Ramps
  • NPC Offset

The level would load in with random values for each of these but each would have some sort of limit to stop certain elements from going out of a specific range. This would also be controlled with an input from a designer. If the designer did not input a range then it would set to a default instead. Each individual variable would have it’s own default range that could be changed if need be.

To start with, the level would need a script that retrieved all the different prefabs that you would want throughout the level. Any and all of them. Ramps, Bins, Dogs, Pits, Benches etc. The level would then create a level, placing these Prefabs on a sort of anchor point along the X axis to help keep everything at the same level. This would not be done completely random however. The script would look something like this (The following is pseudo code) :

  1. Get the Ramp Prefab
  2. Get NPC Prefab
  3. Get a list of prefabs and put them into an array [].
  4. Add a random clamped number of ramps to the scene at (0, 0, 0)
  5. Get the length of these ramps to calculate the distance that they need to be placed apart and add a small random sized gap in between. This random gap should have a range that is not too big or too small.
  6. Add a random “Yes or no” condition that either does or doesn’t place a prefab from your array after a ramp. Make sure this the prefab can be chosen/changed, relocated and removed/placed by the designer. This prefabs width will also be added to the calculation for distance between ramps.
  7. Get the starting point, add all prefab lengths within your level together and get the total length of your level.
  8. Randomly generate a clamped number of NPC’s that will populate you level. This should be something the designer can change.
  9. Ray Cast to the level and place NPC’s on the ground using math that calculates an even distance apart from each other NPC while taking into account the total length of the level to keep them inside the level. From the ray cast you will get the rotation that the NPC needs to be at and the position on the Y axis it is needed to be placed. Where the NPC is placed should be editable for the designer.
  10. At the end of your level length, create an end point where the player will finish your game. Make sure that if the designer wants to edit the position of the end point, they can do so.

With all of this, you should have a basic level generator that designers can change to fit their ideal design needs. There is one thing that would make a big difference in how the level is designed and this is Lower 2 Angles of the Ramps (Trapezoid). If these were given random angles, this would welcome different levels of customization within you game. The designer would be able to change the incline and the decline of each ramp if need be as well. This could create a rapid decline like a drop at the end of a ramp if the angle was given a value of 0.  With ramps like this, designers would be able to make use of the “Pit” within our game a lot easier as well. For example. If the designer wanted a Pit after a ramp then using the math of trajectory, the level script should be able to calculate the maximum distance the player can jump with the given ramp. You should then be able to create a difficulty curve based on the current level as to how close to this maximum distance the pit actually is to give the player an increasingly difficult game play experience. It would play out a little bit like this (Pseudo Code):

  1. Get the lower right angle, height and length of the ramp to calculate where the top right point of the Trapezoid (Ramp) is.
  2. Use the top right point, speed of the player and gravity of the world to calculate the maximum trajectory of your player.
  3. Resize the width of the pit that comes after the Ramp according according to the outcome.
  4. Create a difficulty curve based on the current level as to how close the pits size is to it’s maximum distance.

This is a bit of maths that needs to be done but if implemented right it will save your designers a lot of time as it will take out the need to play test every ramp to see if they can make a jump and also automatically adds a level of difficulty to the level that can be changed by the designers as well.

Creating easy ways for designers to create levels is one of the most crucial things when it comes to creating a game. If a designer finds creating/editing your levels too difficult or stressful then they will be less motivated to pump out well thought out/designed levels and instead give you half baked crap and call it a day.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s