fnar / minecraft-roguelike

This is a mod for minecraft that adds randomly generated dungeon complexes.
GNU General Public License v3.0
13 stars 9 forks source link

Custom Rooms #66

Open Steven11q opened 2 years ago

Steven11q commented 2 years ago

Is there a way to define a custom room and add it to the generation of a custom dungeon? Im trying to make a replacement strongehold for my pack and Id like to make an end portal room for a custom dungeon.

fnar commented 1 year ago

Probably super late on this, but it's a work in progress. 😀

Steven11q commented 1 year ago

Alright, Thanks. Is there any more information you could give me about it in the meantime?

fnar commented 1 year ago

Sorry for the delay in response. I'm still designing the feature, and I'm open to feedback. I wish I was aware of a Minecraft standard for custom room layout and block specifications, like Recurrent Complex.

In the meantime, here's what I'm using internally (unsure if you can read Java). https://github.com/fnar/minecraft-roguelike/blob/master/roguelike-core/src/main/java/com/github/fnar/roguelike/worldgen/generatables/thresholds/Doorway.java#L26

The central premise is that users will create symbol -> block maps. I'm not sure if I'll require this to be in JSON, .ini, or how this will work yet textually, but the idea is that a user will specify something akin to:

Block Map

block map = {
  ".": "minecraft:air"
  "#": "minecraft:stone",
  "D": "minecraft:oak_door",
  "L": "minecraft:log2",
  "~": "minecraft:water"
}

Room Definition

A series of block layers, with 0 being the base relative to where the room would generate.

{
  0: [
    "###",
    "###",
    "###",
  ],
  1: [
    "###",
    "D~D",
    "###"
  ],
  2: [
    "###",
    "D D",
    "###"
  ],
  3: [
    "###",
    "# #",
    "###"
  ],
  4: [
    "###",
    "# #",
    "###"
  ],
  5: [
    "###",
    "###",
    "###"
  ]

There are still many problems with this approach, such as specifying which block is central to generation, specifying entrances so that hallways know where to connect, how to provide optional generatables and variance, and the general community's comfort with, for example, JSON.

I'm open to feedback if you're accustomed to anything else.