Hill
diff --git a/modules/heightmap-generator.js b/modules/heightmap-generator.js
index bdd04b35..accbbbae 100644
--- a/modules/heightmap-generator.js
+++ b/modules/heightmap-generator.js
@@ -8,8 +8,7 @@
const generate = function() {
console.time('generateHeightmap');
- cells = grid.cells;
- p = grid.points;
+ cells = grid.cells, p = grid.points;
cells.h = new Uint8Array(grid.points.length);
const input = document.getElementById("templateInput");
@@ -19,12 +18,13 @@
"High Island": 22,
"Low Island": 10,
"Continents": 20,
- "Archipelago": 32,
+ "Archipelago": 30,
"Mediterranean":3,
"Peninsula": 3,
"Pangea": 2,
"Isthmus": 2,
- "Atoll": 1};
+ "Atoll": 1,
+ "Shattered": 2};
input.value = rw(templates);
}
@@ -39,6 +39,7 @@
case "Peninsula": templatePeninsula(); break;
case "Pangea": templatePangea(); break;
case "Isthmus": templateIsthmus(); break;
+ case "Shattered": templateShattered(); break;
}
console.timeEnd('generateHeightmap');
@@ -193,6 +194,14 @@
addStep("Trough", "4-8", "15-30", "70-100", "80-100");
}
+ // Heighmap Template: Shattered
+ function templateShattered() {
+ addStep("Hill", "8", "35-40", "15-85", "30-70");
+ addStep("Trough", "10-20", "40-50", "5-95", "5-95");
+ addStep("Range", "5-7", "30-40", "10-90", "20-80");
+ addStep("Pit", "12-20", "30-40", "15-85", "20-80");
+ }
+
function getBlobPower() {
switch (+densityInput.value) {
case 1: return .98;
diff --git a/modules/ui/heightmap-editor.js b/modules/ui/heightmap-editor.js
index bb2d1bd0..bb1b6cd0 100644
--- a/modules/ui/heightmap-editor.js
+++ b/modules/ui/heightmap-editor.js
@@ -570,7 +570,7 @@ function getHeight(h) {
if (modules.openTemplateEditor) return;
modules.openTemplateEditor = true;
- $("#templateBody").sortable({items: "div", handle: ".icon-resize-vertical", containment: "parent", axis: "y"});
+ $("#templateBody").sortable({items: "> div", handle: ".icon-resize-vertical", containment: "#templateBody", axis: "y"});
// add listeners
body.addEventListener("click", function(ev) {
@@ -799,6 +799,13 @@ function getHeight(h) {
addStep("Trough", "4-8", "15-30", "70-100", "80-100");
}
+ else if (template === "templateShattered") {
+ addStep("Hill", "8", "35-40", "15-85", "30-70");
+ addStep("Trough", "10-20", "40-50", "5-95", "5-95");
+ addStep("Range", "5-7", "30-40", "10-90", "20-80");
+ addStep("Pit", "12-20", "30-40", "15-85", "20-80");
+ }
+
}
function executeTemplate() {
diff --git a/modules/utils.js b/modules/utils.js
index b18f4da8..e67e6fa9 100644
--- a/modules/utils.js
+++ b/modules/utils.js
@@ -478,7 +478,7 @@ function analizeNamesbase() {
if (string[i] === string[i-1]) doubleArray[string[i]]++;
}
for (const l in doubleArray) {if(doubleArray[l] > size/35) double += l;}
- const multi = rn(d3.mean(d.map(n => (n.match(/ /g)||[]).length)),2);
+ const multi = rn(d3.mean(d.map(n => (n.match(/ /g)||[]).length-1)),2);
result.push({name:b.name, size, min, max, mean, median, common, double, multi});
});
console.table(result);