Class: IslandSettings

island-generator~IslandSettings(seed)

Island settings class to store default values for all settings, as well as give the ability to generate custom islands with modified settings. This achieves the same thing as passing many values into the island constructor, and giving them defaults, but is more readable (Otherwise I'd be putting 250 lines worth of parameters into one constructor!! Madness!), and allows for better customization flexibility. Many of these values are constants that shouldn't be changed, and obviously none of these will be changed after island compile time, as they're simply parameters.

Constructor

new IslandSettings(seed)

Parameters:
Name Type Description
seed number Seed for the island. Custom seeds must be set through the constructor, as many of the other default values are determined based on a hash of the seed modulus some constant. Defaults to a random number
Source:

Members

BEACH :string

Beach colour repersented in hexidecimal
Type:
  • string
Source:

colour_background :boolean

For export purposes, determines if a background should be drawn
Type:
  • boolean
Source:

DEEP_OCEAN :string

Deep ocean / background colour repersented in hexidecimal
Type:
  • string
Source:

HAS_MOTU :boolean

Boolean to repersent if an island should be generated with a motu. Default 50% chance.
Type:
  • boolean
Source:

HAS_REEF :boolean

Boolean to repersent if an island should be generated with a reef. Default 50% chance, and must also have a motu.
Type:
  • boolean
Source:

HAS_TOWN :number

Number to repersent state of village generation. Defaults to 0. 0 | Village should be, but hasn't yet been generated. 1 | No village should be generated. -1 | Village has already been generated.
Type:
  • number
Source:

HAS_TREES :boolean

Boolean to repersent if an island should have trees generated. Defaults to true.
Type:
  • boolean
Source:

IS_ATOLL :boolean

Boolean to repersent if an island should be generated as an atoll. Default 25% chance, and must also have a motu.
Type:
  • boolean
Source:

IS_VOLCANO :boolean

Boolean to repersent if an island should be generated with a volcano. Default 25% chance, and must also not have a motu.
Type:
  • boolean
Source:

ISL_LAC :number

Island lacunarity scaler. See gen_noise_map for more information. Defaults to 0.75.
Type:
  • number
Source:

ISL_MASK :number

Mask range to allow specific regions of the island to be exempt from specifc generation by masking them.
Type:
  • number
Source:

ISL_OCT :number

Number of octaves of perlin noise to layer. See gen_noise_map for more information. Defaults to 8.
Type:
  • number
Source:

ISL_PERSIST :number

Island persistence scaler. See gen_noise_map for more information. Defaults to 2.
Type:
  • number
Source:

ISL_SCALE :number

Island scale scaler. See gen_noise_map for more information. Defaults to 25.
Type:
  • number
Source:

ISL_SHRK :number

Constant value to shrink motu and atoll based islands by. This is offset by motu generation.
Type:
  • number
Source:

LAND_ONE :string

Low ground colour repersented in hexidecimal
Type:
  • string
Source:

LAND_THREE :string

High ground colour repersented in hexidecimal
Type:
  • string
Source:

LAND_TWO :string

Middle ground colour repersented in hexidecimal
Type:
  • string
Source:

LAVA_ONE :string

Low lava colour repersented in hexidecimal
Type:
  • string
Source:

LAVA_TWO :string

High lava colour repersented in hexidecimal
Type:
  • string
Source:

MOTU_GRAD :Array.<number>

Gradient of height minimax for motu generation. Initial height values between grad[0] and grad[1] will be raised to form the motu sandbars, while values between grad[2] and grad[3] will be lowered to form the motu lagoon.
Type:
  • Array.<number>
Source:

MOTU_LAC :number

Motu lacunarity scaler. See gen_noise_map for more information. Defaults to 0.95.
Type:
  • number
Source:

MOTU_OCT :number

Number of octaves of perlin noise to layer for motus. See gen_noise_map for more information. Defaults to 1.
Type:
  • number
Source:

MOTU_PERSIST :number

Motu persistence scaler. See gen_noise_map for more information. Defaults to 2.
Type:
  • number
Source:

MOTU_SCALE :number

Motu scale scaler. See gen_noise_map for more information. Defaults to 500.
Type:
  • number
Source:

name :string

Island name. Defaults to a random selection from the NAMES_LIST
Type:
  • string
Source:

REEF_LAC :number

Reef lacunarity scaler. See gen_noise_map for more information. Defaults to 0.95.
Type:
  • number
Source:

REEF_OCT :number

Number of octaves of perlin noise to layer for reefs. See gen_noise_map for more information. Defaults to 1.
Type:
  • number
Source:

REEF_PERSIST :number

Reef persistence scaler. See gen_noise_map for more information. Defaults to 2.
Type:
  • number
Source:

REEF_SCALE :number

Reef scale scaler. See gen_noise_map for more information. Defaults to 50.
Type:
  • number
Source:

ROCK_ONE :string

Low rock colour repersented in hexidecimal
Type:
  • string
Source:

ROCK_TWO :string

High ground colour repersented in hexidecimal
Type:
  • string
Source:

seed :number

Master seed
Type:
  • number
Source:

SHALLOW_OCEAN :string

Shallow ocean colour repersented in hexidecimal
Type:
  • string
Source:

size_x :number

Width of the island
Type:
  • number
Source:

size_y :number

Height of the island
Type:
  • number
Source:

time :number

Time value to scale shadows by when exporting an image of the island.
Type:
  • number
Source:

tree_amt :number

Amount of trees to generate, if tree generation is true. Defaults to 500.
Type:
  • number
Source:

VILLAGE :string

Village colour repersented in hexidecimal
Type:
  • string
Deprecated:
  • Yes
Source:

village_size :number

Size of village. Affects both number of structures, and spread of structures. Defaults to 6.
Type:
  • number
Source: