fucking things up, frozen

This commit is contained in:
tangent committed 2026-08-19 23:46:15 -06:00
1 parent 9c4a492d71
commit 7569a43e7e
2 files changed
+24 -8

No files matched your search

+18 -4
View File
@@ -5,6 +5,13 @@ local simplex_map = require "lib.simplex_map"
local biomes = {
-- biomes are checked in order, with the first candidate always being selected
[800] = {
name = "sea ice",
altitude = {min = -math.huge, max = 0},
temperature = {min = -math.huge, max = -2},
rainfall = {min = -math.huge, max = math.huge},
color = {0.6, 0.6, 1, 1},
},
[900] = {
name = "deep ocean",
altitude = {min = -math.huge, max = -5000},
@@ -19,6 +26,13 @@ local biomes = {
rainfall = {min = -math.huge, max = math.huge},
color = {0, 0, 0.5, 1},
},
[1500] = {
name = "frozen (definition, 0 C)",
altitude = {min = -math.huge, max = math.huge},
temperature = {min = -math.huge, max = 0},
rainfall = {min = -math.huge, max = math.huge},
color = {1, 1, 1, 1},
},
[2000] = {
name = "snowline (middle estimate)",
altitude = {min = 4000, max = math.huge},
@@ -59,8 +73,8 @@ local generate = function()
}
map.temperature = simplex_map.generate{ -- in celsius
-- -20 to 45 chosen by looking at the temperature range shown on https://openclimatemap.org/
size = map.size, scale = 0.005, min = -20, max = 45, -- approximate target extremes of -89.2 to 56.7
octaves = 1, lacunarity = 2, gain = 0.5,
size = map.size, scale = 0.005, min = 20, max = 65, -- approximate target extremes of -89.2 to 56.7
octaves = 2, lacunarity = 2, gain = 0.5,
}
map.rainfall = simplex_map.generate{ -- in millimeters of rainfall
size = map.size, scale = 0.005, -- min = 18, max = 3240,
@@ -103,8 +117,8 @@ local generate = function()
temperature = temperature + altitude / 1000 -- -1 C / km (deep water adjustment)
end
-- modify temperature by latitude
local polar_distance = math.abs(y - (map.size / 2))^1.1 -- experimenting with slight non-linearity
local max_temperature_delta = 40
local polar_distance = math.abs(y - (map.size / 2))^1.3 -- experimenting with slight non-linearity
local max_temperature_delta = 10
temperature = temperature - (polar_distance / map.size * 2 * max_temperature_delta)
-- 'save' temperature changes
map.temperature[x][y] = temperature