From 402b8eb93c5962194db8d8db63b650e762e532a7 Mon Sep 17 00:00:00 2001 From: Amatsugu Date: Thu, 28 Mar 2024 09:41:25 -0400 Subject: [PATCH] misc --- engine/world_generation/src/hex_utils.rs | 6 ++-- game/main/src/phos.rs | 35 +++++++++++++++++++++++- 2 files changed, 37 insertions(+), 4 deletions(-) diff --git a/engine/world_generation/src/hex_utils.rs b/engine/world_generation/src/hex_utils.rs index 13e01a5..3e1240e 100644 --- a/engine/world_generation/src/hex_utils.rs +++ b/engine/world_generation/src/hex_utils.rs @@ -139,12 +139,12 @@ impl HexCoord { return (hex * -1).zxy(); } - pub fn scale(&self, dir: i32, radius: i32)-> HexCoord{ - let s = Self::DIRECTIONS[dir % 6] * radius; + pub fn scale(&self, dir: i32, radius: usize)-> HexCoord{ + let s = Self::DIRECTIONS[(dir % 6) as usize] * radius as i32; return Self::from_offset(self.hex.xy() + s.xy()); } - pub fn get_neighbor(&self, dir: i32)-> HexCoord{ + pub fn get_neighbor(&self, dir: usize)-> HexCoord{ let d = Self::DIRECTIONS[dir % 6]; return Self::from_offset(self.hex.xy() + d.xy()); } diff --git a/game/main/src/phos.rs b/game/main/src/phos.rs index e76b494..d3a0a25 100644 --- a/game/main/src/phos.rs +++ b/game/main/src/phos.rs @@ -62,8 +62,41 @@ fn create_map( weight_multi: 0., layers: 4, first_layer_mask: false, + },GeneratorLayer { + base_roughness: 2.85, + roughness: 2., + strength: -0.23, + min_value: -0., + persistence: 1., + is_rigid: false, + weight: 0., + weight_multi: 0., + layers: 4, + first_layer_mask: false, + },GeneratorLayer { + base_roughness: 2.6, + roughness: 4., + strength: 10.44, + min_value: 0., + persistence: 1.57, + is_rigid: true, + weight: 1., + weight_multi: 0.35, + layers: 4, + first_layer_mask: true, + },GeneratorLayer { + base_roughness: 3.87, + roughness: 5.8, + strength: -1., + min_value: 0., + persistence: 0., + is_rigid: true, + weight: 1., + weight_multi: 4.57, + layers: 3, + first_layer_mask: true, }], - noise_scale: 250., + noise_scale: 350., sea_level: 4., }, 1,