Level Generator – Part III


Level Generator – Part III

In the previous article, we saw how our Level Elements (Element of a Random Generated Level) were built. In this article, we will focus on the creation process itself.


Level generation is done in the following order:

  1. Find the entry point, generate the entrance
  2. Generate the main path to a given exit
  3. Generate secondary path if needed
  4. Record the enemy spawn points of the level for easier treatment later
    • If a mission has started, place the required enemies in the right spot
  5. Place chests according to AI placement (better potential reward where enemies are powerful)
  6. Finalizing touch

Let’s detail all these parts.

Entrance Point

Placing an entrance is the simplest thing. Entrance can be positioned on the grid extremity, or at center.

Building the main path

Now, we select an exit point on the entrance mesh. This will be the start of our main path. The main path connects the entrance and the exit of the level, it is the one sure path to the end area. In order to create that path, we check the Level Design parameter file:

In the previous article, we presented these main parameters:

  • Number of rooms in the level
  • Amount of Corridors, Stairs Up, Stairs Down
  • Maze Factor of the level – Is the level supposed to look like a straight corridor or a maze
  • Maximum size of each room
  • Maximum level of each rooms
  • Remember that our Level Element also has parameters, used during the generation, such as Frequency or Level. (see our previous article)

According to all these parameters, we will select and place Elements in our Level. When the maximum size of the level is reached, an exit point is selected. The boss of the level, is exists, will have high chance to spawn in here.

Building secondary path

Our Level Element may have several exit, and since we only generated the main path, most of the Level Element exit are still empty. That’s why we have a Secondary Path option.

Secondary paths will generate alternative path, usually not leading to the level exit. Usually, long alternative path will feature a nice reward for players who enjoy exploring our levels!

Each Randomized level have a secondary path min and max values, defining how long these secondary path should be: Of course if it is a long path, the reward will be even better.

Enemies and Furnitures Spawn Points

For performance reason, we don’t want to spawn all enemies in the beginning of the level. We will spawn them once a player is close enough, so we need to record all possible spawn points. We noticed that physicalized object, such a Destroyable Object also took a lot of resources if they were all loaded on the same time, so we will spawn them just like we spawn enemies.

It is also important to record where we want mission objectives to spawn. We do it at this phase.

Finalizing touch

This is an important part, which add some important visual and gameplay attribute to the level. We will describe it in a future article.

That’s it for today. In the next article, we will show the finalizing touch of our level !

About Daniel


  • Paul
    Feb 16, 2015 @ 19:18 pm

    Great stuff! In the “Building the main path” section, it says, “The boss of the level, is exists, will have high chance to spawn in here.” Is that supposed to be “The boss of the level, if it exists…” or does every level have a boss?

    I’m also curious if the game will have an over land part or if it will be like Diablo 1, the Fate series and Torchlight 1 that had a small town/base of operations from which the player enters dungeons?

    Anyway, it looks great and I look forward to playing it.


    • Feb 16, 2015 @ 22:44 pm

      Hi Paul !

      Every level may not have a “boss”, for example, we may want the player to several stage before he actually meet the boss.
      Also, Boss spawning is dependant of the current mission.

      About your second question, we also have outdoor action, and we plan to have at least semi randomized area for outdoor levels 🙂

  • Mar 4, 2015 @ 20:15 pm

    Great stuff idd. Can’t wait till u get to the skill tree/skills/gear part, love that stuff.

    Btw is this looking to be a 2015 release/beta/alphas? or a later date perhaphs?

    • Mar 29, 2015 @ 19:28 pm

      There will be a playable version this year 😉
      Stay tuned, more announcement soon! 🙂

  • Mar 28, 2015 @ 22:30 pm

    Will you have a hard coded limit on minimum level size to discourage exploitive 1 room boss farming?

Leave a comment

You must be logged in to post a comment.