2019-06-09 10:24:18 +00:00
|
|
|
pub struct Config {
|
|
|
|
pub sea_level: f32,
|
|
|
|
pub mountain_scale: f32,
|
2019-06-11 18:39:25 +00:00
|
|
|
pub snow_temp: f32,
|
2019-07-07 15:56:36 +00:00
|
|
|
pub tropical_temp: f32,
|
2019-06-11 18:39:25 +00:00
|
|
|
pub desert_temp: f32,
|
2019-08-18 16:35:27 +00:00
|
|
|
pub desert_hum: f32,
|
|
|
|
pub forest_hum: f32,
|
|
|
|
pub jungle_hum: f32,
|
2019-10-16 11:39:41 +00:00
|
|
|
/// Rainfall (in meters) per chunk per minute. Default is set to make it approximately
|
|
|
|
/// 1 m rainfall / year uniformly across the whole land area, which is the average rainfall
|
|
|
|
/// on Earth.
|
|
|
|
pub rainfall_chunk_rate: f32,
|
|
|
|
/// Roughness coefficient is an empirical value that controls the rate of energy loss of water
|
|
|
|
/// in a river. The higher it is, the more water slows down as it flows downhill, which
|
|
|
|
/// consequently leads to lower velocities and higher river area for the same flow rate.
|
|
|
|
///
|
|
|
|
/// See https://wwwrcamnl.wr.usgs.gov/sws/fieldmethods/Indirects/nvalues/index.htm.
|
|
|
|
///
|
|
|
|
/// The default is set to over 0.06, which is pretty high but still within a reasonable range for
|
|
|
|
/// rivers. The higher this is, the quicker rivers appear, and since we often will have high
|
|
|
|
/// slopes we want to give rivers as much of a chance as possible. In the future we can set
|
|
|
|
/// this dynamically.
|
|
|
|
///
|
|
|
|
/// NOTE: The values in the link are in seconds / (m^(-1/3)), but we use them without
|
|
|
|
/// conversion as though they are in minutes / (m^(-1/3)). The idea here is that our clock
|
|
|
|
/// speed has time go by at approximately 1 minute per second, but since velocity depends on
|
|
|
|
/// this parameter, we want flow rates to still "look" natural at the second level. The way we
|
|
|
|
/// are cheating is that we still allow the refill rate (via rainfall) of rivers and lakes to
|
|
|
|
/// be specified as though minutes are *really* minutes. This reduces the amount of water
|
|
|
|
/// needed to form a river of a given area by 60, but hopefully this should not feel too
|
|
|
|
/// unnatural since the refill rate is still below what people should be able to perceive.
|
|
|
|
pub river_roughness: f32,
|
|
|
|
/// Maximum width of rivers, in terms of a multiple of the horizontal chunk size.
|
|
|
|
///
|
|
|
|
/// Currently, not known whether setting this above 1.0 will work properly. Please use with
|
|
|
|
/// care!
|
|
|
|
pub river_max_width: f32,
|
|
|
|
/// Minimum height at which rivers display.
|
|
|
|
pub river_min_height: f32,
|
|
|
|
/// Rough desired river width-to-depth ratio (in terms of horizontal chunk width / m, for some
|
|
|
|
/// reason). Not exact.
|
|
|
|
pub river_width_to_depth: f32,
|
2019-06-09 10:24:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub const CONFIG: Config = Config {
|
2019-06-10 16:28:02 +00:00
|
|
|
sea_level: 140.0,
|
2019-10-16 11:39:41 +00:00
|
|
|
mountain_scale: 2048.0,
|
2019-08-21 18:41:32 +00:00
|
|
|
snow_temp: -0.6,
|
2019-08-20 20:48:22 +00:00
|
|
|
tropical_temp: 0.2,
|
2019-11-07 20:25:30 +00:00
|
|
|
desert_temp: 0.6,
|
2019-08-21 18:41:32 +00:00
|
|
|
desert_hum: 0.15,
|
2019-08-19 17:20:54 +00:00
|
|
|
forest_hum: 0.5,
|
2019-08-21 18:41:32 +00:00
|
|
|
jungle_hum: 0.85,
|
2019-10-16 11:39:41 +00:00
|
|
|
rainfall_chunk_rate: 1.0 / 512.0,
|
|
|
|
river_roughness: 0.06125,
|
|
|
|
river_max_width: 2.0,
|
|
|
|
river_min_height: 0.25,
|
|
|
|
river_width_to_depth: 1.0,
|
2019-06-09 10:24:18 +00:00
|
|
|
};
|