mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-05-06 05:41:20 +02:00
Updated Data model (in progress) (markdown)
parent
a116299cc4
commit
f835ac43ae
1 changed files with 107 additions and 73 deletions
|
|
@ -5,6 +5,30 @@ Relevant links:
|
||||||
* [Trello ticket](https://trello.com/c/IWltiMC2/902-rework-save-data-format)
|
* [Trello ticket](https://trello.com/c/IWltiMC2/902-rework-save-data-format)
|
||||||
* [Refactor branch contract changes](https://github.com/Azgaar/Fantasy-Map-Generator/pull/842)
|
* [Refactor branch contract changes](https://github.com/Azgaar/Fantasy-Map-Generator/pull/842)
|
||||||
|
|
||||||
|
Architecture
|
||||||
|
|
||||||
|
The overall desired architecture model is as below:
|
||||||
|
|
||||||
|
```
|
||||||
|
settings
|
||||||
|
│
|
||||||
|
▼
|
||||||
|
GENERATORS
|
||||||
|
│
|
||||||
|
▼
|
||||||
|
WORLD
|
||||||
|
(data + style)
|
||||||
|
│
|
||||||
|
┌─────────────┴─────────────┐
|
||||||
|
▼ ▼
|
||||||
|
EDITORS RENDERERS
|
||||||
|
│ │
|
||||||
|
▼ ▼
|
||||||
|
data mutations SVG or WebGL Canvas
|
||||||
|
```
|
||||||
|
|
||||||
|
All the map-related state should be represented by a single gigantic `map` object. When the `.map` file is saved, the object is transformed into a single json file.
|
||||||
|
|
||||||
Structure:
|
Structure:
|
||||||
|
|
||||||
`.map` file is a valid JSON capturing all data required to render and operate the map, including UI and style settings.
|
`.map` file is a valid JSON capturing all data required to render and operate the map, including UI and style settings.
|
||||||
|
|
@ -27,25 +51,29 @@ Structure:
|
||||||
"revision": 124
|
"revision": 124
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"settings": {
|
"settings": {
|
||||||
"seed": "342342342323",
|
"seed": "342342342323",
|
||||||
"graph": {
|
"graph": {
|
||||||
"width": 1280,
|
"width": 1280,
|
||||||
"heigh": 740,
|
"height": 740,
|
||||||
"points": 50000
|
"points": 50000
|
||||||
},
|
},
|
||||||
|
|
||||||
"heightmap": {
|
"heightmap": {
|
||||||
"template": "Volcano",
|
"template": "Volcano",
|
||||||
"isRandom": false,
|
"isRandom": false,
|
||||||
"isPrecreated": false,
|
"isPrecreated": false,
|
||||||
"isCustom": false
|
"isCustom": false
|
||||||
},
|
},
|
||||||
|
|
||||||
"cultures": {
|
"cultures": {
|
||||||
"set": "Oriental",
|
"set": "Oriental",
|
||||||
"limit": 11,
|
"limit": 11,
|
||||||
"sizeVariety": 2,
|
"sizeVariety": 2,
|
||||||
"growthRate": 1.3
|
"growthRate": 1.3
|
||||||
},
|
},
|
||||||
|
|
||||||
"states": {
|
"states": {
|
||||||
"limit": 14,
|
"limit": 14,
|
||||||
"sizeVariety": 2,
|
"sizeVariety": 2,
|
||||||
|
|
@ -54,23 +82,29 @@ Structure:
|
||||||
"mode": "auto"
|
"mode": "auto"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"provinces": {
|
"provinces": {
|
||||||
"ratio": 30
|
"ratio": 30
|
||||||
},
|
},
|
||||||
|
|
||||||
"burgs": {
|
"burgs": {
|
||||||
"limit": null,
|
"limit": null,
|
||||||
"showMfcgMap": true
|
"showMfcgMap": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"religions": {
|
"religions": {
|
||||||
"limit": 7
|
"limit": 7
|
||||||
},
|
},
|
||||||
|
|
||||||
"labels": {
|
"labels": {
|
||||||
"autoHide": true,
|
"autoHide": true,
|
||||||
"rescaleOnZoom": true
|
"rescaleOnZoom": true
|
||||||
},
|
},
|
||||||
|
|
||||||
"notes": {
|
"notes": {
|
||||||
"pinned": false
|
"pinned": false
|
||||||
},
|
},
|
||||||
|
|
||||||
"scaleBar": {
|
"scaleBar": {
|
||||||
"label": "",
|
"label": "",
|
||||||
"position": {
|
"position": {
|
||||||
|
|
@ -78,36 +112,32 @@ Structure:
|
||||||
"y": 99
|
"y": 99
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"military": {
|
"military": {
|
||||||
"units": {
|
"units": {
|
||||||
"0": {
|
"0": { "name": "infantry" }
|
||||||
"name": "infantry"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"world": {
|
"world": {
|
||||||
"name": "Narnia",
|
"name": "Narnia",
|
||||||
|
|
||||||
"calendar": {
|
"calendar": {
|
||||||
"year": 2024,
|
"year": 2024,
|
||||||
"era": "Test Era",
|
"era": "Test Era",
|
||||||
"eraShort": "TE"
|
"eraShort": "TE"
|
||||||
},
|
},
|
||||||
|
|
||||||
"climate": {
|
"climate": {
|
||||||
"temperature": {
|
"temperature": {
|
||||||
"equator": 30,
|
"equator": 30,
|
||||||
"northPole": -30,
|
"northPole": -30,
|
||||||
"southPole": -25
|
"southPole": -25
|
||||||
},
|
},
|
||||||
"winds": [
|
"winds": [225, 45, 225, 315, 135, 315],
|
||||||
225,
|
|
||||||
45,
|
|
||||||
225,
|
|
||||||
315,
|
|
||||||
135,
|
|
||||||
315
|
|
||||||
],
|
|
||||||
"precipitation": 100
|
"precipitation": 100
|
||||||
},
|
},
|
||||||
|
|
||||||
"geography": {
|
"geography": {
|
||||||
"mapSize": 11,
|
"mapSize": 11,
|
||||||
"latitudeShift": 50,
|
"latitudeShift": 50,
|
||||||
|
|
@ -115,23 +145,12 @@ Structure:
|
||||||
"latN": 34
|
"latN": 34
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"units": {
|
"units": {
|
||||||
"distance": {
|
"distance": { "unit": "m", "scale": 3 },
|
||||||
"unit": "m",
|
"area": { "unit": "square", "scale": 1 },
|
||||||
"scale": 3
|
"height": { "unit": "ft", "exponent": 2 },
|
||||||
},
|
"temperature": { "unit": "°C", "scale": 1 },
|
||||||
"area": {
|
|
||||||
"unit": "square",
|
|
||||||
"scale": 1
|
|
||||||
},
|
|
||||||
"height": {
|
|
||||||
"unit": "ft",
|
|
||||||
"exponent": 2
|
|
||||||
},
|
|
||||||
"temperature": {
|
|
||||||
"unit": "°C",
|
|
||||||
"scale": 1
|
|
||||||
},
|
|
||||||
"population": {
|
"population": {
|
||||||
"scale": 1000,
|
"scale": 1000,
|
||||||
"urbanization": {
|
"urbanization": {
|
||||||
|
|
@ -141,11 +160,13 @@ Structure:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"layers": {
|
"layers": {
|
||||||
"heightmap": false,
|
"heightmap": false,
|
||||||
"states": true
|
"states": true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"style": {
|
"style": {
|
||||||
"scaleBar": {
|
"scaleBar": {
|
||||||
"size": 2,
|
"size": 2,
|
||||||
|
|
@ -153,18 +174,20 @@ Structure:
|
||||||
"backColor": "#ffffff"
|
"backColor": "#ffffff"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"data": {
|
"data": {
|
||||||
|
|
||||||
|
"topology": {
|
||||||
"grid": {
|
"grid": {
|
||||||
"cells": {
|
"cells": {
|
||||||
"i": [],
|
"i": [],
|
||||||
"temp": []
|
"temp": []
|
||||||
},
|
},
|
||||||
"vertices": {
|
"vertices": {
|
||||||
"c": [
|
"c": [[]]
|
||||||
[]
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
"pack": {
|
"pack": {
|
||||||
"cells": {
|
"cells": {
|
||||||
"i": [],
|
"i": [],
|
||||||
|
|
@ -173,11 +196,12 @@ Structure:
|
||||||
"culture": []
|
"culture": []
|
||||||
},
|
},
|
||||||
"vertices": {
|
"vertices": {
|
||||||
"c": [
|
"c": [[]]
|
||||||
[]
|
}
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"geography": {
|
||||||
"biomes": {
|
"biomes": {
|
||||||
"0": {
|
"0": {
|
||||||
"name": "Marine",
|
"name": "Marine",
|
||||||
|
|
@ -185,31 +209,41 @@ Structure:
|
||||||
"cells": 354
|
"cells": 354
|
||||||
},
|
},
|
||||||
"1": {}
|
"1": {}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"civilizations": {
|
||||||
"states": {
|
"states": {
|
||||||
"0": {},
|
"0": {},
|
||||||
"1": {}
|
"1": {}
|
||||||
},
|
},
|
||||||
|
|
||||||
"cultures": {},
|
"cultures": {},
|
||||||
|
|
||||||
|
"religions": {}
|
||||||
|
},
|
||||||
|
|
||||||
|
"settlements": {
|
||||||
|
"burgs": {},
|
||||||
|
"routes": {}
|
||||||
|
},
|
||||||
|
|
||||||
|
"annotations": {
|
||||||
"notes": {
|
"notes": {
|
||||||
"0": {}
|
"0": {}
|
||||||
},
|
},
|
||||||
|
|
||||||
"rulers": {
|
"rulers": {
|
||||||
"0": {
|
"0": {
|
||||||
"i": 0,
|
"i": 0,
|
||||||
"type": "ruler",
|
"type": "ruler",
|
||||||
"points": [
|
"points": [
|
||||||
[
|
[0, 0],
|
||||||
0,
|
[642, 17]
|
||||||
0
|
|
||||||
],
|
|
||||||
[
|
|
||||||
642,
|
|
||||||
17
|
|
||||||
]
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
```
|
```
|
||||||
Loading…
Add table
Add a link
Reference in a new issue