Procedural Difficulty

Even though I’m not progressing much on the coding part of Ace Cargo, I still think about it A LOT.
I’m also drawing some shameless concept art. You may see these drawings in my posts but that’s not the subject here.

Procedural Generation

I was recently skimming through the gold mine that is the Procedural Generation (PG) topic in the TIGSource forum which itself is a must-visit if you are a little bit serious about game dev.
I always considered PG as a very nice discipline to assist the level designer but could also be leveraged to replace level design in specific case. I do believe that PG should not be used at all cost and will never replace clever level design though (don’t get me wrong). PG is like a dark art that needs to be mastered and used cautiously to avoid poorly designed levels.

Current use case

Because Ace Cargo’s levels fit on a single screen and are meant to be simple, I guess I can try to fit some procedural content in their design. My aim is not to fully generate the level but leave some randomness in the position of some of its elements (platforms, collectibles and maybe mother ship).

Going further

While thinking about level randomness, I discovered that this could lead to potentially infinite number of levels in terms of design but that would not cover how the difficulty could ramp up across the game.
This is when I tried to come up with a way to modelize what could make Ace Cargo more difficult and try to play with the right parameters in the game.

Balancing difficulty ramping up in Ace Cargo procedurally generated levels

Create a difficulty index calculated by combining different factors:

  • Gravity of the level
  • Speed of the enemies
  • Rate of enemies generated
  • Drop rate of fuel barrel
  • Number of loot crate to collect
  • Time left to clear the stage
  • Etc…

Each factor has different values that are mapped to a difficulty level:

  • Gravity: the bigger the gravity, the more difficult it is for the player to move and avoid enemies
    1. Gravity = 2; Difficulty = 0
    2. Gravity = 4; Difficulty = 1
    3. Gravity = 6; Difficulty = 2
  • Speed of enemies: the faster the enemies, the more difficult it is for the player to avoid them
    1. Ennemy_speed = 5; Difficulty = 0
    2. Ennemy_speed = 10; Difficulty = 1
    3. Ennemy_speed = 15; Difficulty = 2
  • Etc…

Then across each level, we increase the difficulty level (proportionally or exponentially – depending on the main difficulty level):

  • Level 1: Difficulty = 1
  • Level 2: Difficulty = 2
  • Etc…

Then we randomly distribute the amount of difficulty across all factors
Level 2 (Difficulty 2)

  • Case 1:
    • Gravity = 2 (diff=0)
    • Ennemy_speed = 15 (diff=2)
    • total difficulty = 2
  • Case 2:
    • Gravity = 4 (diff=1)
    • Ennemy_speed = 10 (diff=1)
    • total difficulty = 2
  • Etc…

View all my articles...