Added reseeding for sites

This commit is contained in:
Joshua Barretto 2020-04-25 11:23:46 +01:00
parent 3421b3d8da
commit 1feae79243
2 changed files with 4 additions and 4 deletions

View File

@ -156,8 +156,8 @@ impl FigureMgr {
// TODO: Investigate passing the velocity into the shader so we can at least
// interpolate motion
const MIN_PERFECT_RATE_DIST: f32 = 50.0;
if (i as u64 + tick) % (1
+ ((pos.0.distance_squared(camera.get_focus_pos()).powf(0.25)
if (i as u64 + tick)
% (1 + ((pos.0.distance_squared(camera.get_focus_pos()).powf(0.25)
- MIN_PERFECT_RATE_DIST.powf(0.5))
.max(0.0)
/ 3.0) as u64)

View File

@ -142,10 +142,10 @@ impl Civs {
let world_site = match &site.kind {
SiteKind::Settlement => {
WorldSite::from(Settlement::generate(wpos, Some(ctx.sim), &mut ctx.rng))
WorldSite::from(Settlement::generate(wpos, Some(ctx.sim), &mut ctx.reseed().rng))
},
SiteKind::Dungeon => {
WorldSite::from(Dungeon::generate(wpos, Some(ctx.sim), &mut ctx.rng))
WorldSite::from(Dungeon::generate(wpos, Some(ctx.sim), &mut ctx.reseed().rng))
},
};