Modding Help Having issues spawning microdungeons built using Tiled

Discussion in 'Starbound Modding' started by Aegonian, Apr 20, 2016.

  1. Aegonian

    Aegonian Weight of the Sky

    Hey there!

    I'm building a couple of new microdungeons for my Avikan Race Mod, but am having a lot of trouble getting them to spawn in and I have completely run out of leads to follow as to why they won't spawn. Here's the situation:

    I've built a couple of new, small microdungeons/random encounters in Tiled, making sure that the placement of anchors matches that of existing vanilla microdungeons. The layers are correctly named, and everything is placed in the appropriate layers as well. Everything seems to check out, but for some reason the microdungeons won't spawn when using this patch file for the desert biome:
    Code:
    [  
        {"op" : "add",
            "path" : "/surfacePlaceables/items/-",
            "value" :
              
          {
            "mode" : "floor",
            "priority" : 2,
            "variants" : 1,
            "distribution" : "/biomes/distributions.config:mainBiomeMicrodungeon",
    
            "type" : "microdungeon",
            "microdungeons" : [ "avikanencounter2" ]
          }
              
        }
    ]
    The thing is, this exact piece of code DOES work for a microdungeon I created in the old .png dungeon system, so I don't believe there is anything wrong with the patch file.

    I have created multiple larger dungeons (villages etc.) in Tiled, and I've managed to spawn these successfully by patching them into the terrestrial_worlds.config. To make sure that my .json microdungeon files are not to blame, I've done a few tests and tried to spawn my microdungeon using the terrestrial_world.config - and this actually worked. My microdungeon would spawn, but it would replace the larger dungeons. And as microdungeons don't have connectors to connect the different pieces, this causes the game to only spawn a single encounter, so this isn't a solution, unfortunately.

    I'm running out of leads to follow now, so I'm asking everyone with experience in Tiled and dungeon spawning if you might know something I've overlooked:
    • The starbound.log has no errors in it, so debugging this issue is a pain
    • The biome patch file works for a microdungeon I built in the old .png system, so the patch file works, but it doesn't work when using it to spawn in the microdungeon I built in Tiled
    • I am able to spawn in custom Tiled dungeons using a patch to the terrestrial_world.config
    • Using the terrestrial_worlds.config to spawn in my microdungeon works, so the dungeon file and the .json files both seem to work
    • Trying to spawn one of the large dungeons using a biome patch doesn't work (i.e. trying to spawn a 'large dungeon' as a 'microdungeon')
    • Replacing the 'avikanencounter2' in the biome patch file with a vanilla microdungeon successfully spawns that microdungeon in my chosen biome, so the patch file works
    • Intentionally inserting a faulty line in the avikanencounter2.dungeon file (renaming 'parts' to something else) DOES make an error appear in the starbound.log (JsonException) No such key in Json::get("value"), so the dungeon file is actually being loaded, but for some reason never placed
     
    Last edited: Apr 20, 2016
  2. foxtails

    foxtails Master Chief

    We're you able to find a solution to loading a large dungeon?
     
  3. Aegonian

    Aegonian Weight of the Sky

    I did quite a bit more testing, and it seems that the issue was mostly the size (in world spaces) of the microdungeon: Starbound appears to be having issues finding a suitable location to spawn larger microdungeons. I created a new entry in the distributions.config (in the biomes folder) with a very high spawn chance, which made the large microdungeons spawn on rare occasion, but they aren't as common as they should be yet.

    I haven't tested if 1.0 has changed this at all, but the best solution so far seems to be to reduce the size of the microdungeon. There is one thing I just thought of which I haven't tested yet though: vanilla microdungeons have a number of 'anchors', which tell the game where there should be ground and/or air in the generated terrain, and these are usually placed in all of the corners of the dungeon file. If the microdungeon gets bigger, the distance between these anchors becomes larger, so there will be fewer places in the generated terrain which match the anchors placed in the dungeon file. Perhaps reducing the number of ground anchors to just one, placed in the center as opposed to the corners, will make it easier for the game to spawn the microdungeons. I can imagine that they won't fit into the terrain quite as well anymore, though...
     
  4. foxtails

    foxtails Master Chief

    The extra anchor files in miscellaneous were my thoughts as well on a large dungeon solution. Build 1.0 and up has four color options to attach dungeon chunks to its color assigned neighbors.
     

Share This Page