| … | … | @@ -353,6 +353,7 @@ static void set_param(ErosionWrapperParams& p, const char* k, const char* v) { |
| 353 | 353 | else if (!strcmp(k, "onset_ridge_oct")) p.onset_ridge_oct = f; |
| 354 | 354 | else if (!strcmp(k, "assumed_slope_mag")) p.assumed_slope_mag = f; |
| 355 | 355 | else if (!strcmp(k, "assumed_slope_mix")) p.assumed_slope_mix = f; |
| 356 | else if (!strcmp(k, "field_half_range")) p.field_half_range = f; | |
| 356 | 357 | else { fprintf(stderr, "unknown parameter '%s'\n", k); exit(2); } |
| 357 | 358 | } |
| 358 | 359 |
| … | … | @@ -52,6 +52,7 @@ def map_params(): |
| 52 | 52 | gully, depth = const("EROSION_GULLY_METRES"), const("EROSION_DEPTH_METRES") |
| 53 | 53 | k = const("EROSION_AMPLITUDE_K") |
| 54 | 54 | hs, gain = const("EROSION_HEIGHT_SCALE"), const("EROSION_GAIN") |
| 55 | fhr = const("EROSION_FIELD_HALF_RANGE") | |
| 55 | 56 | oct_ = const("EROSION_OCTAVES") |
| 56 | 57 | # The map's own two derivations, mirrored (map :602 and the erosion_scale line). |
| 57 | 58 | strength = depth * th * cell / (k * gully) |
| … | … | @@ -59,7 +60,8 @@ def map_params(): |
| 59 | 60 | vals = [("floor_y", floor_y), ("ceiling_y", ceil_y), ("terrain_height", th), |
| 60 | 61 | ("en_height_scale", hs), ("en_strength", strength), |
| 61 | 62 | ("en_erosion_scale", escale), ("en_cell_scale", cell), |
| 62 | ("en_octaves", int(oct_)), ("en_gain", gain)] | |
| 63 | ("en_octaves", int(oct_)), ("en_gain", gain), | |
| 64 | ("field_half_range", fhr)] | |
| 63 | 65 | out = [] |
| 64 | 66 | for kk, vv in vals: |
| 65 | 67 | out += ["--set", kk, str(vv)] |
| … | … | @@ -47,6 +47,9 @@ MIXES = [1.0, 0.75, 0.5, 0.25, 0.0] |
| 47 | 47 | FLOOR_Y, CEILING_Y, TERRAIN_HEIGHT = -10900.0, 10100.0, 60000.0 |
| 48 | 48 | GULLY_METRES, DEPTH_METRES = 60.0, 30.0 |
| 49 | 49 | CELL_SCALE, OCTAVES, GAIN, HEIGHT_SCALE = 0.7, 7, 0.5, 5.0 |
| 50 | # The FIELD's half-relief, the SLOPE's vertical unit. Measured over all 841 | |
| 51 | # cached tiles: -4829..5110 m. NOT the playable y_range, which is 2.1x larger. | |
| 52 | FIELD_HALF_RANGE = 4970.0 | |
| 50 | 53 | EROSION_H = (CEILING_Y - FLOOR_Y) * 0.25 * 0.5 # map :313 |
| 51 | 54 | MAP_PARAMS = [ |
| 52 | 55 | ("floor_y", FLOOR_Y), |
| … | … | @@ -58,6 +61,7 @@ MAP_PARAMS = [ |
| 58 | 61 | ("en_cell_scale", CELL_SCALE), |
| 59 | 62 | ("en_octaves", OCTAVES), |
| 60 | 63 | ("en_gain", GAIN), |
| 64 | ("field_half_range", FIELD_HALF_RANGE), | |
| 61 | 65 | ] |
| 62 | 66 | |
| 63 | 67 |