diff --git a/main.js b/main.js index 224a1fde..f9146b6f 100644 --- a/main.js +++ b/main.js @@ -1635,18 +1635,13 @@ function addZones(number = 1) { cellsArray.push(q); if (cellsArray.length > power) break; - try { - cells.c[q].forEach(e => { - if (used[e]) return; - if (cells.state[e] !== state.i) return; - used[e] = 1; - if (e % 4 !== 0 && !cells.c[e].some(c => cells.state[c] === neib)) return; - queue.push(e); - }); - } catch (er) { - console.error('Error in rebel generation: ', q, cellsArray); - throw er; - } + cells.c[q].forEach(e => { + if (used[e]) return; + if (cells.state[e] !== state.i) return; + used[e] = 1; + if (e % 4 !== 0 && !cells.c[e].some(c => cells.state[c] === neib)) return; + queue.push(e); + }); } const rebels = rw({Rebels: 5, Insurgents: 2, Mutineers: 1, Rioters: 1, Separatists: 1, Secessionists: 1, Insurrection: 2, Rebellion: 1, Conspiracy: 2}); diff --git a/modules/river-generator.js b/modules/river-generator.js index 59a27468..957fe6fc 100644 --- a/modules/river-generator.js +++ b/modules/river-generator.js @@ -35,13 +35,11 @@ window.Rivers = (function () { TIME && console.timeEnd("generateRivers"); function drainWater() { - const pixel2 = distanceScale * distanceScale //const MIN_FLUX_TO_FORM_RIVER = 10 * distanceScale; const MIN_FLUX_TO_FORM_RIVER = 30; const cellsNumberModifier = (pointsInput.dataset.cells / 10000) ** 0.25; const prec = grid.cells.prec; - // const area = c => pack.cells.area[c] * pixel2; const area = pack.cells.area; const land = cells.i.filter(i => h[i] >= 20).sort((a, b) => h[b] - h[a]); const lakeOutCells = Lakes.setClimateData(h); diff --git a/modules/submap.js b/modules/submap.js index f9b70bff..d46be5e9 100644 --- a/modules/submap.js +++ b/modules/submap.js @@ -1,17 +1,29 @@ "use strict"; /* -Experimental submaping module +Cell resampler module used by submapper and resampler (transform) +main function: resample(options); */ window.Submap = (function () { const isWater = (map, id) => map.grid.cells.h[map.pack.cells.g[id]] < 20? true: false; const inMap = (x,y) => x>0 && x0 && y [x',y'] + function resample(parentMap, options) { /* + generate new map based on an existing one (resampling parentMap) + parentMap: {seed, grid, pack} from original map + options = { + projection: f(Number,Number)->[Number, Number] + function to calculate new coordinates + inverse: g(Number,Number)->[Number, Number] + inverse of f + depressRivers: Bool carve out riverbeds? + smoothHeightMap: Bool run smooth filter on heights + addLakesInDepressions: call FMG original funtion on heightmap + + lockMarkers: Bool Auto lock all copied markers + lockBurgs: Bool Auto lock all copied burgs + } + */ const projection = options.projection; const inverse = options.inverse;