Download

Dynamic (Procedural?) room generation

I know this has been posted before, and I’ve read through most of the stuff I can find on the subject, but I’m new to UE4, and game programming in general, so I’m going to ask the question regardless.

I’m wanting to play around with some dynamic mesh generation, I guess you could call it procedural generation. I thought I’d start small, and try to figure out how to dynamically generate a single room, with some variance in it’s design.

If you think Binding of Issac, or Zelda on the NES, that’s the kind of room I’m thinking. A single floor, four walls, no ceiling, and a series of doors, facing the cardinal directions (NESW). So for instance the room should create the floor, and then either create a wall, or a wall with a door randomly at each cardinal location.

I’ve been giving it some thought, and from what I’ve been reading it should be doable using f


for loops

and


instanced static meshes

. I’m planning on using the starter content for this, so ideally the wall and wall with door meshes (I don’t have UE4 in front of me so I don’t know their exact names).

Does anyone have any suggestions on where to start with this idea? I’m guessing first create a floor, with a fixed width and length, then on the boundary of the floor, pick either a wall or wall with door at random, orient it accordingly, and that should do it.

Any advice or input would be greatly appreciated.

Thanks

Take a look at this to start, can be convert to 1st / 3rd person. should give you idea to get started.

https://youtube.com/watch?v=IW3kS6TBqPY

Narg

Thanks Narghile, I’ll take a look.