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"

Generate Level with Conditions

Hello!

I'm currently working on a project that spawns rooms "procedurally" where I have a spawner that picks a random room within an array. What I need to be able to do is condition the spawning a little, to where if a specific "door" room spawns, it can't be spawned anywhere else. As of right now I have a whole different set of rooms dedicated to being "door" rooms, but I'm wondering if there's a better way of doing it.

There are also "key" rooms that spawn a key to open the door. However, I need to be able to spawn the key that corresponds to a specific door.

Essentially, I need to spawn a random door in a level and the key that spawns in the level needs to match it.

Product Version: UE 4.9
Tags:
more ▼

asked Sep 11 '15 at 01:46 PM in Blueprint Scripting

avatar image

Halokllr
13 2 2 10

avatar image Erasio Sep 11 '15 at 01:58 PM

Just to get the right idea.

Is this for something like "The binding of Isaac" or "Temple Run" regarding the generation?

Because if it's more like the binding of Isaac it's probably worth to just do it via a form of maze algorithm in which it's rather easy to place a door and then a key in the area in front of the door which references the door and just opens it on pick up (or at least triggers it somehow meaning it will open the next time you get near).

The advantage is simply that you have the whole maze in front of you while generating it making small modifications a lot easier especially with this kind of partial generation where you "just" pick rooms meaning it will be a decent experience regardless how exactly they are placed.

avatar image Halokllr Sep 11 '15 at 02:47 PM

I think it's more of a "The Binding of Isaac" type of generation. I'll include screens to get a better idea of what's going on.alt text

spawner_bp.jpg (485.5 kB)
avatar image Erasio Sep 11 '15 at 04:40 PM

The real question is: Does it generate whole segments or bit by bit during runtime?

avatar image Halokllr Sep 11 '15 at 04:51 PM

It generates whole segments. Each of those spawners spawn a 400x400 room, and the rooms generate the furniture locations at runtime. It's essentially an escape the room-style game where the rooms are generated at random so it's not the same exact puzzles over and over again.

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

0 answers: sort voted first
Be the first one to answer this question
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