Skip to content
lawremi edited this page Jul 25, 2013 · 26 revisions

This page contains notes and ideas related to the design of Custom Ore Generation.

Biome Sets

Design

Currently, we can restrict distributions to specific biomes with the <Biome> tag. Specifying long lists of biomes becomes tedious, and we often need to rely on inheritance and in the worst case copy-and-paste. These lists grow very long when attempting to support mods that add biomes, such as Biomes o’ Plenty. Currently, <Biome> matches multiple biomes through regular expression matching on the name. We propose to add two new element types: <BiomeType> (like <Biome> except it matches biome dictionary terms) and <BiomeSet>, a means of sharing a set of <Biome> elements across distributions. <BiomeSet> children would be <Biome>, <BiomeType> or other <BiomeSet> elements. Sets can be weighted, and the weight has a multiplicative effect on the weights of the set members. To apply a biome set to a distribution, add a <BiomeSet> element that inherits from an externally defined set, via the inherits attribute.

Additional types of selectors might include:

  • minTemperature / maxTemperature attributes bounding the temperature,
  • minRainfall / maxRainfall attributes bounding the rainfall,
  • minHeight / maxHeight attributes bounding the height range (completely within).

Examples

Assume we want to select only continental, non-mountainous biomes. We could list the types of biomes to include, as below:

<BiomeSet name="continental">
  <BiomeType name="forest"/>
  <BiomeType name="plains"/>
  <BiomeType name="desert"/>
  <BiomeType name="swamp"/>
  <BiomeType name="jungle"/>
  <BiomeType name="frozen"/>
  <BiomeType name="beach"/>
  <Biome name="river"/>
</BiomeSet>

Note that river is not a biome dictionary term, it is simply the name of the river biome. The water type would include ocean. It is unfortunate that there is no type distinguishing oceans from rivers. Also, the frozen ocean is included by the frozen type, but if we leave it off, we lose Ice Plains and Ice Mountains (why do these not use the plains and mountains terms?).

Instead, we could use the height restrictions to exclude oceans and extreme hills. Not sure about this yet.

<Biome minHeight="-0.5" maxHeight="1.3"/>

But that is too promiscuous and would include things like mushroom island and nether biomes.

So we need to exclude those.

<BiomeSet name="OtherDimensions">
  <Biome name="nether"/>
  <Biome name="end"/>
</BiomeSet>
<BiomeSet name="continental">
  <Biome minHeight="-0.5" maxHeight="1.3"/>
  <BiomeSet inherits="OtherDimensions" weight="-1"/>
  <BiomeType name="mushroom" weight="-1"/>
</BiomeSet>

Dimension tag

A <Dimension> tag could limit a distribution to a given dimension, like <Biome> does for biomes. This would require either an id, name, isSurface, or symbol attribute. If a <Dimension> tag is not specified, then wildcard is assumed. Note that the wildcard means every world, including Mystcraft dimensions, which might be undesirable. To support different settings depending on the dimension, this could have <Setting> elements as its children. This is probably simpler in many cases to using inheritance.

Mystcraft integration

The original COG supported the original Mystcraft design, where symbols were added in some quantity to a book, and distributions were sensitive to the symbol count, through expressions. Now that Mystcraft books are written according to a grammar, with modifier symbols, etc, it has become more complicated. The <Dimension> tag will apply a distribution to an age with that symbol. Child <Settings> elements should have expressions that consider modifiers on the symbol.

Adjacency-based Replacement

Extend <Replaces> to add the attributes above, below, north, south, west and east. They will be block descriptors that restrict on the type of block one space over in the given direction. This would allow things like placing a block on a surface (e.g., rock below, air above), or ensuring that an ore deposit is hidden in stone.

Clone this wiki locally