Browse Source

Tuned worldgen ever so slightly (it's still pretty bad)

master
Thomas Johnson 3 years ago
parent
commit
5d6ecdfc9e
  1. 5
      src/world/gen.rs

5
src/world/gen.rs

@ -1,4 +1,5 @@
use std::ops::Div;
use rogue_util::coord::{R2i, V2i};
use rogue_util::grid::{Grid};
use rogue_util::raster;
@ -24,7 +25,7 @@ const CIRC_MIN_RAD: isize = 2;
const CIRC_MAX_RAD: isize = 7;
// path strategies: [no path, Bresenham line between centers, orthogonal paths, random paths nearby]
const PATH_STRATEGY_WEIGHTS: [usize; 4] = [15, 0, 0, 1];
const PATH_STRATEGY_WEIGHTS: [usize; 4] = [30, 0, 1, 1];
const USE_RECTANGLE_CENTER_FOR_PATH_END_PROB: f64 = 0.5;
@ -332,7 +333,7 @@ fn carve_between(coords: V2i, rs1: &RoomShape, rs2: &RoomShape) -> Option<Path>
3 =>
{
let brect = R2i::origin_opp(ep1, ep2);
let bcirc = RoomShape::Circ(brect.origin() + brect.dim() / V2i(2, 2), (brect.dim().l2_sq() as f64).sqrt().ceil() as isize);
let bcirc = RoomShape::Circ(brect.origin() + brect.dim() / V2i(2, 2), (brect.dim().l2_sq() as f64).sqrt().div(2.0).ceil() as isize);
let V2i(xd, yd) = brect.dim();
let area = xd * yd;
if area == 0 { return None; }

Loading…
Cancel
Save