Dungeon Generator for Dungeons and Dragons
The production
“Mission” generation
First, a setup of rooms needed to be made. All rooms are generated and each room gets one pillar (combat, social interaction and exploration ) associated with it. The rooms are sectioned in four difficulties. Each room then gets connected to another room in the same difficulty category and then the difficulty sections are connected to each other with two rooms as well. This method is based on mission vs space generation where my first goal was to generate a sketch of the “missions” first and then lay them out in a scematic manner. This way I could quickly see how much of everything I would have and how everything was layed out. Later I would focus on the space and actually generate the content with the relevant “mission”. How the nodes connect is more just random connections as I wasn’t dealing with many nodes in each different section (Daniel Karavolos, 2015).
int difficultyAmount = 4;
List<Node>[] nodeSections = new List<Node>[difficultyAmount];
GenerateNodesForList(nodeSections);
for (int i = 0; i < difficultyAmount; i++)
{
// Connect sections (section 0 is the beginning, doesn’t have one before it)
if (i > 0)
{
difficultyNodes[i][0].ConnectSectionsAtRandom(i - 1);
}
// Connect other nodes.
for (int j = 1; j < difficultyNodes[i].Count; j++)
{
// Index can't be higher than current node with j
int random = GenerateRandomInt(0, j);
difficultyNodes[i][j].ConnectNodes(difficultyNodes[i][random]);
}
}


