Files
mysteriousisland/mods/jvmi_first/constants.lua
T
2026-10-30 21:16:18 -06:00

117 lines
3.3 KiB
Lua

-- Private -----------------------------------------------------------------------------------------
local C = {}
-- Node Definition Constants ---------------------------------------------------
C.ANIMATION_TYPE = {
VERTICAL_FRAMES = "vertical_frames",
SHEET_2D = "sheet_2d",
}
C.DRAW_TYPE = {
ALL_FACES_OPTIONAL = "allfaces_optional",
FLOWING_LIQUID = "flowingliquid",
LIQUID = "liquid",
MESH = "mesh",
NODE_BOX = "nodebox",
NORMAL = "normal",
PLANT_LIKE = "plantlike",
}
C.LIQUID_TYPE = {
NONE = "none",
SOURCE = "source",
FLOWING = "flowing",
}
C.TEXTURE_ALPHA = {
OPAQUE = "opaque",
CLIP = "clip",
BLEND = "blend",
}
C.VISCOSITY = {
XXX_FAST = 0,
XX_FAST = 1,
X_FAST = 2,
FAST = 3,
SLOW = 4,
X_SLOW = 5,
XX_SLOW = 6,
XXX_SLOW = 7,
}
C.WAVING = {
NO = 0,
PLANT_LIKE = 1,
LEAF_LIKE = 2,
LIQUID_LIKE = 3,
}
-- Mapgen Constants ------------------------------------------------------------
--[[ Key altitudes which define the vertical regions of the generated map. ]]--
C.ALTITUDE = {
SKY = 256,
MOUNTAIN = 128,
MOOR = 64,
HILL = 32,
PLAIN = 16,
SURFACE = 0,
SHALLOW = -16,
DEEP = -32,
ABYSS = -64,
BEDROCK = -128,
}
local A = C.ALTITUDE
--[[ The amount of overlap (as a perentage of total weight) between adjacent terrain types. ]]--
C.TERRAIN_BLEND = 0.15
--[[ The distance from the center of the map at which only the lowest terrain types are used. ]]--
C.TERRAIN_RADIUS = 3096
--[[ The noise generator that decides which terrain type is active at a given x,z location. ]]--
C.TERRAIN_TYPE_NOISE_PARAMS = {
flags = "eased",
lacunarity = 2,
octaves = 1,
offset = 0,
persistence = 0.5,
scale = 1.0,
seed = 8381909047,
spread = { x = 512, y = 512, z = 0 },
}
--[[
A table defining the terrain types used in generating the base terrain.
These must be listed in average altitude order from lowest to highest. The weights are merely
relative values, and can be whatever you like. I find it easiest to think of them as
percentages and choose value which tally to 100.
Bear in mind that noise values are adjusted downward are you approach `TERRAIN_RADIUS` meters
from the center of the map, so these weights are only going to be fully reflected in the terrain
generated at the center of the map, and will progressively favor lower altitudes as you move
toward the edges.
]]--
C.TERRAIN_TYPES = {
{ name = "ocean_floor", lowest = A.BEDROCK + 10, highest = A.BEDROCK + 26, weight = 5 },
{ name = "ocean_abyss", lowest = A.ABYSS, highest = A.DEEP, weight = 15 },
{ name = "ocean_shelf", lowest = A.DEEP, highest = A.SHALLOW, weight = 10 },
{ name = "ocean_surface", lowest = A.SURFACE - 4, highest = A.SURFACE, weight = 5 },
{ name = "land_plains", lowest = A.PLAIN - 8, highest = A.PLAIN, weight = 20 },
{ name = "land_hills", lowest = A.HILL - 32, highest = A.HILL, weight = 25 },
{ name = "land_moors", lowest = A.MOOR - 16, highest = A.MOOR, weight = 15 },
{ name = "land_mountains", lowest = A.MOUNTAIN - 80, highest = A.MOUNTAIN, weight = 5 },
}
-- Export ------------------------------------------------------------------------------------------
_G.jvmi.C = C