x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Random Room Generation

I would like to make somthing similar to Binding Of Isaac as a school project. I had the idea to make about 50 levels, and then in the main level, randomly select from one of those when the player walks into the next room, but keep in memory those, which are already loaded. Is there any way to do that? I suppose I should use level streaming, but how to do the random part?

Product Version: Not Selected
Tags:
more ▼

asked Nov 08 '14 at 12:03 PM in Blueprint Scripting

avatar image

SethPDA
30 5 9 13

avatar image Omberone Nov 08 '14 at 12:16 PM

What you're asking is a pretty general question. If your query is how to randomize levels, then what you're after (I'm assuming) is some sort of procedural generation? Do you want to create actual levels (as in seperate .umaps) or just content within the current level?

avatar image SethPDA Nov 08 '14 at 12:24 PM

The best way would be to randomize content in the level, for ex 2 monsters, 3 rocks etc.but that would exceed my knowledge on how to do that. The easiest way would be to make a bunch of .umaps and then just randomly select from one of those when the players hits a door trigger.

avatar image eXi Nov 08 '14 at 12:25 PM

If you want to do it like Binding of Isaac, i would begin with square rooms. The reworked game has bigger rooms in it too, but lets leave it to rooms of the same size.

I guess the general idea is to make all your rooms and put them into a list. Then you need a system that tracks every placed room in a 2D Array or something like that. You would need to know where a room is, and where not. Isaac also has a START Room for every floor. So this is the beginning. Than he just puts room next to room with some rules like "Boss Room has only one room next to him + devil/holy room", or "Secret1 room needs to be between 3 rooms" and so on. As long as you have the array that contains the information about all levels placed, it should be easy. You have a list of rooms that need to placed, like itemroom, boss room and a list of rooms that can be taken randomly by just using one of the indeces. If you don't want a room twice, you can just make a 2D array that also has a bool "Taken" and set it to true as soon as the room was used. You just need to check if the random room was taken already or not.

This is my idea about it. The exact implementation is up to you. :D

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

At this time, you aren't going to be able to use random generation with level streaming without going into C++.

You could however use streaming and teleport your player to one of the 50 rooms randomly. You would just have the rooms spread all over your persistent level, but steamed out, and then when it chooses a room to teleport you to it would also call for the room to be streamed in.

As for how you actually do random, that really depends on how random. Doing it completely random is easy, such as random int 1-50 fed into a switch on int. If you want to put some intelligence behind what room might lead to another room it can get quite a bit more complicated(enough for quite a few separate answerhub questions for each problem you run into).

more ▼

answered Nov 08 '14 at 01:22 PM

avatar image

Zeustiak
1.8k 131 68 110

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question