Skip to content

Configs Customisation

MarcellPerger1 edited this page Apr 1, 2023 · 5 revisions

Configs

Where you can easily customize stuff

  • You can customize stuff by altering the configs in the configs/ folder.
  • To edit the current config, edit the config.json config file.
  • To edit the base config with all the default values, edit the default.json file. This file initially contains sensible defaults for all config values.
  • All of the configs are written in json

Normal configs

Root config

Key Type Description Status
Config The root.toplevel config. Everything else is directly or indirectly a sub-key of this
bgColor RGBA_float Background color
checkError boolean Check WebGL errors at runtime? ⚠️ Deprecated, will be removed in 0.4.0 ⚠️
generation GenerationConfig World Generation
controls ControlsConfig Controls
player PlayerConfig Player configs (Has stuff that affects gameplay)
shader ShaderConfig Shader ❗ Internal
atlas AtlasConfig Texture Atlas ❗ Internal

GenerationConfig

Key Type Description Status
seed number | string Seed
isTestWorld boolean Generate a test world with all blocks in the game in a flat surface?
wSize Vec3<int> World size
chunkSize Vec3<int> Chunk size
nTrees int Number of trees in world
treeRadius Vec2<int> Radius of each tree in which to avoid placing other trees
treeCollideAction TreeCollideAction What to do about trees being placed within treeRadius of each other
baseTerrain NoiseConfig Base terrain noise: Defines shape of terrain height
stoneOffset NoiseConfig Stone offset noise: Defines offset of stone level compared to base terrain

NoiseConfig

Key Type Description Status
nScale Vec3<float> How much to enlarge the noise in each direction
octaveMult Vec3<float> The multiplier from each octave/layer to the next
layers int How many layer/octaves to use
nMedian float | 'auto' Median value of the noise.

TreeCollideAction

Possible values:

Value Description
'place' Place the tree anyway
'skip' Don't place the tree
'avoid' Avoid placing tree in the treeCollideRadius; try and find unoccupied place to place tree

ControlsConfig

Key Type Description Status
sensitivity float How sensitive to be to mouse movements
vRotRange [float, float] The maximum and minimum vertical rotation (so that camera doesn't go upside down)
maxMouseMove Vec2<float> Max mouse movement per frame. Can be useful as a not-very-good workaround to the chrome bug described in #43

PlayerConfig

Key Type Description Status
startPos Vec3<float> Where the player starts
startRot Rot3 What angle the player starts at
speed float How fast the player moves

Internal configs (:exclamation: Internal)

The keys marked as internal as the status or that are in this section are internal and may be changed or removed at any time. Do not rely on these unless you really have to.

ShaderConfig

Key Type Description Status
vsPath path Path to the vertex shader passed to WebGL ❗ Internal
fsPath path Path to the fragment shader passed to WebGL ❗ Internal

AtlasConfig

Key Type Description Status
imgPath path Path to the texture atlas ❗ Internal
indexPath path Path to the atlas-index.json file corresponding to the texture atlas ❗ Internal