From 40aa6c599fbae30488cd3312687880e2f5b20e29 Mon Sep 17 00:00:00 2001 From: Fen Dweller Date: Sun, 22 Dec 2019 09:14:02 -0500 Subject: [PATCH] Fix a very silly error that was serious reducing the variance of victim selection. Rather than starting at 0 and working up to a limit, a counter was...starting at the limit. This removed a lot of variance! --- recursive-macro.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/recursive-macro.js b/recursive-macro.js index 68970c5..1cf1259 100644 --- a/recursive-macro.js +++ b/recursive-macro.js @@ -395,7 +395,7 @@ function fill_area(area, weights, variance=0.15) var limit = Math.min(max, 100); var count = 0; - var loopvar = limit; + var loopvar = 0; // for small amounts, actually do the randomness @@ -403,11 +403,6 @@ function fill_area(area, weights, variance=0.15) // if we have nothing at all, it's even better! - if (limit > 0 && result.length == 0) { - ++count; - ++loopvar; - } - while (loopvar < limit) { if (loopvar <= clusters[candidate.name] && loopvar == 0 && Math.random() < cluster_chances[candidate.name]) { ++count;