Follow us:


02.03.20 /

fully procedural level generation


How does it works ?

The dungeon of every game is 100% fully procedurally generated so the player have a different experience every time. It also adapt the dungeon size, floors and treasures number to the number of players in the game.

How was it made basicaly ?

It would be quite long and take a pretty big post to explain everything in details, but basically it work with "chunks" of 4m². Here is an exemple of the code process :
- Define the max map zone, let's say (width : 40 chunks, length : 40 chunks) (witch is in the game (40*4)² meters.
- generate a random room zone with random dimensions in the max map. Let's say something between 2*2 and 5*5 meters.
- Generate as much as you want random rooms in a for loop and check for each room that they don't overlap.
- Link all the room with corridor but don't forget to check that they are all linked in a way or another to the spawn so you won't have a group of three rooms connected together but detached from the others.
- Now that you have the zone, just fill the room with walls, ceilings assets and everything you want !

Ecrit par: BillBoy

I'm one of the three creators of The King's Thieves and the developper of the game.