Procedural Random Map

Hey everyone, I am looking for some help and advice.

For this multi-player game i’m working on. I came up with the idea of randomly changing the level each time a new match starts. To better explain; each time you play a match something in the environment is changed.

  • E.g. one door that leads to the enemy base that once was open in the previous match is now locked, barricaded by rubble, or the door was facing the North end of the wall is now facing the South wall.

  • A steel door that can only be taken down by a rocket launcher is now an old wooden door.

  • The previous match had 4 tanks in the armory, now, there are only 2 Jeeps.

I believe I got my point across?

How much of this is possible without having to touch C++? I want to use blueprints as much as possible.

If there are parts that can’t be without touching C++…Want to join a team? :smiley: :D…
But seriously though you’re help will be very appreciated.

Hm, sounds easy enough :), thank you for your response…Is there anything else I should be aware of? Like I heard that the lighting and collisions/paths need to be rebuilt each time this is executed. Will that have a large impact on performance?

Hey guys. I am the project leader of the aforementioned game. Just wanted to expand a bit on the thread. Would it be better for us to rebuild all possible map permutations as the game is compiling, or should the game assemble the maps and rebuild everything while the game is running? Furthermore, does anyone have any advice on how to go about accomplishing either one of those approaches?

I’d do it as part of the map load. Basically build out several pieces for the part that’s random, leave that space empty except for something to let you know the location, then just spawn your blueprinted piece down based on a random value. Do that for each place in the level, and you’re good.

Procedural generation is quite doable in blueprints. Everything in my map generator is blueprint.

If everything is procedural, you can either spawn the map on load, or do it one section at a time as you play through it… really depends on how big the map is, what systems the game is running on, etc. There is also level streaming, but I don’t think you can currently procedurally spawn things into a streaming level, but maybe that will be possible when Epic finishes the world browser.

Asking how you can do this procedurally is pretty broad as there are many ways to do it, but if you have more specific questions I may be able to help.

I did this with UDK not with UE4 yet. You should be able to use a random node that leads to a variety of choices. You could place the various doors or debris in the places needed, and then the randomizer would decide which is on, everything starts off. You might use matinee to animate things, open or closed depending on a random choice, i’ve this. I’ve used Matinee to take one object and animate it in different positions based on a random choice. I’m sure there are other ways to do this.

Nearly everything you describe is doable as a simple swap-out until you get to the part about a door moving from the north wall to the south wall. Something like that takes a bit more planning depending on your map layout. For instance, would moving the door require a hallway to swap sides as well, or is this just a door to the outside world? It’s all still possible, but the complexity would increase if one change would require a series of other changes to fall into line.

To give you an idea… For basic one-room buildings, they could easily be procedural if designed for that purpose. You could create four side meshes with the same dimensions, yet different features (one with a doorframe, others with windows). Store all the sides in an array and pull from that array when generating the room. And each side could be its own Blueprint that would then pull from an array of its own to choose a door-type from the door side or window-types from the window sides, etc. The doors would be Blueprints as well, which would generate locked/unlocked, opened/closed states as well. Essentially, nested levels of random generation starting with the basic wall layout.

The tanks/jeep thing is a simple spawner that pulls from an array of possible objects when the level is generated.

I was thinking of a game relatively similar to that. I will share the other details in private, but I like were this is going.