-
Notifications
You must be signed in to change notification settings - Fork 0
Design
This page contains notes and ideas related to the design of Custom Ore Generation.
Users want a way to generate based on the surface height. The primary complication is that we need to generate structures in the void, prior to chunk generation (otherwise, we need to back-fill chunks, eww). Thus, we need to guess the height. For vanilla generation, we can obtain the biome and then average its min/max height. ATG gives us access to the actual height value.
Two use cases for considering surface height:
- Scaling the height of generation
- Restricting/weighting generation
The height scaling has been implemented. The restriction could be implemented as an extension of Biome
element, perhaps through minHeight
and maxHeight
attributes.
There are two simple and important integration points:
- Disabling COG-based generation when DenseOres is active.
- Incorporating COG-based generation into the instability calculation.
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.
We need a mapping between COG and Mystcraft semantics. Certain (marked) distributions (usually a preset) will be manifested as noun symbols, supporting these modifiers:
- Ore block (repeat to increase relative weight)
- Biome (repeat to increase relative weight)
- Option (including frequency and size)
Modifying a distribution would be equivalent to extending it in a config file: everything is inherited and then overridden by symbols.
A distribution (preset) is represented by a symbol if it has a child <MystcraftSymbol>
. The old name
and displayName
attributes should probably be taken from the distribution (which does yet support displayName
). The new <MystcraftSymbol>
element will have these attributes/children:
-
rarity
: a value in [0,1], indicating how common a symbol is in treasure and trading, -
tradeable
: indicates whether villagers will trade with the item, -
firstTradeItem
: name/id of first trade item; if not specified, Mystcraft chooses, -
secondTradeItem
: name/id of second trade item; only allowed iffirstTradeItem
is specified. -
suffix
: the last word of the symbol; all distribution symbols will start with the words Control and Ore, with the third word depending on the type of distribution (Substitute
: Change,Cluster
: Tradition,Veins
: Flow,Cloud
: Entropy).
Marked COG options would be represented as a symbol, with the effect depending on the type:
- Boolean: Modifier toggles the default.
- Discrete: One modifier per value.
- Continuous: Default value multiplied/divided by repeating the modifier.
If an option symbol is given as a modifier of a distribution symbol, the option is only changed in the scope of that distribution. An option can also act as a noun on its own, in which case it is set globally. The options will begin with the words: Control, Ore, Question. The last word is given by the word
attribute of the <MystcraftSymbol>
element and would default to the option name. The frequency option would have the word Possibility, while the size would have Growth.
Blocking defaults: There will be a blocking symbol (Control, Ore, Inhibit, Contradict) that will have two functions:
- Blocking preceding distributions for a particular ore (as a modifier),
- Inverting the effect of an option (as a modifier), i.e., divide instead of multiply.
This helps limit the instability in the world.
We should integrate with Mystcraft ore block instability mechanic, so that increased ore density results in decreased stability.
The DenseOres symbol should disable COG generation for the dimension.
We should verify that the terrain symbols are manifested in existing attributes like world.type
and world.isSurface
.
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.
Like the biome sets, except define a set of block descriptors. The <BlockSet>
elements could be referenced from distributions using <ReplaceSet>
and <OreBlockSet>
.