Simplex Terrain Generation

Simplex Terrain Generation

918k Downloads

Disabling Traverse variant biomes causes crash

TrueCP6 opened this issue ยท 3 comments

commented

If the weight of any of the variant biomes in the Traverse config file is set to 0 or they are disabled, Simplex crashes when attempting to generate the world. This problem does not occur with default terrain generation. I am unsure if this is a problem with Simplex or Traverse so I have posted this issue to both repos.

crash.txt

commented

0.7.2 seems to have fixed the crash, but left an extremely strange issue in its place. Non-variant disabled biomes still continue to generate while disabled variant biomes do not. Other biomes seem to take the place of these "missing" biomes. Land can generate as minecraft:ocean and as a result ocean structures generate on land.

commented

I've investigated the issue a bit and I think I know what's going on.

  • Disabling the biomes in the Traverse configuration means that they are not registered with the Fabric Biomes API.
  • This has a few side effects, including the biomes never being added to the BuiltinBiomes ID map.
  • SimplexTerrain has no way of knowing that these biomes are disabled in the Traverse configuration, and assumes that they are enabled, so it adds them to the Simplex biome generator. It would be good if there was some way to disable certain biomes from being added to the Simplex biome generator, but that is potentially a separate issue.
  • When creating its biome layers (lowlands, highlands, etc) Simplex Terrain Generation does not use the BuiltinBiomes ID map to convert Identifiers to ints, meaning that it can potentially provide integer biome IDs that are not in the BuiltinBiomes ID map back to Minecraft.
  • Furthermore, there is no code to add the used biomes to the BuiltinBiomes ID map. The Fabric Biomes API handles this in InternalBiomeUtils::ensureIdMapping for all biomes registered with OverworldBiomes API.
  • Minecraft notices that the returned values are not in the BuiltinBiomes ID map, and throws the above exception.

It seems like this is an issue in Simplex Terrain Generation. A pretty simple fix is to just add each biome registered with the Simplex biome generator to the BuiltinBiomes ID map, which would prevent the above exception, however it would not result in the biomes being disabled as expected. That is probably an enhancement that can happen separately.

commented

Simplex Terrain doesn't add any biomes itself so I was sort of confused by that ๐Ÿ˜… What I've done is remove the crash entirely so it now silently fails and returns plains if anything goes wrong. It's a hacky fix but it works. I'm closing the issue now.