Skip to content

Commit bd7be32

Browse files
committed
feat: enhanced population, sky burgs, air routes, geojson exports
- Replace 2-stage burg placement with 6-tier hierarchy (capital, largePort, regionalCenter, marketTown, largeVillage, smallVillage, hamlet) with cultural spacing modifiers and tier-based population ranges - Add flying/skyPort/altitude properties to Burg interface with dedicated skyburg icon group and Sky Realm state support - Add air route generation between sky ports using Urquhart graph with purple dashed styling across all 12 style presets - Fix state statistics double-counting and limit province centers to major settlements (capped at 20 per state) - Create standalone GeoJSON export bookmarklet scripts for burgs, states, provinces, cultures, religions, routes, rivers, cells, markers, and bundled ZIP export - Support up to 100K burgs (Uint16Array -> Uint32Array for cells.burg) and 500K cells (extended density map and slider ranges) - Add nix flake for development dependencies
1 parent be82ddb commit bd7be32

39 files changed

Lines changed: 2242 additions & 67 deletions

flake.lock

Lines changed: 27 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
description = "Azgaar's Fantasy Map Generator";
3+
4+
inputs = {
5+
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
6+
};
7+
8+
outputs =
9+
{ self, nixpkgs }:
10+
{
11+
12+
packages.x86_64-linux.hello = nixpkgs.legacyPackages.x86_64-linux.hello;
13+
14+
packages.x86_64-linux.default = self.packages.x86_64-linux.hello;
15+
16+
};
17+
}

public/main.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ let routes = viewbox.append("g").attr("id", "routes");
6565
let roads = routes.append("g").attr("id", "roads");
6666
let trails = routes.append("g").attr("id", "trails");
6767
let searoutes = routes.append("g").attr("id", "searoutes");
68+
let airroutes = routes.append("g").attr("id", "airroutes");
6869
let temperature = viewbox.append("g").attr("id", "temperature");
6970
let coastline = viewbox.append("g").attr("id", "coastline");
7071
let ice = viewbox.append("g").attr("id", "ice");

