One major aspect of roguelike games is the leveling system. While generating a random dungeon, you have to decide which XP level will have each spawned creature and what amount of gold or what kind of items this dungeon will contain.

In TCOD, the world is divided into regions. Each region has a static XP level defined when the player enters it for the first time. There are different approaches to decide how the region XP level is defined.

Static XP level

With this algorithm, each region has its XP level defined during the game initialization and it never changes. The regions near the player starting spawn point have the lowest levels, and the level increase as you move away from it. This is the approach used in most mainstream MMORPG like World of Warcraft or Guild Wars. 

The main advantage is that the player progression in the world is limited by its own XP level. If he goes too fast, he will rapidely face creatures that are much more tough than him.

The drawback is that the player must travel through a predefined path, following the regions in ascending XP level order. In the following picture, the blue region is the player's starting position. The numbers represent the regions XP level.

To have a smooth gameplay experience, the player need to travel through regions of ascending XP level, following the black arrows. If he tries to follow the red arrow, going from region 1 to region 3, the game will be much more difficult (if not impossible). Even if he succeed, its character will have progressed to the point where going to region 2 is no more interresting. The game would be too easy and the rewards too small.

Thus, this algorithm is not adapted to TCOD where the player can go in any direction from its starting point.

Auto leveling

This highly controversial approach has been used in The Elder Scrolls IV : Oblivion. In consists in dynamically defining the region XP level so that it always match the player's XP level. Whatever path he follows, he will always find opponents adapted to his current level.

path 1

 path 2

Even better, if the player comes back to a previously visited region, the region level is increased so that it is still adapted.

The main advantages :

  • the player path is not restained. He has a total freedom of movement from his starting point.
  • the player will never find too easy, uninterresting dungeons.

But there are also drawbacks :

  • the player can go anywhere in the world, even if he's still at XP level 0. This prevent the game from having a plot with a final dungeon with maximum difficulty. With this algorithm, you can only have 'sandbox' games. This is even worse for the 'explorer' type of gamers, who will be able to discover 100% of the world in a very short time.
  • the player may lack of motivation to discover new parts of the world since he knows that the creatures/rewards are the same everywhere. He could as well stay in the starting region forever.

Moreover, hardcore gamers may like to have tougher opponents. You can always put a global difficulty level in your game options, but the first algorithm is more flexible since the player can follow the safe path when he feels not too strong, and go to a more difficult dungeon if he wants to take on some tough mobs.

TCOD smart leveling

I don't know if this algorithm has already been used in another game. It tries to combine both previous algorithms to get all advantages and no drawback !

Each time the player enters a new region, the region XP level is calculated with the following formula :

regionXP = MAX ( previousRegionXP + 1, playerXP )

If the player rushes without leveling, the left member will be used. Thus, the first region he will enter will have level 1, the second, level 2, etc... and he will rapidely be stopped by increasing difficulty. We have two advantages here :

  • the player progression is limited
  • hardcore gamer still can go a bit forward to meet higher difficulty

On another hand, if the player stay a long time in the first region, reaching XP level 2, he won't find uninterresting dungeons in the next region. The right member will be used and the next region will adapt to his level.

  • at whatever speed the player travels, he won't find too easy, uninterresting dungeons.

One last point : with this formula, you cannot upgrade the level of regions that have been previously visited as with the second algorithm, else a rushing player that has gone too far will have no means of going back to a lower level region. Thus, the player is intended to go always forward, and never go back to previous regions which will have levels too low to be still interresting.