This commit is contained in:
Paul Liverman III 2019-03-07 13:27:45 -08:00
commit c7069dfbca
3 changed files with 219 additions and 0 deletions

104
notes.txt Normal file
View File

@ -0,0 +1,104 @@
higher frequency -> more random variation quicker
amplitude (or multiplier) -> how much it adds to the output
---
Rainfall: Dry -> Wet (desert -> rainforest)
Variation (seasonality)
Altitude: Low -> High (deep ocean -> mountains)
Variation (flat -> craggy)
Temperature: Freezing -> Boiling (arctic -> desert)
Variation (seasonality)
Soil: Soft -> Hard (fertile soil -> hard rock)
Variation (seasonality, would only apply for soil?)
---
Spring: warmer, wetter
Summer: dry, hot
Fall: dry, cooling
Winter: cold, wet
Vegetation: None -> Covered (barren -> rainforest)
Variation (seasonality)
Rainforest: >0.75 rain, >0.5 and <0.75 temperature
Desert: <0.25 rain, >0.6 or <0.3 temperature
Tundra: <0.25 temperature, <0.5 rain
Taiga: <0.1 temperature, >0.25 rain?
Grassland: <0.4 and >0.25 rain, >0.25 temperature
Savanna: >0.4 and <0.6? rain, >0.25 temperature
Tropical Rainforest: wet & wetter seasons, warm year-round
Temperate Forest: four distinct seasons (fall, winter, spring, summer)
Desert: rare rain, extreme heat and cold
Tundra: flat and cold, shallow soil and permafrost below it, growth only in summer
Taiga: long cold winters, needle-leaf trees
Grassland: just wet enough for grasses, herbs, and herbavores to survive
Savanna: slightly wetter than grassland, some trees appear, tall-legged animals
Freshwater: lakes, streams, rivers
Marine: salt-water oceans
Temperature should change based on height.
Cold, dry, green. Biome categories separated by temperature.
(Should also separate based on waterfall?)
Aquatic vs land. Dry vs wet. Lush?
MC biomes:
- Snowy Tundra
- Ice Spikes
- Snowy Taiga
- Snowy Taiga Mountains
- Frozen River
- Snowy Beach
- Mountains
- Gravelly Mountains
- Wooded Mountains
- Taiga
- Taiga Mountains
- Giant Tree Taiga
- Giant Spruce Taiga
- Stone Shore
- Plains
- Sunflower Plains
- Forest
- Flower Forest
- Birch Forest
- Tall Birch Forest
- Dark Forest
- Dark Forest Hills
- Swamp
- Swamp Hills
- Jungle
- Modified Jungle
- Jungle Edge
- Modified Jungle Edge
- River
- Beach
- Mushroom Fields
- Mushroom Field Shore
- The End
- Small End Islands
- End Midlands
- End Highlands
- End Barrens
- Desert
- Desert Lakes
- Savanna
- Shattered Savanna
- Badlands
- Eroded Badlands
- Wooded Badlands Plateau
- Modified Wooded Badlands Plateau
- Plateau
- Modified Plateau (much more shattered)
- Nether
- Warm Ocean
- Lukewarm Ocean
- Deep Lukewarm Ocean
- Ocean
- Deep Ocean
- Cold Ocean
- Deep Cold Ocean
- Frozen Ocean
- Deep Frozen Ocean
- The Void
- * Hills

66
src/main.moon Normal file
View File

@ -0,0 +1,66 @@
w, h = love.graphics.getDimensions!
cellSize = 5
-- Rainfall: Dry -> Wet (desert -> rainforest)
-- Variation (seasonality)
-- Altitude: Low -> High (deep ocean -> mountains)
-- Variation (flat -> craggy)
-- Temperature: Freezing -> Boiling (arctic -> desert)
-- Variation (seasonality)
-- Soil: Soft -> Hard (fertile soil -> hard rock)
-- Variation (seasonality, would only apply for soil?)
colors = {
desert: { 255/255, 210/255, 33/255, 1 }
ocean: { 73/255, 132/255, 252/255, 1 }
mountains: { 140/255, 58/255, 0, 1 }
"tropical rainforest": { 8/255, 71/255, 0, 1}
tundra: { 196/255, 0, 26/255, 1 }
taiga: { 175/255, 45/255, 63/255, 1 }
grassland: { 38/255, 160/255, 1/255, 1 }
savanna: { 183/255, 141/255, 14/255, 1 }
}
biomes = {
desert: { precipitation: { 0, 0.2 } }
ocean: { altitude: { 0, 1/3 } }
mountains: { altitude: { 0.8, 1 } }
"tropical rainforest": { precipitation: { 0.8, 1 }, temperature: { 0.8, 1, variation: { 0, 0.2 } } }
tundra: { altitude: { 0, 1, variation: { 0, 0.1 } }, temperature: { 0, 1/3 } }
taiga: { temperature: { 0.1, 1/3, variation: { 0, 1/3 } }, precipitation: { 0.2, 0.5 } }
grassland: { precipitation: { 0.2, 1/3 } }
savanna: { precipitation: { 1/3, 0.42 } }
}
-- Temperate Forest: four distinct seasons (fall, winter, spring, summer)
-- Freshwater: lakes, streams, rivers
-- Marine: salt-water oceans
map = {}
map.set = (x, y, v) ->
map[x] = {} unless map[x]
map[x][y] = v
map.get = (x, y) ->
if map[x]
return map[x][y] or { 0, 0, 0, 1 }
else
return { 0, 0, 0, 1 }
love.load = ->
for x = 1, w / cellSize
for y = 1, h / cellSize
r = love.math.noise x / 10, y / 10
map.set x, y, { r, r, r, 1 }
love.draw = ->
for x = 1, w / cellSize
for y = 1, h / cellSize
love.graphics.setColor map.get x, y
love.graphics.rectangle "fill", (x - 1) * cellSize, (y - 1) * cellSize, cellSize, cellSize
love.graphics.setColor 0, 0, 0, 1/3
love.graphics.rectangle "fill", 0, 0, w, 16
love.graphics.setColor 1, 1, 1, 1
love.graphics.print love.timer.getFPS!
love.keypressed = (key) -> love.event.quit!

49
tmp/main.moon Normal file
View File

@ -0,0 +1,49 @@
p = {}
scale = 200
for i=1,5000
t = love.math.random!
r = love.math.random!
if r > t
tmp = r
r = t
t = tmp
table.insert p, t
table.insert p, r
love.draw = ->
love.graphics.translate 0, scale
love.graphics.scale scale, -scale
-- love.graphics.points p
for i = 1, #p - 1, 2
t = p[i]
r = p[i+1]
R = 2/3 - r - (t - 1)
G = 2/3 + t / 3 - r / 4
B = 1 - t - r
if true
n = (G + B) / 2
R = (R + n * 2) / 2
G = (G + n) / 2
B = (B + n) / 2
if false and t - r * 5 > 0
R = (R + G) / 2
G = R - 0.2
if false and r > t * 3/4
n = R - (1 - t)
R = (R + n) / 2
if true
--R -= t - 1
G -= (t - 1) / 5
if false
R = 1
G = 0
B = 0
love.graphics.setColor R, G, B, 1
love.graphics.points t, r
love.keypressed = (key) ->
love.event.quit! if key == "escape"