public/modules/io/load.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ async function parseLoadedData(data, mapVersion) {
340340
roads = routes.select("#roads");
341341
trails = routes.select("#trails");
342342
searoutes = routes.select("#searoutes");
343+
airroutes = routes.select("#airroutes");
343344
temperature = viewbox.select("#temperature");
344345
coastline = viewbox.select("#coastline");
345346
prec = viewbox.select("#prec");
@@ -393,7 +394,7 @@ async function parseLoadedData(data, mapVersion) {
393394
pack.routes = data[37] ? JSON.parse(data[37]) : [];
394395
pack.zones = data[38] ? JSON.parse(data[38]) : [];
395396
pack.cells.biome = Uint8Array.from(data[16].split(","));
396-
pack.cells.burg = Uint16Array.from(data[17].split(","));
397+
pack.cells.burg = Uint32Array.from(data[17].split(","));
397398
pack.cells.conf = Uint8Array.from(data[18].split(","));
398399
pack.cells.culture = Uint16Array.from(data[19].split(","));
399400
pack.cells.fl = Uint16Array.from(data[20].split(","));

public/modules/resample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ window.Resample = (function () {
7979
pack.cells.pop = new Float32Array(pack.cells.i.length);
8080
pack.cells.culture = new Uint16Array(pack.cells.i.length);
8181
pack.cells.state = new Uint16Array(pack.cells.i.length);
82-
pack.cells.burg = new Uint16Array(pack.cells.i.length);
82+
pack.cells.burg = new Uint32Array(pack.cells.i.length);
8383
pack.cells.religion = new Uint16Array(pack.cells.i.length);
8484
pack.cells.province = new Uint16Array(pack.cells.i.length);
8585

public/modules/submap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ window.Submap = (function () {
130130
const cells = pack.cells;
131131
cells.culture = new Uint16Array(pn);
132132
cells.state = new Uint16Array(pn);
133-
cells.burg = new Uint16Array(pn);
133+
cells.burg = new Uint32Array(pn);
134134
cells.religion = new Uint16Array(pn);
135135
cells.province = new Uint16Array(pn);
136136

public/modules/ui/heightmap-editor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ function editHeightmap(options) {
286286
const pop = new Uint16Array(l);
287287
const routes = {};
288288
const s = new Uint16Array(l);
289-
const burg = new Uint16Array(l);
289+
const burg = new Uint32Array(l);
290290
const state = new Uint16Array(l);
291291
const province = new Uint16Array(l);
292292
const culture = new Uint16Array(l);
@@ -358,7 +358,7 @@ function editHeightmap(options) {
358358
pack.cells.pop = new Float32Array(n);
359359
pack.cells.routes = {};
360360
pack.cells.s = new Uint16Array(n);
361-
pack.cells.burg = new Uint16Array(n);
361+
pack.cells.burg = new Uint32Array(n);
362362
pack.cells.state = new Uint16Array(n);
363363
pack.cells.province = new Uint16Array(n);
364364
pack.cells.culture = new Uint16Array(n);

public/modules/ui/options.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ function updateOutputToFollowInput(ev) {
111111
const value = ev.target.value;
112112

113113
// specific cases
114-
if (id === "manorsInput") return (manorsOutput.value = value == 1000 ? "auto" : value);
114+
if (id === "manorsInput") return (manorsOutput.value = value == 100001 ? "auto" : value);
115115

116116
// generic case
117117
if (id.slice(-5) === "Input") {
@@ -327,7 +327,13 @@ const cellsDensityMap = {
327327
10: 70000,
328328
11: 80000,
329329
12: 90000,
330-
13: 100000
330+
13: 100000,
331+
14: 150000,
332+
15: 200000,
333+
16: 250000,
334+
17: 300000,
335+
18: 400000,
336+
19: 500000
331337
};
332338

333339
function changeCellsDensity(value) {
@@ -339,7 +345,7 @@ function changeCellsDensity(value) {
339345
}
340346

341347
function getCellsDensityColor(cells) {
342-
return cells > 50000 ? "#b12117" : cells !== 10000 ? "#dfdf12" : "#053305";
348+
return cells > 200000 ? "#b12117" : cells > 50000 ? "#df6812" : cells !== 10000 ? "#dfdf12" : "#053305";
343349
}
344350

345351
function changeCultureSet() {
@@ -592,7 +598,7 @@ function randomizeOptions() {
592598
if (randomize || !locked("statesNumber")) statesNumber.value = gauss(18, 5, 2, 30);
593599
if (randomize || !locked("provincesRatio")) provincesRatio.value = gauss(20, 10, 20, 100);
594600
if (randomize || !locked("manors")) {
595-
manorsInput.value = 1000;
601+
manorsInput.value = 100001;
596602
manorsOutput.value = "auto";
597603
}
598604
if (randomize || !locked("religionsNumber")) religionsNumber.value = gauss(6, 3, 2, 10);

public/modules/ui/route-group-editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function editRouteGroups() {
4040
byId("routeGroupsEditorBody").innerHTML = lines.join("");
4141
}
4242

43-
const DEFAULT_GROUPS = ["roads", "trails", "searoutes"];
43+
const DEFAULT_GROUPS = ["roads", "trails", "searoutes", "airroutes"];
4444

4545
function addGroup() {
4646
prompt("Type group name", {default: "route-group-new"}, v => {

public/modules/ui/style-presets.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ function addStylePreset() {
238238
"#roads": ["opacity", "stroke", "stroke-width", "stroke-dasharray", "stroke-linecap", "filter", "mask"],
239239
"#trails": ["opacity", "stroke", "stroke-width", "stroke-dasharray", "stroke-linecap", "filter", "mask"],
240240
"#searoutes": ["opacity", "stroke", "stroke-width", "stroke-dasharray", "stroke-linecap", "filter", "mask"],
241+
"#airroutes": ["opacity", "stroke", "stroke-width", "stroke-dasharray", "stroke-linecap", "filter", "mask"],
241242
"#statesBody": ["opacity", "filter"],
242243
"#statesHalo": ["opacity", "data-width", "stroke-width", "filter"],
243244
"#provs": ["opacity", "fill", "font-size", "font-family", "filter"],

0 commit comments

Comments
 (0)