started working on temperature range corrections

This commit is contained in:
2026-08-19 13:53:38 -06:00
parent c9a49eba48
commit 44e67966f0
4 changed files with 41 additions and 17 deletions
+10 -5
View File
@@ -8,14 +8,19 @@ Using the heightmap generator from here: https://github.com/TangentFoxy/heightma
- [ ] Remove heightmap library
- [ ] Update ReadMe
- [ ] ReadMe should also point out where the simplex implementation comes from
- [ ] Update the `simplex` library to the latest version with FBM
- [ ] Round the new map generator to a planet shape
- [x] Update the `simplex` library to the latest version with FBM
- [x] Round the new map generator to a planet shape
- [ ] Move `tile_size` out of the map generator (this is a render feature, not a map feature)
- [ ] Turn the new map gen into a wrapper kind of like my heightmap wrapper? (This is sorta already done in a sloppy way.)
- [x] Turn the new map gen into a wrapper kind of like my heightmap wrapper? (This is sorta already done in a sloppy way.)
- [ ] Rebuild the multi-noise map system.
- [ ] Renormalize to Earth extremes. :D (This will probably give bad initial results and need extensive changes.)
- [ ] Use a spreadsheet to map -0.9 to 0.9 to find a mapping function to modify initial values to realistic height ranges!
- [ ] Rename `humidity` to `rainfall`.
- [x] Use a spreadsheet to map -0.9 to 0.9 to find a mapping function to modify initial values to realistic height ranges!
(This was done with -1 to 1)
- [x] Rename `humidity` to `rainfall`.
- [ ] make documentation of how this is all working so I can remember when I forget to work on it for a while
### Long-Term
- [ ] Do all terrain generation within a radius check so unnecessary work isn't done and discarded.
- [ ] Terrain generation steps should happen within a single loop wherever possible?
(Tasks/Issues are stored in the ReadMe instead of using a webUI issue tracker due to how using such a tracker negatively influences portability of the project.)
+17 -1
View File
@@ -26,6 +26,7 @@ dry forest and woodland savanna,
tropical rainforest (evergreen?),
alpine tundra,
montane forests and grasslands,
- what variables control whether it develops a forest or grassland?
alts:
deciduous forest (not evergreen - can be cold or dry to cause leaves to fall; trees, shrubs, perennials),
@@ -36,7 +37,9 @@ high plateaus (flat raised plains),
savanna seems to just mean grassland with some shrubs and trees? (dry)
steppe is grasslands with NO trees (dry, often cold)
meadow is wet grasslands
hypoxic / anoxic waters FROM dead zones (nutrient concentration -> bloom, low water movement, high temperature; deepest waters?), gyre centers (ocean currents)
hypoxic / anoxic waters FORM dead zones (nutrient concentration -> bloom, low water movement, high temperature; deepest waters?), gyre centers (ocean currents)
- use of absolute deepest water as a shortcut should be fine,
- use of highest temperature in water would also be a decent shortcut
("continentalness" may be useful)
@@ -44,3 +47,16 @@ tropical just means low latitude - these are small
montane just means mountain
(one mm of rainfall == 1 L/m^3)
---
coastal forest? (tropical moist broadleaf)
montanes are often forested?
what's the difference between a swamp and marsh? and bog?
I should sprinkle volcanoes in (but that would work better with some kind of fault sim)
- these form jungle/forest easier? more nutrients in soil
what's a moorland?
jungle vs rainforest?
rifts and rivers?
temperature should decrease by 0.0065 per meter (but this only holds above water?)
+8 -10
View File
@@ -8,6 +8,7 @@ local map
love.load = function()
map = map_generator.generate()
print("Temperature Range", map.temperature.min, map.temperature.max)
-- if true then return end
@@ -67,16 +68,13 @@ love.draw = function()
love.graphics.translate(window_width / 2 - (map.size * map.tile_size) / 2 - camera.x, window_height / 2 - (map.size * map.tile_size) / 2 - camera.y)
for x = 1, map.size do
if map.biome[x] then
for y = 1, map.size do
-- print(x, y) -- TEMP why am I getting an out of bounds?
-- local value = map.biome[x][y]
local value = map.temperature[x][y]
if value then
-- love.graphics.setColor(value)
love.graphics.setColor(value, 0, 0, 1)
love.graphics.rectangle("fill", x * map.tile_size, y * map.tile_size, map.tile_size, map.tile_size)
end
for y = 1, map.size do
-- local value = map.biome[x][y]
local value = map.temperature[x][y]
if value then
-- love.graphics.setColor(value)
love.graphics.setColor( (value + 89.2) / (89.2 + 56.7) , 0, 0, 1)
love.graphics.rectangle("fill", x * map.tile_size, y * map.tile_size, map.tile_size, map.tile_size)
end
end
end
+6 -1
View File
@@ -126,7 +126,7 @@ local generate = function()
octaves = 7, lacunarity = 2, gain = 0.5,
}
map.temperature = simplex_map.generate{ -- in celsius
size = map.size, scale = 0.005, min = 0, max = 1, -- min = -89.2, max = 56.7,
size = map.size, scale = 0.005, min = -89.2, max = 56.7,
octaves = 1, lacunarity = 2, gain = 0.5,
}
map.rainfall = simplex_map.generate{ -- in millimeters of rainfall
@@ -173,6 +173,11 @@ local generate = function()
end
end
end
else
-- clear non-planet zones
map.altitude[x][y] = nil
map.temperature[x][y] = nil
map.rainfall[x][y] = nil
end
end
end