Problems with procedural generation with certain meshes


Author: Christian Romo
Posted on 1/26/20

The part of the game that I was tasked with working on was the procedural generation of the games mine. For the starting process I was just aiming for a very basic start, aka I just wanted to make sure that I could place down an actor and have it produce a random room. I somewhat succeed in doing so but I'm still not fully done. The problem I was running into however, was the act of making sure the meshes would span correctly and look right. This obviously can't stay a problem due to that if we allow the player to walk in and use the room then they'd see a jumbled mess/ incomplete rooms. 

The problem itself was actually  being caused by the meshes I was using. You see each mesh itself has a grid length and width, to be more precise they take up a certain amount of pixels in Unreal and the positioning and rotation of these objects all depends on how big the width and length of the object is. The way my algorithm was setup to spawn the different walls didn't account for the fact that the walls and floor themselves were different pixel widths and lengths. Now there's two different solutions I could have taken to fix this problem. The first being making the algorithm be able to use any combination of widthxlength walls or set it up so that there's just the default size of the walls and floor and make sure the meshes are the same sizes. I opted for the second option since it was the fastest solution. So in the end I chose a wall that was 400x400 and a floor that was 400x400. This fixed the issue of the meshes being spawned in the wrong location and accurately placed them so that the rooms themselves looked complete.  

Leave a comment

Log in with itch.io to leave a comment.