Factorio Prototype DocsVersion 1.1.107

NoiseFunctionSpotNoise :: struct

Generates random conical spots. The map is divided into square regions, and within each region, candidate points are chosen at random and target density, spot quantity, and radius are calculated for each point (or one of every skip_span candidate points) by configured expressions. Each spot contributes a quantity to a regional target total (which is the average of sampled target densities times the area of the region) until the total has been reached or a maximum spot count is hit. The output value of the function is the maximum height of any spot at a given point.

The parameters that provide expressions to be evaluated for each point (all named something_expression) need to actually return expression objects.

The quantity of the spot is assumed to be the same as its volume. Since the volume of a cone is pi * radius^2 * height / 3, the height ('peak value') of any given spot is calculated as 3 * quantity / (pi * radius^2)

The infinite series of candidate points (of which candidate_point_count are actually considered) generated by spot-noise expressions with the same seed0, seed1, region_size, and suggested_minimum_candidate_point_spacing will be identical. This allows multiple spot-noise expressions (e.g. for different ore patches) to avoid overlap by using different points from the same list, determined by skip_span and skip_offset.

Properties

type :: "function-application"
function_name :: "spot-noise"
arguments :: SpotNoiseArguments

Properties

type :: "function-application"

function_name :: "spot-noise"

arguments :: SpotNoiseArguments

SpotNoiseArguments :: struct

Properties

seed0 :: ConstantNoiseNumber

Integer. First random seed, usually the map seed is used.

seed1 :: ConstantNoiseNumber

Integer. Second random seed, usually chosen to identify the noise layer.

region_size :: ConstantNoiseNumber optional

Default: 512

Integer. The width and height of each region.

skip_offset :: ConstantNoiseNumber optional

Default: 0

Integer. Offset of the first candidate point to use.

skip_span :: ConstantNoiseNumber optional

Default: 1

Integer. Number of candidate points to skip over after each one used as a spot, including the used one.

candidate_point_count :: ConstantNoiseNumber optional

Default: 256

Integer. How many candidate points to generate.

candidate_spot_count :: ConstantNoiseNumber optional

Default: depends on skip_span

Integer. An alternative to candidate_point_count: number of spots to generate: candidate_spot_count = X is equivalent to candidate_point_count / skip_span = X

suggested_minimum_candidate_point_spacing :: ConstantNoiseNumber optional

Default: depends on region_size and candidate_point_count

The minimum spacing to try to achieve while randomly picking points. Spot noise may end up placing spots closer than this in crowded regions.

hard_region_target_quantity :: ConstantNoiseBoolean optional

Default: true

Whether to place a hard limit on the total quantity in each region by reducing the size of any spot (which will be the last spot chosen) that would put it over the limit.

density_expression :: NoiseLiteralExpression

A numeric expression that will be evaluated for each candidate spot to calculate density at that point.

spot_quantity_expression :: NoiseLiteralExpression

A numeric expression that will be evaluated for each candidate spot to calculate the spot's quantity.

spot_radius_expression :: NoiseLiteralExpression

A numeric expression that will be evaluated for each candidate spot to calculate the spot's radius. This, together with quantity, will determine the spots peak value.

spot_favorability_expression :: NoiseLiteralExpression

A numeric expression that will be evaluated for each candidate spot to calculate the spot's favorability. Spots with higher favorability will be considered first when building the final list of spots for a region.

basement_value :: ConstantNoiseNumber

maximum_spot_basement_radius :: ConstantNoiseNumber

comment :: NoiseLiteralString

Prototypes

Types