Dungeon Generation Problems

Hello all! This has been kicking my butt for a long time and I am now completely done with trying to figure it out myself. I need your help with a problem of mine. I’ll start by explaining what is wrong and what needs to be done.

What’s wrong?
For my game, I require a system that will attach pieces (modules) together to create one huge level/dungeon. Each piece that I have is a blueprint. Here is an example of how one piece is setup just to give an idea of how each piece is made. This piece is a simple tunnel piece. I have other pieces as well.
The red arrows on each module represent points where other modules can be attached. Modules are derived from a class I created in C++. This class has a method that will align a module with an attachment point and rotate it to match up. I know part of the code needs to be corrected too. I’m really tired and was wondering if anyone could possibly correct the following code:

/* Aligns this module with the specified module's attachment point.  */
void AModule::AlignWithAttachmentPoint(int32 UsingAttachmentPointIndex, UActorComponent* AttachmentPoint, bool bDebug)
	bDrawAttachmentPoints = bDebug;

	UArrowComponent* ThisAttachmentPoint = Cast<UArrowComponent>(GetAttachmentPoints()[UsingAttachmentPointIndex]);
	UArrowComponent* OtherAttachmentPoint = Cast<UArrowComponent>(AttachmentPoint);

	if (!IsValid(ThisAttachmentPoint) || !IsValid(OtherAttachmentPoint))

	SetActorRotation(FRotator(0, OtherAttachmentPoint->GetComponentRotation().Yaw, 0));


This code is supposed to move and rotate the module so that both attachment points match up but it’s definitely not right. I used a temporary hack just for testing, but now I need it to match up correctly no matter what attachment point it’s connecting with. For example, this module has three attachment points:

Aligning this module’s first attachment point (left arrow) with another should result in the whole module rotating and moving to look like this:


Aligning this module’s second attachment point (middle arrow) with another should result in the whole module rotating and moving to look like this:


Aligning this module’s third attachment point (right arrow) with another should result in the whole module rotating and moving to look like this:


Modules can be combined to make a level.

In Daylight, each section of the game is procedurally generated. Though, I’m not sure about how much of it is exactly. I noticed that many rooms look the same which gave me the idea to use separate blueprint pieces and combine them to form a maze.

What needs to be done?
As I stated earlier, my game requires a feature that is able to take these and generate a huge dungeon using them. I thought I knew how to go about this (using Recursive Backtracking to generate a maze), but I guess this was not the right way. I am at the point where I’m about to explode. I feel as if I have been searching for a solution for ages. Any ideas?

Here’s an example of what it would be like, except it will be larger:

bump :slight_smile: