Dungeon with multiple randomly generated rooms

Started by MyDev1 on

Topic category: Help with modding (Java Edition)

Last seen on 12:10, 8. Feb 2024
Joined Aug 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Dungeon with multiple randomly generated rooms

Hi, I want to create a dungeon with multiple rooms using procedures. It should generate rooms randomly that form a meaningful path. I've already built the rooms and imported them into MCreator with structure blocks. Can someone provide me with an example procedure that fulfills my requirements?

 

Sorry if my English isn't that good :)

Last seen on 20:43, 20. Aug 2024
Joined May 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is more complicated…
Sun, 09/24/2023 - 16:58

This is more complicated than you might think, but it's not impossible. You could do this entirely using procedures, but speaking from experience, this can get very complicated very quickly, and may not be the best solution.

The better solution is to use blocks, (either the built in jigsaw blocks, or your own custom blocks), to place structures automatically based on their surroundings. For a simple example, you could make a structure with multiple rooms, but instead of building each room, build the rooms separately, then make a block that rotates and places rooms at random, and put this in your structure.

I, for example, designed a dungeon with a central room, and four rooms on each side. The structure itself is a single custom block, that, when updated, randomly selects a central room for the dungeon, and places it in the world. This central structure then has four more custom blocks on each side that randomly choose and place each of the side rooms. Then another block in the middle of the dungon randomly ruins blocks, adds cobwebs, and other additional details, making each dungeon unique. You can extend this principle to far, far more complicated structures.