# This file contains a list of all available settings and their default value for minetest.conf
# By default, all the settings are commented and not functional.
# Uncomment settings by removing the preceding #.
# minetest.conf is read by default from:
# ../minetest.conf
# ../../minetest.conf
# Any other path can be chosen by passing the path as a parameter
# to the program, eg. "minetest.exe --config ../minetest.conf.example".
# Further documentation:
# http://wiki.minetest.net/
#
# Controls
#
# If enabled, you can place blocks at the position (feet + eye level) where you stand.
# This is helpful when working with nodeboxes in small areas.
# type: bool
# enable_build_where_you_stand = false
# Player is able to fly without being affected by gravity.
# This requires the "fly" privilege on the server.
# type: bool
# free_move = false
# If enabled, makes move directions relative to the player's pitch when flying or swimming.
# type: bool
# pitch_move = false
# Fast movement (via the "special" key).
# This requires the "fast" privilege on the server.
# type: bool
# fast_move = false
# If enabled together with fly mode, player is able to fly through solid nodes.
# This requires the "noclip" privilege on the server.
# type: bool
# noclip = false
# Smooths camera when looking around. Also called look or mouse smoothing.
# Useful for recording videos.
# type: bool
# cinematic = false
# Smooths rotation of camera. 0 to disable.
# type: float min: 0 max: 0.99
# camera_smoothing = 0.0
# Smooths rotation of camera in cinematic mode. 0 to disable.
# type: float min: 0 max: 0.99
# cinematic_camera_smoothing = 0.7
# Invert vertical mouse movement.
# type: bool
# invert_mouse = false
# Mouse sensitivity multiplier.
# type: float
# mouse_sensitivity = 0.2
# If enabled, "special" key instead of "sneak" key is used for climbing down and
# descending.
# type: bool
# aux1_descends = false
# Double-tapping the jump key toggles fly mode.
# type: bool
# doubletap_jump = false
# If disabled, "special" key is used to fly fast if both fly and fast mode are
# enabled.
# type: bool
# always_fly_fast = true
# The time in seconds it takes between repeated right clicks when holding the right
# mouse button.
# type: float
# repeat_rightclick_time = 0.25
# Automatically jump up single-node obstacles.
# type: bool
# autojump = false
# Prevent digging and placing from repeating when holding the mouse buttons.
# Enable this when you dig or place too often by accident.
# type: bool
# safe_dig_and_place = false
# Enable random user input (only used for testing).
# type: bool
# random_input = false
# Continuous forward movement, toggled by autoforward key.
# Press the autoforward key again or the backwards movement to disable.
# type: bool
# continuous_forward = false
# The length in pixels it takes for touch screen interaction to start.
# type: int min: 0 max: 100
# touchscreen_threshold = 20
# (Android) Fixes the position of virtual joystick.
# If disabled, virtual joystick will center to first-touch's position.
# type: bool
# fixed_virtual_joystick = false
# (Android) Use virtual joystick to trigger "aux" button.
# If enabled, virtual joystick will also tap "aux" button when out of main circle.
# type: bool
# virtual_joystick_triggers_aux = false
# Enable joysticks
# type: bool
# enable_joysticks = false
# The identifier of the joystick to use
# type: int
# joystick_id = 0
# The type of joystick
# type: enum values: auto, generic, xbox
# joystick_type = auto
# The time in seconds it takes between repeated events
# when holding down a joystick button combination.
# type: float
# repeat_joystick_button_time = 0.17
# The sensitivity of the joystick axes for moving the
# ingame view frustum around.
# type: float
# joystick_frustum_sensitivity = 170
# Key for moving the player forward.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_forward = KEY_KEY_W
# Key for moving the player backward.
# Will also disable autoforward, when active.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_backward = KEY_KEY_S
# Key for moving the player left.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_left = KEY_KEY_A
# Key for moving the player right.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_right = KEY_KEY_D
# Key for jumping.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_jump = KEY_SPACE
# Key for sneaking.
# Also used for climbing down and descending in water if aux1_descends is disabled.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_sneak = KEY_LSHIFT
# Key for opening the inventory.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_inventory = KEY_KEY_I
# Key for moving fast in fast mode.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_special1 = KEY_KEY_E
# Key for opening the chat window.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_chat = KEY_KEY_T
# Key for opening the chat window to type commands.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_cmd = /
# Key for opening the chat window to type local commands.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_cmd_local = .
# Key for toggling unlimited view range.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_rangeselect = KEY_KEY_R
# Key for toggling flying.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_freemove = KEY_KEY_K
# Key for toggling pitch move mode.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_pitchmove = KEY_KEY_P
# Key for toggling fast mode.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_fastmove = KEY_KEY_J
# Key for toggling noclip mode.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_noclip = KEY_KEY_H
# Key for selecting the next item in the hotbar.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_hotbar_next = KEY_KEY_N
# Key for selecting the previous item in the hotbar.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_hotbar_previous = KEY_KEY_B
# Key for muting the game.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_mute = KEY_KEY_M
# Key for increasing the volume.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_increase_volume =
# Key for decreasing the volume.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_decrease_volume =
# Key for toggling autoforward.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_autoforward =
# Key for toggling cinematic mode.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_cinematic =
# Key for toggling display of minimap.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_minimap = KEY_F9
# Key for taking screenshots.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_screenshot = KEY_F12
# Key for dropping the currently selected item.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_drop = KEY_KEY_Q
# Key to use view zoom when possible.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_zoom = KEY_KEY_Z
# Key for selecting the first hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot1 = KEY_KEY_1
# Key for selecting the second hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot2 = KEY_KEY_2
# Key for selecting the third hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot3 = KEY_KEY_3
# Key for selecting the fourth hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot4 = KEY_KEY_4
# Key for selecting the fifth hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot5 = KEY_KEY_5
# Key for selecting the sixth hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot6 = KEY_KEY_6
# Key for selecting the seventh hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot7 = KEY_KEY_7
# Key for selecting the eighth hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot8 = KEY_KEY_8
# Key for selecting the ninth hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot9 = KEY_KEY_9
# Key for selecting the tenth hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot10 = KEY_KEY_0
# Key for selecting the 11th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot11 =
# Key for selecting the 12th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot12 =
# Key for selecting the 13th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot13 =
# Key for selecting the 14th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot14 =
# Key for selecting the 15th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot15 =
# Key for selecting the 16th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot16 =
# Key for selecting the 17th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot17 =
# Key for selecting the 18th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot18 =
# Key for selecting the 19th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot19 =
# Key for selecting the 20th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot20 =
# Key for selecting the 21st hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot21 =
# Key for selecting the 22nd hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot22 =
# Key for selecting the 23rd hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot23 =
# Key for selecting the 24th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot24 =
# Key for selecting the 25th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot25 =
# Key for selecting the 26th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot26 =
# Key for selecting the 27th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot27 =
# Key for selecting the 28th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot28 =
# Key for selecting the 29th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot29 =
# Key for selecting the 30th hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot30 =
# Key for selecting the 31st hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot31 =
# Key for selecting the 32nd hotbar slot.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_slot32 =
# Key for toggling the display of the HUD.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_toggle_hud = KEY_F1
# Key for toggling the display of chat.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_toggle_chat = KEY_F2
# Key for toggling the display of the large chat console.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_console = KEY_F10
# Key for toggling the display of fog.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_toggle_force_fog_off = KEY_F3
# Key for toggling the camera update. Only used for development
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_toggle_update_camera =
# Key for toggling the display of debug info.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_toggle_debug = KEY_F5
# Key for toggling the display of the profiler. Used for development.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_toggle_profiler = KEY_F6
# Key for switching between first- and third-person camera.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_camera_mode = KEY_F7
# Key for increasing the viewing range.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_increase_viewing_range_min = +
# Key for decreasing the viewing range.
# See http://irrlicht.sourceforge.net/docu/namespaceirr.html#a54da2a0e231901735e3da1b0edf72eb3
# type: key
# keymap_decrease_viewing_range_min = -
#
# Graphics
#
## In-Game
### Basic
# Enable VBO
# type: bool
# enable_vbo = true
# Whether to fog out the end of the visible area.
# type: bool
# enable_fog = true
# Leaves style:
# - Fancy: all faces visible
# - Simple: only outer faces, if defined special_tiles are used
# - Opaque: disable transparency
# type: enum values: fancy, simple, opaque
# leaves_style = fancy
# Connects glass if supported by node.
# type: bool
# connected_glass = false
# Enable smooth lighting with simple ambient occlusion.
# Disable for speed or for different looks.
# type: bool
# smooth_lighting = true
# Clouds are a client side effect.
# type: bool
# enable_clouds = true
# Use 3D cloud look instead of flat.
# type: bool
# enable_3d_clouds = true
# Method used to highlight selected object.
# type: enum values: box, halo, none
# node_highlighting = box
# Adds particles when digging a node.
# type: bool
# enable_particles = true
### Filtering
# Use mip mapping to scale textures. May slightly increase performance,
# especially when using a high resolution texture pack.
# Gamma correct downscaling is not supported.
# type: bool
# mip_map = false
# Use anisotropic filtering when viewing at textures from an angle.
# type: bool
# anisotropic_filter = false
# Use bilinear filtering when scaling textures.
# type: bool
# bilinear_filter = false
# Use trilinear filtering when scaling textures.
# type: bool
# trilinear_filter = false
# Filtered textures can blend RGB values with fully-transparent neighbors,
# which PNG optimizers usually discard, sometimes resulting in a dark or
# light edge to transparent textures. Apply this filter to clean that up
# at texture load time.
# type: bool
# texture_clean_transparent = false
# When using bilinear/trilinear/anisotropic filters, low-resolution textures
# can be blurred, so automatically upscale them with nearest-neighbor
# interpolation to preserve crisp pixels. This sets the minimum texture size
# for the upscaled textures; higher values look sharper, but require more
# memory. Powers of 2 are recommended. Setting this higher than 1 may not
# have a visible effect unless bilinear/trilinear/anisotropic filtering is
# enabled.
# This is also used as the base node texture size for world-aligned
# texture autoscaling.
# type: int
# texture_min_size = 64
# Experimental option, might cause visible spaces between blocks
# when set to higher number than 0.
# type: enum values: 0, 1, 2, 4, 8, 16
# fsaa = 0
# Undersampling is similar to using lower screen resolution, but it applies
# to the game world only, keeping the GUI intact.
# It should give significant performance boost at the cost of less detailed image.
# type: enum values: 0, 2, 3, 4
# undersampling = 0
### Shaders
# Shaders allow advanced visual effects and may increase performance on some video
# cards.
# This only works with the OpenGL video backend.
# type: bool
# enable_shaders = true
# Path to shader directory. If no path is defined, default location will be used.
# type: path
# shader_path =
#### Tone Mapping
# Enables filmic tone mapping
# type: bool
# tone_mapping = false
#### Bumpmapping
# Enables bumpmapping for textures. Normalmaps need to be supplied by the texture pack
# or need to be auto-generated.
# Requires shaders to be enabled.
# type: bool
# enable_bumpmapping = false
# Enables on the fly normalmap generation (Emboss effect).
# Requires bumpmapping to be enabled.
# type: bool
# generate_normalmaps = false
# Strength of generated normalmaps.
# type: float
# normalmaps_strength = 0.6
# Defines sampling step of texture.
# A higher value results in smoother normal maps.
# type: int min: 0 max: 2
# normalmaps_smooth = 0
#### Parallax Occlusion
# Enables parallax occlusion mapping.
# Requires shaders to be enabled.
# type: bool
# enable_parallax_occlusion = false
# 0 = parallax occlusion with slope information (faster).
# 1 = relief mapping (slower, more accurate).
# type: int min: 0 max: 1
# parallax_occlusion_mode = 1
# Strength of parallax.
# type: float
# 3d_paralax_strength = 0.025
# Number of parallax occlusion iterations.
# type: int
# parallax_occlusion_iterations = 4
# Overall scale of parallax occlusion effect.
# type: float
# parallax_occlusion_scale = 0.08
# Overall bias of parallax occlusion effect, usually scale/2.
# type: float
# parallax_occlusion_bias = 0.04
#### Waving Nodes
# Set to true enables waving water.
# Requires shaders to be enabled.
# type: bool
# enable_waving_water = false
# type: float
# water_wave_height = 1.0
# type: float
# water_wave_length = 20.0
# type: float
# water_wave_speed = 5.0
# Set to true enables waving leaves.
# Requires shaders to be enabled.
# type: bool
# enable_waving_leaves = false
# Set to true enables waving plants.
# Requires shaders to be enabled.
# type: bool
# enable_waving_plants = false
### Advanced
# Arm inertia, gives a more realistic movement of
# the arm when the camera moves.
# type: bool
# arm_inertia = true
# If FPS would go higher than this, limit it by sleeping
# to not waste CPU power for no benefit.
# type: int
# fps_max = 60
# Maximum FPS when game is paused.
# type: int
# pause_fps_max = 20
# Open the pause menu when the window's focus is lost. Does not pause if a formspec is
# open.
# type: bool
# pause_on_lost_focus = false
# View distance in nodes.
# type: int min: 20 max: 4000
# viewing_range = 100
# Camera near plane distance in nodes, between 0 and 0.5
# Most users will not need to change this.
# Increasing can reduce artifacting on weaker GPUs.
# 0.1 = Default, 0.25 = Good value for weaker tablets.
# type: float min: 0 max: 0.5
# near_plane = 0.1
# Width component of the initial window size.
# type: int
# screen_w = 1024
# Height component of the initial window size.
# type: int
# screen_h = 600
# Save window size automatically when modified.
# type: bool
# autosave_screensize = true
# Fullscreen mode.
# type: bool
# fullscreen = false
# Bits per pixel (aka color depth) in fullscreen mode.
# type: int
# fullscreen_bpp = 24
# Vertical screen synchronization.
# type: bool
# vsync = false
# Field of view in degrees.
# type: int min: 45 max: 160
# fov = 72
# Adjust the gamma encoding for the light tables. Higher numbers are brighter.
# This setting is for the client only and is ignored by the server.
# type: float min: 0.5 max: 3
# display_gamma = 1.0
# Gradient of light curve at minimum light level.
# type: float min: 0 max: 4
# lighting_alpha = 0.0
# Gradient of light curve at maximum light level.
# type: float min: 0 max: 4
# lighting_beta = 1.5
# Strength of light curve mid-boost.
# type: float min: 0 max: 1
# lighting_boost = 0.2
# Center of light curve mid-boost.
# type: float min: 0 max: 1
# lighting_boost_center = 0.5
# Spread of light curve mid-boost.
# Standard deviation of the mid-boost gaussian.
# type: float min: 0 max: 1
# lighting_boost_spread = 0.2
# Path to texture directory. All textures are first searched from here.
# type: path
# texture_path =
# The rendering back-end for Irrlicht.
# A restart is required after changing this.
# Note: On Android, stick with OGLES1 if unsure! App may fail to start otherwise.
# On other platforms, OpenGL is recommended, and it’s the only driver with
# shader support currently.
# type: enum values: null, software, burningsvideo, direct3d8, direct3d9, opengl, ogles1, ogles2
# video_driver = opengl
# Radius of cloud area stated in number of 64 node cloud squares.
# Values larger than 26 will start to produce sharp cutoffs at cloud area corners.
# type: int
# cloud_radius = 12
# Enable view bobbing and amount of view bobbing.
# For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double.
# type: float
# view_bobbing_amount = 1.0
# Multiplier for fall bobbing.
# For example: 0 for no view bobbing; 1.0 for normal; 2.0 for double.
# type: float
# fall_bobbing_amount = 0.03
# 3D support.
# Currently supported:
# - none: no 3d output.
# - anaglyph: cyan/magenta color 3d.
# - interlaced: odd/even line based polarisation screen support.
# - topbottom: split screen top/bottom.
# - sidebyside: split screen side by side.
# - crossview: Cross-eyed 3d
# - pageflip: quadbuffer based 3d.
# Note that the interlaced mode requires shaders to be enabled.
# type: enum values: none, anaglyph, interlaced, topbottom, sidebyside, crossview, pageflip
# 3d_mode = none
# In-game chat console height, between 0.1 (10%) and 1.0 (100%).
# type: float min: 0.1 max: 1
# console_height = 0.6
# In-game chat console background color (R,G,B).
# type: string
# console_color = (0,0,0)
# In-game chat console background alpha (opaqueness, between 0 and 255).
# type: int min: 0 max: 255
# console_alpha = 200
# Formspec full-screen background opacity (between 0 and 255).
# type: int min: 0 max: 255
# formspec_fullscreen_bg_opacity = 140
# Formspec full-screen background color (R,G,B).
# type: string
# formspec_fullscreen_bg_color = (0,0,0)
# Formspec default background opacity (between 0 and 255).
# type: int min: 0 max: 255
# formspec_default_bg_opacity = 140
# Formspec default background color (R,G,B).
# type: string
# formspec_default_bg_color = (0,0,0)
# Selection box border color (R,G,B).
# type: string
# selectionbox_color = (0,0,0)
# Width of the selection box lines around nodes.
# type: int min: 1 max: 5
# selectionbox_width = 2
# Crosshair color (R,G,B).
# type: string
# crosshair_color = (255,255,255)
# Crosshair alpha (opaqueness, between 0 and 255).
# type: int min: 0 max: 255
# crosshair_alpha = 255
# Maximum number of recent chat messages to show
# type: int min: 2 max: 20
# recent_chat_messages = 6
# Whether node texture animations should be desynchronized per mapblock.
# type: bool
# desynchronize_mapblock_texture_animation = true
# Maximum proportion of current window to be used for hotbar.
# Useful if there's something to be displayed right or left of hotbar.
# type: float
# hud_hotbar_max_width = 1.0
# Modifies the size of the hudbar elements.
# type: float
# hud_scaling = 1.0
# Enables caching of facedir rotated meshes.
# type: bool
# enable_mesh_cache = false
# Delay between mesh updates on the client in ms. Increasing this will slow
# down the rate of mesh updates, thus reducing jitter on slower clients.
# type: int min: 0 max: 50
# mesh_generation_interval = 0
# Size of the MapBlock cache of the mesh generator. Increasing this will
# increase the cache hit %, reducing the data being copied from the main
# thread, thus reducing jitter.
# type: int min: 0 max: 1000
# meshgen_block_cache_size = 20
# Enables minimap.
# type: bool
# enable_minimap = true
# Shape of the minimap. Enabled = round, disabled = square.
# type: bool
# minimap_shape_round = true
# True = 256
# False = 128
# Useable to make minimap smoother on slower machines.
# type: bool
# minimap_double_scan_height = true
# Make fog and sky colors depend on daytime (dawn/sunset) and view direction.
# type: bool
# directional_colored_fog = true
# The strength (darkness) of node ambient-occlusion shading.
# Lower is darker, Higher is lighter. The valid range of values for this
# setting is 0.25 to 4.0 inclusive. If the value is out of range it will be
# set to the nearest valid value.
# type: float min: 0.25 max: 4
# ambient_occlusion_gamma = 2.2
# Enables animation of inventory items.
# type: bool
# inventory_items_animations = false
# Fraction of the visible distance at which fog starts to be rendered
# type: float min: 0 max: 0.99
# fog_start = 0.4
# Makes all liquids opaque
# type: bool
# opaque_water = false
# Textures on a node may be aligned either to the node or to the world.
# The former mode suits better things like machines, furniture, etc., while
# the latter makes stairs and microblocks fit surroundings better.
# However, as this possibility is new, thus may not be used by older servers,
# this option allows enforcing it for certain node types. Note though that
# that is considered EXPERIMENTAL and may not work properly.
# type: enum values: disable, enable, force_solid, force_nodebox
# world_aligned_mode = enable
# World-aligned textures may be scaled to span several nodes. However,
# the server may not send the scale you want, especially if you use
# a specially-designed texture pack; with this option, the client tries
# to determine the scale automatically basing on the texture size.
# See also texture_min_size.
# Warning: This option is EXPERIMENTAL!
# type: enum values: disable, enable, force
# autoscale_mode = disable
# Show entity selection boxes
# type: bool
# show_entity_selectionbox = true
## Menus
# Use a cloud animation for the main menu background.
# type: bool
# menu_clouds = true
# Scale GUI by a user specified value.
# Use a nearest-neighbor-anti-alias filter to scale the GUI.
# This will smooth over some of the rough edges, and blend
# pixels when scaling down, at the cost of blurring some
# edge pixels when images are scaled by non-integer sizes.
# type: float
# gui_scaling = 1.0
# When gui_scaling_filter is true, all GUI images need to be
# filtered in software, but some images are generated directly
# to hardware (e.g. render-to-texture for nodes in inventory).
# type: bool
# gui_scaling_filter = false
# When gui_scaling_filter_txr2img is true, copy those images
# from hardware to software for scaling. When false, fall back
# to the old scaling method, for video drivers that don't
# properly support downloading textures back from hardware.
# type: bool
# gui_scaling_filter_txr2img = true
# Delay showing tooltips, stated in milliseconds.
# type: int
# tooltip_show_delay = 400
# Append item name to tooltip.
# type: bool
# tooltip_append_itemname = false
# Whether FreeType fonts are used, requires FreeType support to be compiled in.
# type: bool
# freetype = true
# Path to TrueTypeFont or bitmap.
# type: filepath
# font_path = fonts/liberationsans.ttf
# type: int
# font_size = 16
# Font shadow offset, if 0 then shadow will not be drawn.
# type: int
# font_shadow = 1
# Font shadow alpha (opaqueness, between 0 and 255).
# type: int min: 0 max: 255
# font_shadow_alpha = 127
# type: filepath
# mono_font_path = fonts/liberationmono.ttf
# type: int
# mono_font_size = 15
# This font will be used for certain languages.
# type: filepath
# fallback_font_path = fonts/DroidSansFallbackFull.ttf
# type: int
# fallback_font_size = 15
# type: int
# fallback_font_shadow = 1
# type: int min: 0 max: 255
# fallback_font_shadow_al/*
Minetest
Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation; either version 2.1 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "mapblock.h"
#include <sstream>
#include "map.h"
#include "light.h"
#include "nodedef.h"
#include "nodemetadata.h"
#include "gamedef.h"
#include "log.h"
#include "nameidmapping.h"
#include "content_mapnode.h" // For legacy name-id mapping
#include "content_nodemeta.h" // For legacy deserialization
#include "serialization.h"
#ifndef SERVER
#include "client/mapblock_mesh.h"
#endif
#include "porting.h"
#include "util/string.h"
#include "util/serialize.h"
#include "util/basic_macros.h"
static const char *modified_reason_strings[] = {
"initial",
"reallocate",
"setIsUnderground",
"setLightingExpired",
"setGenerated",
"setNode",
"setNodeNoCheck",
"setTimestamp",
"NodeMetaRef::reportMetadataChange",
"clearAllObjects",
"Timestamp expired (step)",
"addActiveObjectRaw",
"removeRemovedObjects/remove",
"removeRemovedObjects/deactivate",
"Stored list cleared in activateObjects due to overflow",
"deactivateFarObjects: Static data moved in",
"deactivateFarObjects: Static data moved out",
"deactivateFarObjects: Static data changed considerably",
"finishBlockMake: expireDayNightDiff",
"unknown",
};
/*
MapBlock
*/
MapBlock::MapBlock(Map *parent, v3s16 pos, IGameDef *gamedef, bool dummy):
m_parent(parent),
m_pos(pos),
m_pos_relative(pos * MAP_BLOCKSIZE),
m_gamedef(gamedef)
{
if (!dummy)
reallocate();
}
MapBlock::~MapBlock()
{
#ifndef SERVER
{
delete mesh;
mesh = nullptr;
}
#endif
delete[] data;
}
bool MapBlock::isValidPositionParent(v3s16 p)
{
if (isValidPosition(p)) {
return true;
}
return m_parent->isValidPosition(getPosRelative() + p);
}
MapNode MapBlock::getNodeParent(v3s16 p, bool *is_valid_position)
{
if (!isValidPosition(p))
return m_parent->getNode(getPosRelative() + p, is_valid_position);
if (!data) {
if (is_valid_position)
*is_valid_position = false;
return {CONTENT_IGNORE};
}
if (is_valid_position)
*is_valid_position = true;
return data[p.Z * zstride + p.Y * ystride + p.X];
}
std::string MapBlock::getModifiedReasonString()
{
std::string reason;
const u32 ubound = MYMIN(sizeof(m_modified_reason) * CHAR_BIT,
ARRLEN(modified_reason_strings));
for (u32 i = 0; i != ubound; i++) {
if ((m_modified_reason & (1 << i)) == 0)
continue;
reason += modified_reason_strings[i];
reason += ", ";
}
if (reason.length() > 2)
reason.resize(reason.length() - 2);
return reason;
}
void MapBlock::copyTo(VoxelManipulator &dst)
{
v3s16 data_size(MAP_BLOCKSIZE, MAP_BLOCKSIZE, MAP_BLOCKSIZE);
VoxelArea data_area(v3s16(0,0,0), data_size - v3s16(1,1,1));
// Copy from data to VoxelManipulator
dst.copyFrom(data, data_area, v3s16(0,0,0),
getPosRelative(), data_size);
}
void MapBlock::copyFrom(VoxelManipulator &dst)
{
v3s16 data_size(MAP_BLOCKSIZE, MAP_BLOCKSIZE, MAP_BLOCKSIZE);
VoxelArea data_area(v3s16(0,0,0), data_size - v3s16(1,1,1));
// Copy from VoxelManipulator to data
dst.copyTo(data, data_area, v3s16(0,0,0),
getPosRelative(), data_size);
}
void MapBlock::actuallyUpdateDayNightDiff()
{
const NodeDefManager *nodemgr = m_gamedef->ndef();
# instrument.global_callback = true
##### Advanced
# Instrument builtin.
# This is usually only needed by core/builtin contributors
# type: bool
# instrument.builtin = false
# Have the profiler instrument itself:
# * Instrument an empty function.
# This estimates the overhead, that instrumentation is adding (+1 function call).
# * Instrument the sampler being used to update the statistics.
# type: bool
# instrument.profiler = false
#
# Client and Server
#
# Name of the player.
# When running a server, clients connecting with this name are admins.
# When starting from the main menu, this is overridden.
# type: string
# name =
# Set the language. Leave empty to use the system language.
# A restart is required after changing this.
# type: enum values: , be, ca, cs, da, de, dv, en, eo, es, et, fr, he, hu, id, it, ja, jbo, ko, ky, lt, ms, nb, nl, pl, pt, pt_BR, ro, ru, sl, sr_Cyrl, sv, sw, tr, uk, zh_CN, zh_TW
# language =
# Level of logging to be written to debug.txt:
# - (no logging)
# - none (messages with no level)
# - error
# - warning
# - action
# - info
# - verbose
# type: enum values: , none, error, warning, action, info, verbose
# debug_log_level = action
# IPv6 support.
# type: bool
# enable_ipv6 = true
## Advanced
# Default timeout for cURL, stated in milliseconds.
# Only has an effect if compiled with cURL.
# type: int
# curl_timeout = 5000
# Limits number of parallel HTTP requests. Affects:
# - Media fetch if server uses remote_media setting.
# - Serverlist download and server announcement.
# - Downloads performed by main menu (e.g. mod manager).
# Only has an effect if compiled with cURL.
# type: int
# curl_parallel_limit = 8
# Maximum time in ms a file download (e.g. a mod download) may take.
# type: int
# curl_file_download_timeout = 300000
# Makes DirectX work with LuaJIT. Disable if it causes troubles.
# type: bool
# high_precision_fpu = true
# Changes the main menu UI:
# - Full: Multiple singleplayer worlds, game choice, texture pack chooser, etc.
# - Simple: One singleplayer world, no game or texture pack choosers. May be
# necessary for smaller screens.
# type: enum values: full, simple
# main_menu_style = full
# Replaces the default main menu with a custom one.
# type: string
# main_menu_script =
# Print the engine's profiling data in regular intervals (in seconds).
# 0 = disable. Useful for developers.
# type: int
# profiler_print_interval = 0
#
# Mapgen
#
# Name of map generator to be used when creating a new world.
# Creating a world in the main menu will override this.
# Current stable mapgens:
# v5, v6, v7 (except floatlands), singlenode.
# 'stable' means the terrain shape in an existing world will not be changed
# in the future. Note that biomes are defined by games and may still change.
# type: enum values: v5, v6, v7, valleys, carpathian, fractal, flat, singlenode
# mg_name = v7
# Water surface level of the world.
# type: int
# water_level = 1
# From how far blocks are generated for clients, stated in mapblocks (16 nodes).
# type: int
# max_block_generate_distance = 8
# Limit of map generation, in nodes, in all 6 directions from (0, 0, 0).
# Only mapchunks completely within the mapgen limit are generated.
# Value is stored per-world.
# type: int min: 0 max: 31000
# mapgen_limit = 31000
# Global map generation attributes.
# In Mapgen v6 the 'decorations' flag controls all decorations except trees
# and junglegrass, in all other mapgens this flag controls all decorations.
# type: flags possible values: caves, dungeons, light, decorations, biomes, nocaves, nodungeons, nolight, nodecorations, nobiomes
# mg_flags = caves,dungeons,light,decorations,biomes
# Whether dungeons occasionally project from the terrain.
# type: bool
# projecting_dungeons = true
## Biome API temperature and humidity noise parameters
# Temperature variation for biomes.
# type: noise_params_2d
# mg_biome_np_heat = {
# offset = 50,
# scale = 50,
# spread = (1000, 1000, 1000),
# seed = 5349,
# octaves = 3,
# persistence = 0.5,
# lacunarity = 2.0,
# flags = eased
# }
# Small-scale temperature variation for blending biomes on borders.
# type: noise_params_2d
# mg_biome_np_heat_blend = {
# offset = 0,
# scale = 1.5,
# spread = (8, 8, 8),
# seed = 13,
# octaves = 2,
# persistence = 1.0,
# lacunarity = 2.0,
# flags = eased
# }
# Humidity variation for biomes.
# type: noise_params_2d
# mg_biome_np_humidity = {
# offset = 50,
# scale = 50,
# spread = (1000, 1000, 1000),
# seed = 842,
# octaves = 3,
# persistence = 0.5,
# lacunarity = 2.0,
# flags = eased
# }
# Small-scale humidity variation for blending biomes on borders.
# type: noise_params_2d
# mg_biome_np_humidity_blend = {
# offset = 0,
# scale = 1.5,
# spread = (8, 8, 8),
# seed = 90003,
# octaves = 2,
# persistence = 1.0,
# lacunarity = 2.0,
# flags = eased
# }
## Mapgen V5
# Map generation attributes specific to Mapgen v5.
# type: flags possible values: caverns, nocaverns
# mgv5_spflags = caverns
# Controls width of tunnels, a smaller value creates wider tunnels.
# type: float
# mgv5_cave_width = 0.09
# Y of upper limit of large caves.
# type: int
# mgv5_large_cave_depth = -256
# Y of upper limit of lava in large caves.
# type: int
# mgv5_lava_depth = -256
# Y-level of cavern upper limit.
# type: int
# mgv5_cavern_limit = -256
# Y-distance over which caverns expand to full size.
# type: int
# mgv5_cavern_taper = 256
# Defines full size of caverns, smaller values create larger caverns.
# type: float
# mgv5_cavern_threshold = 0.7
# Lower Y limit of dungeons.
# type: int
# mgv5_dungeon_ymin = -31000
# Upper Y limit of dungeons.
# type: int
# mgv5_dungeon_ymax = 31000
### Noises
# Variation of biome filler depth.
# type: noise_params_2d
# mgv5_np_filler_depth = {
# offset = 0,
# scale = 1,
# spread = (150, 150, 150),
# seed = 261,
# octaves = 4,
# persistence = 0.7,
# lacunarity = 2.0,
# flags = eased
# }
# Variation of terrain vertical scale.
# When noise is < -0.55 terrain is near-flat.
# type: noise_params_2d
# mgv5_np_factor = {
# offset = 0,
# scale = 1,
# spread = (250, 250, 250),
# seed = 920381,
# octaves = 3,
# persistence = 0.45,
# lacunarity = 2.0,
# flags = eased
# }
# Y-level of average terrain surface.
# type: noise_params_2d
# mgv5_np_height = {
# offset = 0,
# scale = 10,
# spread = (250, 250, 250),
# seed = 84174,
# octaves = 4,
# persistence = 0.5,
# lacunarity = 2.0,
# flags = eased
# }
# First of two 3D noises that together define tunnels.
# type: noise_params_3d
# mgv5_np_cave1 = {
# offset = 0,
# scale = 12,
# spread = (61, 61, 61),
# seed = 52534,
# octaves = 3,
# persistence = 0.5,
# lacunarity = 2.0,
# flags =
# }
# Second of two 3D noises that together define tunnels.
# type: noise_params_3d
# mgv5_np_cave2 = {
# offset = 0,
# scale = 12,
# spread = (67, 67, 67),
# seed = 10325,
# octaves = 3,
# persistence = 0.5,
# lacunarity = 2.0,
# flags =
# }
# 3D noise defining giant caverns.
# type: noise_params_3d
# mgv5_np_cavern = {
# offset = 0,
# scale = 1,
# spread = (384, 128, 384),
# seed = 723,
# octaves = 5,
# persistence = 0.63,
# lacunarity = 2.0,
# flags =
# }
# 3D noise defining terrain.
# type: noise_params_3d
# mgv5_np_ground = {
# offset = 0,
# scale = 40,
# spread = (80, 80, 80),
# seed = 983240,
# octaves = 4,
# persistence = 0.55,
# lacunarity = 2.0,
# flags = eased
# }
## Mapgen V6
# Map generation attributes specific to Mapgen v6.
# The 'snowbiomes' flag enables the new 5 biome system.
# When the new biome system is enabled jungles are automatically enabled and
# the 'jungles' flag is ignored.
# type: flags possible values: jungles, biomeblend, mudflow, snowbiomes, flat, trees, nojungles, nobiomeblend, nomudflow, nosnowbiomes, noflat, notrees
# mgv6_spflags = jungles,biomeblend,mudflow,snowbiomes,trees
# Deserts occur when np_biome exceeds this value.
# When the new biome system is enabled, this is ignored.
# type: float
# mgv6_freq_desert = 0.45
# Sandy beaches occur when np_beach exceeds this value.
# type: float
# mgv6_freq_beach = 0.15
# Lower Y limit of dungeons.
# type: int
# mgv6_dungeon_ymin = -31000
# Upper Y limit of dungeons.
# type: int
# mgv6_dungeon_ymax = 31000
### Noises
# Y-level of lower terrain and seabed.
# type: noise_params_2d
# mgv6_np_terrain_base = {
# offset = -4,
# scale = 20,
# spread = (250, 250, 250),
# seed = 82341,
# octaves = 5,
# persistence = 0.6,
# lacunarity = 2.0,
# flags = eased
# }
# Y-level of higher terrain that creates cliffs.
# type: noise_params_2d
# mgv6_np_terrain_higher = {
# offset = 20,
# scale = 16,
# spread = (500, 500, 500),
# seed = 85039,
# octaves = 5,
# persistence = 0.6,
# lacunarity = 2.0,
# flags = eased
# }
# Varies steepness of cliffs.
# type: noise_params_2d
# mgv6_np_steepness = {
# offset = 0.85,
# scale = 0.5,
# spread = (125, 125, 125),
# seed = -932,
# octaves = 5,
# persistence = 0.7,
# lacunarity = 2.0,
# flags = eased
# }
# Defines distribution of higher terrain.
# type: noise_params_2d
# mgv6_np_height_select = {
# offset = 0.5,
# scale = 1,
# spread = (250, 250, 250),
# seed = 4213,
# octaves = 5,
# persistence = 0.69,
# lacunarity = 2.0,
# flags = eased
# }
# Varies depth of biome surface nodes.
# type: noise_params_2d
# mgv6_np_mud = {
# offset = 4,
# scale = 2,
# spread = (200, 200, 200),
# seed = 91013,
# octaves = 3,
# persistence = 0.55,
# lacunarity = 2.0,
# flags = eased
# }
# Defines areas with sandy beaches.
# type: noise_params_2d
# mgv6_np_beach = {
# offset = 0,
# scale = 1,
# spread = (250, 250, 250),
# seed = 59420,
# octaves = 3,
# persistence = 0.50,
# lacunarity = 2.0,
# flags = eased
# }
# Temperature variation for biomes.
# type: noise_params_2d
# mgv6_np_biome = {
# offset = 0,
# scale = 1,
# spread = (500, 500, 500),
# seed = 9130,
# octaves = 3,
# persistence = 0.50,
# lacunarity = 2.0,
# flags = eased
# }
# Variation of number of caves.
# type: noise_params_2d
# mgv6_np_cave = {
# offset = 6,
# scale = 6,
# spread = (250, 250, 250),
# seed = 34329,
# octaves = 3,
# persistence = 0.50,
# lacunarity = 2.0,
# flags = eased
# }
# Humidity variation for biomes.
# type: noise_params_2d
# mgv6_np_humidity = {
# offset = 0.5,
# scale = 0.5,
# spread = (500, 500, 500),
# seed = 72384,
# octaves = 3,
# persistence = 0.50,
# lacunarity = 2.0,
# flags = eased
# }
# Defines tree areas and tree density.
# type: noise_params_2d
# mgv6_np_trees = {
# offset = 0,
# scale = 1,
# spread = (125, 125, 125),
# seed = 2,
# octaves = 4,
# persistence = 0.66,
# lacunarity = 2.0,
# flags = eased
# }
# Defines areas where trees have apples.
# type: noise_params_2d
# mgv6_np_apple_trees = {
# offset = 0,
# scale = 1,
# spread = (100, 100, 100),
# seed = 342902,
# octaves = 3,
# persistence = 0.45,
# lacunarity = 2.0,
# flags = eased
# }
## Mapgen V7
# Map generation attributes specific to Mapgen v7.
# 'ridges' enables the rivers.
# type: flags possible values: mountains, ridges, floatlands, caverns, nomountains, noridges, nofloatlands, nocaverns
# mgv7_spflags = mountains,ridges,nofloatlands,caverns
# Y of mountain density gradient zero level. Used to shift mountains vertically.
# type: int
# mgv7_mount_zero_level = 0
# Controls width of tunnels, a smaller value creates wider tunnels.
# type: float
# mgv7_cave_width = 0.09
# Y of upper limit of large caves.
# type: int
# mgv7_large_cave_depth = -33
# Y of upper limit of lava in large caves.
# type: int
# mgv7_lava_depth = -256
# Controls the density of mountain-type floatlands.
# Is a noise offset added to the 'mgv7_np_mountain' noise value.
# type: float
# mgv7_float_mount_density = 0.6
# Typical maximum height, above and below midpoint, of floatland mountains.
# type: float
# mgv7_float_mount_height = 128.0
# Alters how mountain-type floatlands taper above and below midpoint.
# type: float
# mgv7_float_mount_exponent = 0.75
# Y-level of floatland midpoint and lake surface.
# type: int
# mgv7_floatland_level = 1280
# Y-level to which floatland shadows extend.
# type: int
# mgv7_shadow_limit = 1024
# Y-level of cavern upper limit.
# type: int
# mgv7_cavern_limit = -256
# Y-distance over which caverns expand to full size.
# type: int
# mgv7_cavern_taper = 256
# Defines full size of caverns, smaller values create larger caverns.
# type: float
# mgv7_cavern_threshold = 0.7
# Lower Y limit of dungeons.
# type: int
# mgv7_dungeon_ymin = -31000
# Upper Y limit of dungeons.
# type: int
# mgv7_dungeon_ymax = 31000
### Noises
# Y-level of higher terrain that creates cliffs.
# type: noise_params_2d
# mgv7_np_terrain_base = {
# offset = 4,
# scale = 70,
# spread = (600, 600, 600),
# seed = 82341,
# octaves = 5,
# persistence = 0.6,
# lacunarity = 2.0,
# flags = eased
# }
# Y-level of lower terrain and seabed.
# type: noise_params_2d
# mgv7_np_terrain_alt = {
# offset = 4,
# scale = 25,
# spread = (600, 600, 600),
# seed = 5934,
# octaves = 5,
# persistence = 0.6,
# lacunarity = 2.0,
# flags = eased
# }
# Varies roughness of terrain.
# Defines the 'persistence' value for terrain_base and terrain_alt noises.
# type: noise_params_2d
# mgv7_np_terrain_persist = {
# offset = 0.6,
# scale = 0.1,
# spread = (2000, 2000, 2000),
# seed = 539,
# octaves = 3,
# persistence = 0.6,
# lacunarity = 2.0,
# flags = eased
# }
# Defines distribution of higher terrain and steepness of cliffs.
# type: noise_params_2d
# mgv7_np_height_select = {
# offset = -8,
# scale = 16,
# spread = (500, 500, 500),
# seed = 4213,
# octaves = 6,
# persistence = 0.7,
# lacunarity = 2.0,
# flags = eased
# }
# Variation of biome filler depth.
# type: noise_params_2d
# mgv7_np_filler_depth = {
# offset = 0,
# scale = 1.2,
# spread = (150, 150, 150),
# seed = 261,
# octaves = 3,
# persistence = 0.7,
# lacunarity = 2.0,
# flags = eased
# }
# Variation of maximum mountain height (in nodes).
# type: noise_params_2d
# mgv7_np_mount_height = {
# offset = 256,
# scale = 112,
# spread = (1000, 1000, 1000),
# seed = 72449,
# octaves = 3,
# persistence = 0.6,
# lacunarity = 2.0,
# flags = eased
# }
# Defines large-scale river channel structure.
# type: noise_params_2d
# mgv7_np_ridge_uwater = {
# offset = 0,
# scale = 1,
# spread = (1000, 1000, 1000),
# seed = 85039,
# octaves = 5,
# persistence = 0.6,
# lacunarity = 2.0,
# flags = eased
# }
# Defines areas of floatland smooth terrain.
# Smooth floatlands occur when noise > 0.
# type: noise_params_2d
# mgv7_np_floatland_base = {
# offset = -0.6,
# scale = 1.5,
# spread = (600, 600, 600),
# seed = 114,
# octav gamedef->allocateUnknownNodeId(name);
if (global_id == CONTENT_IGNORE) {
unallocatable_contents.insert(name);
previous_exists = false;
continue;
}
}
nodes[i].setContent(global_id);
// Save previous node local_id & global_id result
previous_local_id = local_id;
previous_global_id = global_id;
previous_exists = true;
}
for (const content_t c: unnamed_contents) {
errorstream << "correctBlockNodeIds(): IGNORING ERROR: "
<< "Block contains id " << c
<< " with no name mapping" << std::endl;
}
for (const std::string &node_name: unallocatable_contents) {
errorstream << "correctBlockNodeIds(): IGNORING ERROR: "
<< "Could not allocate global id for node name \""
<< node_name << "\"" << std::endl;
}
}
void MapBlock::serialize(std::ostream &os, u8 version, bool disk)
{
if(!ser_ver_supported(version))
throw VersionMismatchException("ERROR: MapBlock format not supported");
if (!data)
throw SerializationError("ERROR: Not writing dummy block.");
FATAL_ERROR_IF(version < SER_FMT_VER_LOWEST_WRITE, "Serialisation version error");
// First byte
u8 flags = 0;
if(is_underground)
flags |= 0x01;
if(getDayNightDiff())
flags |= 0x02;
if (!m_generated)
flags |= 0x08;
writeU8(os, flags);
if (version >= 27) {
writeU16(os, m_lighting_complete);
}
/*
Bulk node data
*/
NameIdMapping nimap;
if(disk)
{
MapNode *tmp_nodes = new MapNode[nodecount];
for(u32 i=0; i<nodecount; i++)
tmp_nodes[i] = data[i];
getBlockNodeIdMapping(&nimap, tmp_nodes, m_gamedef->ndef());
u8 content_width = 2;
u8 params_width = 2;
writeU8(os, content_width);
writeU8(os, params_width);
MapNode::serializeBulk(os, version, tmp_nodes, nodecount,
content_width, params_width, true);
delete[] tmp_nodes;
}
else
{
u8 content_width = 2;
u8 params_width = 2;
writeU8(os, content_width);
writeU8(os, params_width);
MapNode::serializeBulk(os, version, data, nodecount,
content_width, params_width, true);
}
/*
Node metadata
*/
std::ostringstream oss(std::ios_base::binary);
m_node_metadata.serialize(oss, version, disk);
compressZlib(oss.str(), os);
/*
Data that goes to disk, but not the network
*/
if(disk)
{
if(version <= 24){
// Node timers
m_node_timers.serialize(os, version);
}
// Static objects
m_static_objects.serialize(os);
// Timestamp
writeU32(os, getTimestamp());
// Write block-specific node definition id mapping
nimap.serialize(os);
if(version >= 25){
// Node timers
m_node_timers.serialize(os, version);
}
}
}
void MapBlock::serializeNetworkSpecific(std::ostream &os)
{
if (!data) {
throw SerializationError("ERROR: Not writing dummy block.");
}
writeU8(os, 2); // version
}
void MapBlock::deSerialize(std::istream &is, u8 version, bool disk)
{
if(!ser_ver_supported(version))
throw VersionMismatchException("ERROR: MapBlock format not supported");
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())<<std::endl);
m_day_night_differs_expired = false;
if(version <= 21)
{
deSerialize_pre22(is, version, disk);
return;
}
u8 flags = readU8(is);
is_underground = (flags & 0x01) != 0;
m_day_night_differs = (flags & 0x02) != 0;
if (version < 27)
m_lighting_complete = 0xFFFF;
else
m_lighting_complete = readU16(is);
m_generated = (flags & 0x08) == 0;
/*
Bulk node data
*/
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())
<<": Bulk node data"<<std::endl);
u8 content_width = readU8(is);
u8 params_width = readU8(is);
if(content_width != 1 && content_width != 2)
throw SerializationError("MapBlock::deSerialize(): invalid content_width");
if(params_width != 2)
throw SerializationError("MapBlock::deSerialize(): invalid params_width");
MapNode::deSerializeBulk(is, version, data, nodecount,
content_width, params_width, true);
/*
NodeMetadata
*/
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())
<<": Node metadata"<<std::endl);
// Ignore errors
try {
std::ostringstream oss(std::ios_base::binary);
decompressZlib(is, oss);
std::istringstream iss(oss.str(), std::ios_base::binary);
if (version >= 23)
m_node_metadata.deSerialize(iss, m_gamedef->idef());
else
content_nodemeta_deserialize_legacy(iss,
&m_node_metadata, &m_node_timers,
m_gamedef->idef());
} catch(SerializationError &e) {
warningstream<<"MapBlock::deSerialize(): Ignoring an error"
<<" while deserializing node metadata at ("
<<PP(getPos())<<": "<<e.what()<<std::endl;
}
/*
Data that is only on disk
*/
if(disk)
{
// Node timers
if(version == 23){
// Read unused zero
readU8(is);
}
if(version == 24){
TRACESTREAM(<<"MapBlock::deSerialize "<<PP(getPos())
<<": Node timers (ver==24)"<<std::endl);
m_node_timers.deSerialize(is