How to pick a random map?

What I’m aiming at is you start in a room you open a door at the end and you go to a random room. My goals for this are the same room cant get picked twice in a row, also each room has a random texture.

essentially each room is a map. Would there also be a way to make some rooms uncommon?
Any help is greatly appreciated as I am still somewhat new to UE4. C++ or blueprints.

Take a look at the answer to this post:

you can expand on that logic by having the array of levels and randomly picking an index value within the bounds (length -1) of the array.

You can expand it even further with another array of “Used” indexes. So when it randomly picks an index to be loaded, you loop through the “Used” array list for a matching entry. If it’s found, go back and pick again, if not, add the used index to the “used” array and continue on to loading the level.

Use looping methods appropriate to your logic, for example, you’ll want to have a Loop With Break where appropriate to avoid continuing on your level loading while still technically inside a Loop Iteration.

If you’re aim is not have separate maps (levels) for each room, but generate them “Procedurally”, that will be beyond the scope of a single answer, but with some research… You certainly can do it. There are many great tutorials online for procedurally generating maps/levels that you could gleam some ideas from.

Combine that with the random pulling from arrays suggestion above, and you’ve got one slick concept!

I will give it a go, thanks for the response!