-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmacro_worldgen.py
86 lines (73 loc) · 3.03 KB
/
macro_worldgen.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
"""
A 'Macro' file, which includes names and attributes of a certain aspect of the game
Index 0 for all entries is reserved for the 'NULL' entry, that is to be used in case of something being missing
This file is for parameters used in world generation
"""
# The width and height of the world
# Ratio of 2 - 1 is preferred
LENX = 200
LENY = 100
# The number of tectonic plates to generate.
# 20-40 makes for a chunky distribution, and 60+ makes for a somewhat "gory" distribution
N_PLATES = LENX * LENY // 200
# Approximately what fraction of the world's land should be continental plates
LAND_COVER = 0.35
# How many tiles plates move maximally, with a base velocity, and an extra velocity depending on the type
PLATE_VELOCITY = LENX / 75
CONTINENT_VELOCITY = PLATE_VELOCITY / 2
OCEAN_VELOCITY = PLATE_VELOCITY
# The amount by which elevation increases for each tile going inland
ELEV_GAIN = 10 / LENX
# The elevation units at which the sea ends
SEA_LEVEL = 1.0
# The base elevation units continents have before uplift
CONTINENT_LEVEL = SEA_LEVEL - LENX / 150 * ELEV_GAIN
# The base elevation of rifts between divergent plates
RIFT_LEVEL = CONTINENT_LEVEL - 5 * ELEV_GAIN
# In the below 'geology' macros, there is the chance of a geological feature occurring in a relevant location,
# the elevation gained if the feature occurs, and the elevation spread (shared) to neighboring tiles
MOUNTAIN_CHANCE = 1.0
MOUNTAIN_ELEV = 2.0
MOUNTAIN_SHARING = 0.5
VOLCANO_CHANCE = 1.0
VOLCANO_ELEV = 1.5
VOLCANO_SHARING = 0.3
#ISLAND_CHANCE = 0.2 * 200 / LENX
ISLAND_CHANCE = 1.0
ISLAND_ELEV = CONTINENT_LEVEL - ELEV_GAIN
ISLAND_SHARING = ELEV_GAIN
# The equivalent distance in tiles needed to travel before the rainshadow effect occurs and water is no longer sourced
# from a nearby body
RAINSHADOW_DISTANCE = LENX // 10
# The amount by which an increase in elevation by 1 counts as distance for the rainshadow effect
DISTANCE_PER_ELEV = 20.0
# For the purposes of getting climate temperature, by how much does an elevation unit, above sea level, increase
# the latitude
LATITUDE_PER_ELEV = 7.5
# In the below 'climate' macros, the first list is the upper boundaries in latitude,
# while the second is the index of the quantity
# The second list has one more entry than the first, because the last is if the latitude exceeds any of the others
CLIMATE_EAST_COAST_LATITUDE = [10, 27, 44, 63]
CLIMATE_EAST_COAST_WETNESS = [3, 2, 1, 1, 3]
CLIMATE_WEST_COAST_LATITUDE = [10, 15, 32, 44, 63]
CLIMATE_WEST_COAST_WETNESS = [3, 1, 0, 1, 2, 2]
CLIMATE_TEMPERATURE_LATITUDE = [25, 40, 60, 75]
CLIMATE_TEMPERATURE_CLASS = [4, 3, 2, 1, 0]
# the rows are wetness indices (dry to wet), and the columns are temperatures (cold to hot)
CLIMATE_COMBINATION_MATRIX = [
["I", "u", "p", "d", "d"], # Dry
["I", "u", "p", "g", "S"], # Medium-Dry
["I", "T", "F", "g", "S"], # Medium-Wet
["I", "T", "F", "J", "J"] # Wet
] # ice; cold cool warm hot
WATER_CLIMATE_CONTRIBUTION = {
"I": 1.0,
"u": 1.0,
"T": 1.5,
"p": 0.5,
"d": 0.1,
"F": 1.5,
"g": 1.0,
"S": 1.0,
"J": 1.5
}