Page last edited 1,750 days 10 hours ago
From COG Docs
Jump to: navigation, search

The Cloud algorithm creates an irregular cloud of ore. It is intended for large, sparse distributions that require the player to set up proper mineshafts and infrastructure.

Cloud Algorithm

Iron cloud (denser part in the center) surrounded by single "hint" blocks

The Cloud algorithm creates a rounded ellipsoid which can be flattened or stretched independently in the vertical and horizontal directions. The interior can be carved up and the surface given irregular bumps and using a noise function (3D simplex noise, to be exact). Together these provide for a huge variety in cloud shape.

The <Cloud> element creates a distribution using the cloud algorithm. The <CloudPreset> element creates a non-generating distribution that can be used as a source of default settings. <Cloud> elements support all of the standard distribution features.


The Cloud algorithm may have the following attributes:

Attribute Default Value Description
name procedurally generated A name used to identify the distribution. This is used by other distributions to inherit default parameter values, for log messages, and for debugging console commands. It is recommended (but not required) that distribution names be unique and contain no whitespace.
seed unique value based on order in config file A seed modifier for random numbers generated by this distribution. If two distributions have similar settings and the same seed, they will share the same geometry.
block none The blockID or internal name of the block to be placed (with weight 1.0). <OreBlock> elements can be used as well, or instead, but the block attribute is often shorter and easier to read.
inherits hard-coded defaults Another Cloud distribution from which to inherit all default parameter values except the name and seed.
drawWireframe* false Whether or not to draw a wireframe model around the distribution.
wireframeColor* 0xFF169E09 The color of the debugging wireframe, if one is drawn. The format is ARGB, "packed" into an integer so that the highest byte is the alpha component and the lowest byte is the blue component.
drawBoundBox* false Whether or not to draw bounding boxes for the distribution.
boundBoxColor* 0x80000000 The color of the bound boxes, if they are drawn. The format is the same as for wireframeColor above.
* These attributes are only meaningful in debugging mode.


The Cloud algorithm has the following settings:

Cloud Settings
Setting Default Value Description
DistributionFrequency 0.001 The number of clouds per 16x16 chunk. Values greater than one can produce multiple clouds in a single chunk.
ParentRangeLimit 32 ± 32 (normal) The maximum horizontal distance a cloud of this distribution may spawn from the center of the nearest cloud, motherlode, or cluster of its parent distribution. Differences in height do not count - only distance in the XZ plane. If the distribution has no parent, this setting is ignored.
CloudRadius 25 ± 10 Horizontal size (radius) of cloud, in meters. The radius along the X and Z axes are independent random values chosen using this setting.
CloudThickness 14 ± 6 Vertical size (radius) of cloud, in meters. The radius along the Y axis is chosen using this setting.
CloudSizeNoise 0.2 The noise level for the cloud surface. A value of 0 means no noise (a perfect ellipsoid), while higher values make the surface increasingly irregular.
CloudHeight 32 ± 16 (normal) Height at which clouds generate, in meters.
CloudInclination 0 ± 0.35 The "tilt" angle of the cloud from the horizontal XZ plane, in radians. A value of 0 means that the cloud is level, while a value of PI/2 would tilt the cloud up on one end.
OreDensity 0.1 A per-block density multiplier. This setting multiplies the weight of each ore block to determine the overall probability that that block will be placed. It can vary from 0 (no ore blocks placed) to 1 (all ore blocks placed).
OreVolumeNoiseCutoff 0.5 A per-block internal density noise cutoff. The interior of each cloud has its own noise field, and ore will only be placed if the field value at that location is above this cutoff. A value of 0 means uniform density (interior noise is ignored), and a value of 1 means that no blocks will be placed (because all field values are less than 1).
OreRadiusMult 1.0 ± 0.1 A per-block multiplier to the maximum allowable radius for clouds. An average of 1.0 is recommended. Increasing the range will make ore placement more "ragged" at the cloud edges.

Ore Blocks

<OreBlock> elements can be used to specify a mixture of ore blocks to spawn with fractional weights. The total weight of all ore blocks must be less than 1.0.


<Replaces> elements can be used to change which blocks a Cloud distribution will replace (the default is just smooth stone).


<Biome> elements can be used to customize which biomes a Cloud distribution will spawn in (the default is all biomes).

Parents and Nesting

A <Cloud> element may be placed inside another Cloud, Veins, or StandardGen element. The parent distribution will continue to spawn normally, but the child will only spawn near it's parent. The exact range is determined by the ParentRangeLimit setting.


<!-- A cloud distribution named "GoldCloud" -->  
<!-- All defaults are inherited from "PresetStrategicCloud", which must be defined somewhere above -->  
<Cloud name='GoldCloud' inherits='PresetStrategicCloud'>

    <!-- This cloud will place a 50/50 mixture of gold ore and gold blocks -->  
    <OreBlock block='oreGold' weight='0.5'/>
    <OreBlock block='blockGold ' weight='0.5'/>

    <!-- The cloud will measure between 12 and 28 meters in the horizontal-->  
    <!-- directions and between 8 and 20 meters in the vertical direction. --> 
    <Setting name='CloudRadius' avg='20' range='8'/>
    <Setting name='CloudThickness' avg='14' range='6'/>

    <!-- These clouds will only spawn in Extreme Hills and Extreme Hills Edge biomes --> 
    <Biome name='Extreme Hills.*'/>  

    <!-- They will replace stone 100% of the time, but open air only 10% of the time --> 
    <Replaces name='stone'/>
    <Replaces name='air' weight='0.1'/>

    <!-- A child distribution.  It will only spawn near the parent. -->    
    <Cloud name='ChildDistribution' block='oreGold'/>