feat: add initial Pokémon map data and loader

- Introduced a new JSON file `map_pokemon_v1.json` containing detailed city data for the Pokémon map, including attributes like population, agriculture, commerce, and connections.
- Implemented a map loader in `mapLoader.ts` to read and parse map definitions from JSON files, allowing for dynamic loading of map data.
- Created a script `generate-map-data.mjs` to convert legacy PHP map data into the new JSON format, ensuring compatibility with the updated map system.
This commit is contained in:
2025-12-29 05:59:15 +00:00
parent 9fe4c8f96c
commit 124b070dc9
12 changed files with 23074 additions and 109 deletions
File diff suppressed because it is too large Load Diff
+2968
View File
@@ -0,0 +1,2968 @@
{
"id": "chess",
"name": "chess",
"cities": [
{
"id": 1,
"name": "A1",
"level": 6,
"region": 3,
"position": {
"x": 350.2,
"y": 420.2
},
"connections": [
9,
2,
10
],
"max": {
"population": 800000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"A2",
"B1",
"B2"
]
}
},
{
"id": 2,
"name": "B1",
"level": 6,
"region": 4,
"position": {
"x": 392.7,
"y": 395.6
},
"connections": [
1,
9,
10,
3,
11
],
"max": {
"population": 800000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"A1",
"A2",
"B2",
"C1",
"C2"
]
}
},
{
"id": 3,
"name": "C1",
"level": 6,
"region": 5,
"position": {
"x": 435.2,
"y": 371.1
},
"connections": [
2,
10,
11,
4,
12
],
"max": {
"population": 800000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"B1",
"B2",
"C2",
"D1",
"D2"
]
}
},
{
"id": 4,
"name": "D1",
"level": 8,
"region": 1,
"position": {
"x": 477.7,
"y": 346.5
},
"connections": [
3,
11,
12,
5,
13
],
"max": {
"population": 1200000,
"agriculture": 12000,
"commerce": 12000,
"security": 12000,
"defence": 12000,
"wall": 12000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"C1",
"C2",
"D2",
"E1",
"E2"
]
}
},
{
"id": 5,
"name": "E1",
"level": 7,
"region": 2,
"position": {
"x": 520.2,
"y": 322
},
"connections": [
4,
12,
13,
6,
14
],
"max": {
"population": 1000000,
"agriculture": 10000,
"commerce": 10000,
"security": 10000,
"defence": 10000,
"wall": 10000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"D1",
"D2",
"E2",
"F1",
"F2"
]
}
},
{
"id": 6,
"name": "F1",
"level": 6,
"region": 5,
"position": {
"x": 562.7,
"y": 297.5
},
"connections": [
5,
13,
14,
7,
15
],
"max": {
"population": 800000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"E1",
"E2",
"F2",
"G1",
"G2"
]
}
},
{
"id": 7,
"name": "G1",
"level": 6,
"region": 4,
"position": {
"x": 605.2,
"y": 272.9
},
"connections": [
6,
14,
15,
8,
16
],
"max": {
"population": 800000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"F1",
"F2",
"G2",
"H1",
"H2"
]
}
},
{
"id": 8,
"name": "H1",
"level": 6,
"region": 3,
"position": {
"x": 647.7,
"y": 248.4
},
"connections": [
7,
15,
16
],
"max": {
"population": 800000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"G1",
"G2",
"H2"
]
}
},
{
"id": 9,
"name": "A2",
"level": 5,
"region": 6,
"position": {
"x": 307.7,
"y": 395.6
},
"connections": [
1,
17,
2,
10,
18
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"A1",
"A3",
"B1",
"B2",
"B3"
]
}
},
{
"id": 10,
"name": "B2",
"level": 5,
"region": 6,
"position": {
"x": 350.2,
"y": 371.1
},
"connections": [
1,
9,
17,
2,
18,
3,
11,
19
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"A1",
"A2",
"A3",
"B1",
"B3",
"C1",
"C2",
"C3"
]
}
},
{
"id": 11,
"name": "C2",
"level": 5,
"region": 6,
"position": {
"x": 392.7,
"y": 346.5
},
"connections": [
2,
10,
18,
3,
19,
4,
12,
20
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"B1",
"B2",
"B3",
"C1",
"C3",
"D1",
"D2",
"D3"
]
}
},
{
"id": 12,
"name": "D2",
"level": 5,
"region": 6,
"position": {
"x": 435.2,
"y": 322
},
"connections": [
3,
11,
19,
4,
20,
5,
13,
21
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"C1",
"C2",
"C3",
"D1",
"D3",
"E1",
"E2",
"E3"
]
}
},
{
"id": 13,
"name": "E2",
"level": 5,
"region": 6,
"position": {
"x": 477.7,
"y": 297.5
},
"connections": [
4,
12,
20,
5,
21,
6,
14,
22
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"D1",
"D2",
"D3",
"E1",
"E3",
"F1",
"F2",
"F3"
]
}
},
{
"id": 14,
"name": "F2",
"level": 5,
"region": 6,
"position": {
"x": 520.2,
"y": 272.9
},
"connections": [
5,
13,
21,
6,
22,
7,
15,
23
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"E1",
"E2",
"E3",
"F1",
"F3",
"G1",
"G2",
"G3"
]
}
},
{
"id": 15,
"name": "G2",
"level": 5,
"region": 6,
"position": {
"x": 562.7,
"y": 248.4
},
"connections": [
6,
14,
22,
7,
23,
8,
16,
24
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"F1",
"F2",
"F3",
"G1",
"G3",
"H1",
"H2",
"H3"
]
}
},
{
"id": 16,
"name": "H2",
"level": 5,
"region": 6,
"position": {
"x": 605.2,
"y": 223.8
},
"connections": [
7,
15,
23,
8,
24
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"G1",
"G2",
"G3",
"H1",
"H3"
]
}
},
{
"id": 17,
"name": "A3",
"level": 2,
"region": 7,
"position": {
"x": 265.2,
"y": 371.1
},
"connections": [
9,
25,
10,
18,
26
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"A2",
"A4",
"B2",
"B3",
"B4"
]
}
},
{
"id": 18,
"name": "B3",
"level": 1,
"region": 7,
"position": {
"x": 307.7,
"y": 346.5
},
"connections": [
9,
17,
25,
10,
26,
11,
19,
27
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"A2",
"A3",
"A4",
"B2",
"B4",
"C2",
"C3",
"C4"
]
}
},
{
"id": 19,
"name": "C3",
"level": 2,
"region": 7,
"position": {
"x": 350.2,
"y": 322
},
"connections": [
10,
18,
26,
11,
27,
12,
20,
28
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"B2",
"B3",
"B4",
"C2",
"C4",
"D2",
"D3",
"D4"
]
}
},
{
"id": 20,
"name": "D3",
"level": 1,
"region": 7,
"position": {
"x": 392.7,
"y": 297.5
},
"connections": [
11,
19,
27,
12,
28,
13,
21,
29
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"C2",
"C3",
"C4",
"D2",
"D4",
"E2",
"E3",
"E4"
]
}
},
{
"id": 21,
"name": "E3",
"level": 2,
"region": 7,
"position": {
"x": 435.2,
"y": 272.9
},
"connections": [
12,
20,
28,
13,
29,
14,
22,
30
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"D2",
"D3",
"D4",
"E2",
"E4",
"F2",
"F3",
"F4"
]
}
},
{
"id": 22,
"name": "F3",
"level": 1,
"region": 7,
"position": {
"x": 477.7,
"y": 248.4
},
"connections": [
13,
21,
29,
14,
30,
15,
23,
31
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"E2",
"E3",
"E4",
"F2",
"F4",
"G2",
"G3",
"G4"
]
}
},
{
"id": 23,
"name": "G3",
"level": 2,
"region": 7,
"position": {
"x": 520.2,
"y": 223.8
},
"connections": [
14,
22,
30,
15,
31,
16,
24,
32
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"F2",
"F3",
"F4",
"G2",
"G4",
"H2",
"H3",
"H4"
]
}
},
{
"id": 24,
"name": "H3",
"level": 1,
"region": 7,
"position": {
"x": 562.7,
"y": 199.3
},
"connections": [
15,
23,
31,
16,
32
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"G2",
"G3",
"G4",
"H2",
"H4"
]
}
},
{
"id": 25,
"name": "A4",
"level": 1,
"region": 7,
"position": {
"x": 222.7,
"y": 346.5
},
"connections": [
17,
33,
18,
26,
34
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"A3",
"A5",
"B3",
"B4",
"B5"
]
}
},
{
"id": 26,
"name": "B4",
"level": 2,
"region": 7,
"position": {
"x": 265.2,
"y": 322
},
"connections": [
17,
25,
33,
18,
34,
19,
27,
35
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"A3",
"A4",
"A5",
"B3",
"B5",
"C3",
"C4",
"C5"
]
}
},
{
"id": 27,
"name": "C4",
"level": 1,
"region": 7,
"position": {
"x": 307.7,
"y": 297.5
},
"connections": [
18,
26,
34,
19,
35,
20,
28,
36
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"B3",
"B4",
"B5",
"C3",
"C5",
"D3",
"D4",
"D5"
]
}
},
{
"id": 28,
"name": "D4",
"level": 2,
"region": 7,
"position": {
"x": 350.2,
"y": 272.9
},
"connections": [
19,
27,
35,
20,
36,
21,
29,
37
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"C3",
"C4",
"C5",
"D3",
"D5",
"E3",
"E4",
"E5"
]
}
},
{
"id": 29,
"name": "E4",
"level": 1,
"region": 7,
"position": {
"x": 392.7,
"y": 248.4
},
"connections": [
20,
28,
36,
21,
37,
22,
30,
38
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"D3",
"D4",
"D5",
"E3",
"E5",
"F3",
"F4",
"F5"
]
}
},
{
"id": 30,
"name": "F4",
"level": 2,
"region": 7,
"position": {
"x": 435.2,
"y": 223.8
},
"connections": [
21,
29,
37,
22,
38,
23,
31,
39
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"E3",
"E4",
"E5",
"F3",
"F5",
"G3",
"G4",
"G5"
]
}
},
{
"id": 31,
"name": "G4",
"level": 1,
"region": 7,
"position": {
"x": 477.7,
"y": 199.3
},
"connections": [
22,
30,
38,
23,
39,
24,
32,
40
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"F3",
"F4",
"F5",
"G3",
"G5",
"H3",
"H4",
"H5"
]
}
},
{
"id": 32,
"name": "H4",
"level": 2,
"region": 7,
"position": {
"x": 520.2,
"y": 174.8
},
"connections": [
23,
31,
39,
24,
40
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"G3",
"G4",
"G5",
"H3",
"H5"
]
}
},
{
"id": 33,
"name": "A5",
"level": 2,
"region": 7,
"position": {
"x": 180.2,
"y": 322
},
"connections": [
25,
41,
26,
34,
42
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"A4",
"A6",
"B4",
"B5",
"B6"
]
}
},
{
"id": 34,
"name": "B5",
"level": 1,
"region": 7,
"position": {
"x": 222.7,
"y": 297.5
},
"connections": [
25,
33,
41,
26,
42,
27,
35,
43
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"A4",
"A5",
"A6",
"B4",
"B6",
"C4",
"C5",
"C6"
]
}
},
{
"id": 35,
"name": "C5",
"level": 2,
"region": 7,
"position": {
"x": 265.2,
"y": 272.9
},
"connections": [
26,
34,
42,
27,
43,
28,
36,
44
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"B4",
"B5",
"B6",
"C4",
"C6",
"D4",
"D5",
"D6"
]
}
},
{
"id": 36,
"name": "D5",
"level": 1,
"region": 7,
"position": {
"x": 307.7,
"y": 248.4
},
"connections": [
27,
35,
43,
28,
44,
29,
37,
45
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"C4",
"C5",
"C6",
"D4",
"D6",
"E4",
"E5",
"E6"
]
}
},
{
"id": 37,
"name": "E5",
"level": 2,
"region": 7,
"position": {
"x": 350.2,
"y": 223.8
},
"connections": [
28,
36,
44,
29,
45,
30,
38,
46
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"D4",
"D5",
"D6",
"E4",
"E6",
"F4",
"F5",
"F6"
]
}
},
{
"id": 38,
"name": "F5",
"level": 1,
"region": 7,
"position": {
"x": 392.7,
"y": 199.3
},
"connections": [
29,
37,
45,
30,
46,
31,
39,
47
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"E4",
"E5",
"E6",
"F4",
"F6",
"G4",
"G5",
"G6"
]
}
},
{
"id": 39,
"name": "G5",
"level": 2,
"region": 7,
"position": {
"x": 435.2,
"y": 174.8
},
"connections": [
30,
38,
46,
31,
47,
32,
40,
48
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"F4",
"F5",
"F6",
"G4",
"G6",
"H4",
"H5",
"H6"
]
}
},
{
"id": 40,
"name": "H5",
"level": 1,
"region": 7,
"position": {
"x": 477.7,
"y": 150.2
},
"connections": [
31,
39,
47,
32,
48
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"G4",
"G5",
"G6",
"H4",
"H6"
]
}
},
{
"id": 41,
"name": "A6",
"level": 1,
"region": 7,
"position": {
"x": 137.7,
"y": 297.5
},
"connections": [
33,
49,
34,
42,
50
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"A5",
"A7",
"B5",
"B6",
"B7"
]
}
},
{
"id": 42,
"name": "B6",
"level": 2,
"region": 7,
"position": {
"x": 180.2,
"y": 272.9
},
"connections": [
33,
41,
49,
34,
50,
35,
43,
51
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"A5",
"A6",
"A7",
"B5",
"B7",
"C5",
"C6",
"C7"
]
}
},
{
"id": 43,
"name": "C6",
"level": 1,
"region": 7,
"position": {
"x": 222.7,
"y": 248.4
},
"connections": [
34,
42,
50,
35,
51,
36,
44,
52
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"B5",
"B6",
"B7",
"C5",
"C7",
"D5",
"D6",
"D7"
]
}
},
{
"id": 44,
"name": "D6",
"level": 2,
"region": 7,
"position": {
"x": 265.2,
"y": 223.8
},
"connections": [
35,
43,
51,
36,
52,
37,
45,
53
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"C5",
"C6",
"C7",
"D5",
"D7",
"E5",
"E6",
"E7"
]
}
},
{
"id": 45,
"name": "E6",
"level": 1,
"region": 7,
"position": {
"x": 307.7,
"y": 199.3
},
"connections": [
36,
44,
52,
37,
53,
38,
46,
54
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"D5",
"D6",
"D7",
"E5",
"E7",
"F5",
"F6",
"F7"
]
}
},
{
"id": 46,
"name": "F6",
"level": 2,
"region": 7,
"position": {
"x": 350.2,
"y": 174.8
},
"connections": [
37,
45,
53,
38,
54,
39,
47,
55
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"E5",
"E6",
"E7",
"F5",
"F7",
"G5",
"G6",
"G7"
]
}
},
{
"id": 47,
"name": "G6",
"level": 1,
"region": 7,
"position": {
"x": 392.7,
"y": 150.2
},
"connections": [
38,
46,
54,
39,
55,
40,
48,
56
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"F5",
"F6",
"F7",
"G5",
"G7",
"H5",
"H6",
"H7"
]
}
},
{
"id": 48,
"name": "H6",
"level": 2,
"region": 7,
"position": {
"x": 435.2,
"y": 125.7
},
"connections": [
39,
47,
55,
40,
56
],
"max": {
"population": 400000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 4000,
"wall": 4000
},
"initial": {
"population": 5000,
"agriculture": 100,
"commerce": 100,
"security": 100,
"defence": 500,
"wall": 500
},
"meta": {
"source": "legacy",
"connectionNames": [
"G5",
"G6",
"G7",
"H5",
"H7"
]
}
},
{
"id": 49,
"name": "A7",
"level": 5,
"region": 6,
"position": {
"x": 95.2,
"y": 272.9
},
"connections": [
41,
57,
42,
50,
58
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"A6",
"A8",
"B6",
"B7",
"B8"
]
}
},
{
"id": 50,
"name": "B7",
"level": 5,
"region": 6,
"position": {
"x": 137.7,
"y": 248.4
},
"connections": [
41,
49,
57,
42,
58,
43,
51,
59
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"A6",
"A7",
"A8",
"B6",
"B8",
"C6",
"C7",
"C8"
]
}
},
{
"id": 51,
"name": "C7",
"level": 5,
"region": 6,
"position": {
"x": 180.2,
"y": 223.8
},
"connections": [
42,
50,
58,
43,
59,
44,
52,
60
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"B6",
"B7",
"B8",
"C6",
"C8",
"D6",
"D7",
"D8"
]
}
},
{
"id": 52,
"name": "D7",
"level": 5,
"region": 6,
"position": {
"x": 222.7,
"y": 199.3
},
"connections": [
43,
51,
59,
44,
60,
45,
53,
61
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"C6",
"C7",
"C8",
"D6",
"D8",
"E6",
"E7",
"E8"
]
}
},
{
"id": 53,
"name": "E7",
"level": 5,
"region": 6,
"position": {
"x": 265.2,
"y": 174.8
},
"connections": [
44,
52,
60,
45,
61,
46,
54,
62
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"D6",
"D7",
"D8",
"E6",
"E8",
"F6",
"F7",
"F8"
]
}
},
{
"id": 54,
"name": "F7",
"level": 5,
"region": 6,
"position": {
"x": 307.7,
"y": 150.2
},
"connections": [
45,
53,
61,
46,
62,
47,
55,
63
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"E6",
"E7",
"E8",
"F6",
"F8",
"G6",
"G7",
"G8"
]
}
},
{
"id": 55,
"name": "G7",
"level": 5,
"region": 6,
"position": {
"x": 350.2,
"y": 125.7
},
"connections": [
46,
54,
62,
47,
63,
48,
56,
64
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"F6",
"F7",
"F8",
"G6",
"G8",
"H6",
"H7",
"H8"
]
}
},
{
"id": 56,
"name": "H7",
"level": 5,
"region": 6,
"position": {
"x": 392.7,
"y": 101.1
},
"connections": [
47,
55,
63,
48,
64
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"G6",
"G7",
"G8",
"H6",
"H8"
]
}
},
{
"id": 57,
"name": "A8",
"level": 6,
"region": 3,
"position": {
"x": 52.7,
"y": 248.4
},
"connections": [
49,
50,
58
],
"max": {
"population": 600000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"A7",
"B7",
"B8"
]
}
},
{
"id": 58,
"name": "B8",
"level": 6,
"region": 4,
"position": {
"x": 95.2,
"y": 223.8
},
"connections": [
49,
57,
50,
51,
59
],
"max": {
"population": 800000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"A7",
"A8",
"B7",
"C7",
"C8"
]
}
},
{
"id": 59,
"name": "C8",
"level": 6,
"region": 5,
"position": {
"x": 137.7,
"y": 199.3
},
"connections": [
50,
58,
51,
52,
60
],
"max": {
"population": 800000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"B7",
"B8",
"C7",
"D7",
"D8"
]
}
},
{
"id": 60,
"name": "D8",
"level": 8,
"region": 1,
"position": {
"x": 180.2,
"y": 174.8
},
"connections": [
51,
59,
52,
53,
61
],
"max": {
"population": 800000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"C7",
"C8",
"D7",
"E7",
"E8"
]
}
},
{
"id": 61,
"name": "E8",
"level": 7,
"region": 2,
"position": {
"x": 222.7,
"y": 150.2
},
"connections": [
52,
60,
53,
54,
62
],
"max": {
"population": 1200000,
"agriculture": 12000,
"commerce": 12000,
"security": 12000,
"defence": 12000,
"wall": 12000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"D7",
"D8",
"E7",
"F7",
"F8"
]
}
},
{
"id": 62,
"name": "F8",
"level": 6,
"region": 5,
"position": {
"x": 265.2,
"y": 125.7
},
"connections": [
53,
61,
54,
55,
63
],
"max": {
"population": 1000000,
"agriculture": 10000,
"commerce": 10000,
"security": 10000,
"defence": 10000,
"wall": 10000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"E7",
"E8",
"F7",
"G7",
"G8"
]
}
},
{
"id": 63,
"name": "G8",
"level": 6,
"region": 4,
"position": {
"x": 307.7,
"y": 101.1
},
"connections": [
54,
62,
55,
56,
64
],
"max": {
"population": 800000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"F7",
"F8",
"G7",
"H7",
"H8"
]
}
},
{
"id": 64,
"name": "H8",
"level": 6,
"region": 3,
"position": {
"x": 350.2,
"y": 76.6
},
"connections": [
55,
63,
56
],
"max": {
"population": 800000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"G7",
"G8",
"H7"
]
}
}
],
"defaults": {
"trust": 50,
"trade": 100,
"supplyState": 1,
"frontState": 0
},
"meta": {
"source": "legacy",
"mapName": "chess"
}
}
+2161
View File
@@ -0,0 +1,2161 @@
{
"id": "cr",
"name": "cr",
"cities": [
{
"id": 1,
"name": "서량",
"level": 5,
"region": 2,
"position": {
"x": 127.25,
"y": 101.25
},
"connections": [
5
],
"max": {
"population": 430000,
"agriculture": 5000,
"commerce": 5000,
"security": 5000,
"defence": 10100,
"wall": 9900
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"안정"
]
}
},
{
"id": 2,
"name": "무도",
"level": 5,
"region": 2,
"position": {
"x": 127.25,
"y": 222.75
},
"connections": [
6,
7,
52
],
"max": {
"population": 355000,
"agriculture": 5000,
"commerce": 5000,
"security": 5000,
"defence": 5100,
"wall": 4900
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"한중",
"검각",
"천수"
]
}
},
{
"id": 3,
"name": "성도",
"level": 8,
"region": 2,
"position": {
"x": 127.25,
"y": 344.25
},
"connections": [
8,
9,
4
],
"max": {
"population": 1112000,
"agriculture": 9000,
"commerce": 8000,
"security": 8500,
"defence": 20400,
"wall": 19600
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"자동",
"강주",
"건녕"
]
}
},
{
"id": 4,
"name": "건녕",
"level": 6,
"region": 2,
"position": {
"x": 127.25,
"y": 384.75
},
"connections": [
3,
9,
51
],
"max": {
"population": 775000,
"agriculture": 6000,
"commerce": 6000,
"security": 5500,
"defence": 5100,
"wall": 4900
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"성도",
"강주",
"운남"
]
}
},
{
"id": 5,
"name": "안정",
"level": 5,
"region": 2,
"position": {
"x": 167.75,
"y": 141.75
},
"connections": [
1,
10,
52
],
"max": {
"population": 290000,
"agriculture": 5000,
"commerce": 5000,
"security": 5500,
"defence": 5200,
"wall": 4800
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"서량",
"장안",
"천수"
]
}
},
{
"id": 6,
"name": "한중",
"level": 7,
"region": 2,
"position": {
"x": 167.75,
"y": 222.75
},
"connections": [
2,
7,
10,
52
],
"max": {
"population": 1090000,
"agriculture": 6000,
"commerce": 8000,
"security": 7500,
"defence": 10100,
"wall": 9900
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"무도",
"검각",
"장안",
"천수"
]
}
},
{
"id": 7,
"name": "검각",
"level": 6,
"region": 2,
"position": {
"x": 167.75,
"y": 263.25
},
"connections": [
2,
6,
8
],
"max": {
"population": 575000,
"agriculture": 5000,
"commerce": 5000,
"security": 5000,
"defence": 5000,
"wall": 5000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"무도",
"한중",
"자동"
]
}
},
{
"id": 8,
"name": "자동",
"level": 6,
"region": 2,
"position": {
"x": 167.75,
"y": 303.75
},
"connections": [
3,
7,
9
],
"max": {
"population": 795000,
"agriculture": 6000,
"commerce": 5000,
"security": 5500,
"defence": 5000,
"wall": 5000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"성도",
"검각",
"강주"
]
}
},
{
"id": 9,
"name": "강주",
"level": 5,
"region": 2,
"position": {
"x": 167.75,
"y": 344.25
},
"connections": [
3,
4,
8,
11
],
"max": {
"population": 430000,
"agriculture": 5000,
"commerce": 5000,
"security": 6000,
"defence": 10000,
"wall": 10000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"성도",
"건녕",
"자동",
"영안"
]
}
},
{
"id": 10,
"name": "장안",
"level": 8,
"region": 2,
"position": {
"x": 208.25,
"y": 182.25
},
"connections": [
5,
6,
12,
13
],
"max": {
"population": 970000,
"agriculture": 9000,
"commerce": 9000,
"security": 9000,
"defence": 20200,
"wall": 19800
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"안정",
"한중",
"홍농",
"완"
]
}
},
{
"id": 11,
"name": "영안",
"level": 6,
"region": 2,
"position": {
"x": 208.25,
"y": 384.75
},
"connections": [
9,
15,
16,
17
],
"max": {
"population": 690000,
"agriculture": 5000,
"commerce": 5000,
"security": 5000,
"defence": 5000,
"wall": 5000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"강주",
"강릉",
"무릉",
"영릉"
]
}
},
{
"id": 12,
"name": "홍농",
"level": 7,
"region": 2,
"position": {
"x": 248.75,
"y": 182.25
},
"connections": [
10,
13,
18
],
"max": {
"population": 800000,
"agriculture": 7000,
"commerce": 7000,
"security": 7000,
"defence": 15500,
"wall": 14500
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"장안",
"완",
"낙양"
]
}
},
{
"id": 13,
"name": "완",
"level": 7,
"region": 2,
"position": {
"x": 248.75,
"y": 222.75
},
"connections": [
10,
12,
18,
19
],
"max": {
"population": 887000,
"agriculture": 7000,
"commerce": 8000,
"security": 7500,
"defence": 15100,
"wall": 14900
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"장안",
"홍농",
"낙양",
"신야"
]
}
},
{
"id": 14,
"name": "양양",
"level": 8,
"region": 2,
"position": {
"x": 248.75,
"y": 303.75
},
"connections": [
15,
19,
20
],
"max": {
"population": 1103500,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 20500,
"wall": 19500
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"강릉",
"신야",
"강하"
]
}
},
{
"id": 15,
"name": "강릉",
"level": 7,
"region": 2,
"position": {
"x": 248.75,
"y": 344.25
},
"connections": [
11,
14,
16,
20,
21
],
"max": {
"population": 725000,
"agriculture": 8000,
"commerce": 6000,
"security": 7000,
"defence": 15400,
"wall": 14600
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"영안",
"양양",
"무릉",
"강하",
"장사"
]
}
},
{
"id": 16,
"name": "무릉",
"level": 5,
"region": 2,
"position": {
"x": 248.75,
"y": 384.75
},
"connections": [
11,
15,
17,
20,
21,
22
],
"max": {
"population": 255000,
"agriculture": 3000,
"commerce": 3000,
"security": 3500,
"defence": 5000,
"wall": 5000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"영안",
"강릉",
"영릉",
"강하",
"장사",
"계양"
]
}
},
{
"id": 17,
"name": "영릉",
"level": 6,
"region": 2,
"position": {
"x": 248.75,
"y": 425.25
},
"connections": [
11,
16,
21,
22,
23
],
"max": {
"population": 775000,
"agriculture": 5000,
"commerce": 5000,
"security": 5500,
"defence": 5000,
"wall": 5000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"영안",
"무릉",
"장사",
"계양",
"남해"
]
}
},
{
"id": 18,
"name": "낙양",
"level": 8,
"region": 2,
"position": {
"x": 289.25,
"y": 182.25
},
"connections": [
12,
13,
26,
27,
25
],
"max": {
"population": 1780000,
"agriculture": 8000,
"commerce": 10000,
"security": 9000,
"defence": 20900,
"wall": 19100
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"홍농",
"완",
"허창",
"여남",
"진유"
]
}
},
{
"id": 19,
"name": "신야",
"level": 6,
"region": 2,
"position": {
"x": 289.25,
"y": 263.25
},
"connections": [
13,
14,
27
],
"max": {
"population": 650000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 5000,
"wall": 5000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"완",
"양양",
"여남"
]
}
},
{
"id": 20,
"name": "강하",
"level": 5,
"region": 2,
"position": {
"x": 289.25,
"y": 344.25
},
"connections": [
14,
15,
16,
21,
28
],
"max": {
"population": 415000,
"agriculture": 5000,
"commerce": 5000,
"security": 5000,
"defence": 10400,
"wall": 9600
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"양양",
"강릉",
"무릉",
"장사",
"시상"
]
}
},
{
"id": 21,
"name": "장사",
"level": 7,
"region": 2,
"position": {
"x": 289.25,
"y": 384.75
},
"connections": [
15,
16,
17,
20,
22,
28
],
"max": {
"population": 1023500,
"agriculture": 7000,
"commerce": 6000,
"security": 7000,
"defence": 10000,
"wall": 10000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"강릉",
"무릉",
"영릉",
"강하",
"계양",
"시상"
]
}
},
{
"id": 22,
"name": "계양",
"level": 6,
"region": 2,
"position": {
"x": 289.25,
"y": 425.25
},
"connections": [
16,
17,
21,
23
],
"max": {
"population": 600000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 5000,
"wall": 5000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"무릉",
"영릉",
"장사",
"남해"
]
}
},
{
"id": 23,
"name": "남해",
"level": 5,
"region": 2,
"position": {
"x": 289.25,
"y": 465.75
},
"connections": [
17,
22
],
"max": {
"population": 325000,
"agriculture": 3000,
"commerce": 4000,
"security": 3500,
"defence": 10300,
"wall": 9700
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"영릉",
"계양"
]
}
},
{
"id": 24,
"name": "업",
"level": 8,
"region": 2,
"position": {
"x": 329.75,
"y": 101.25
},
"connections": [
25,
29,
30,
31
],
"max": {
"population": 856500,
"agriculture": 9000,
"commerce": 8000,
"security": 8500,
"defence": 20500,
"wall": 19500
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"진유",
"평원",
"복양",
"초"
]
}
},
{
"id": 25,
"name": "진유",
"level": 6,
"region": 2,
"position": {
"x": 329.75,
"y": 141.75
},
"connections": [
18,
24,
26,
30,
31
],
"max": {
"population": 651000,
"agriculture": 6000,
"commerce": 4000,
"security": 6000,
"defence": 10300,
"wall": 9700
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"낙양",
"업",
"허창",
"복양",
"초"
]
}
},
{
"id": 26,
"name": "허창",
"level": 8,
"region": 2,
"position": {
"x": 329.75,
"y": 182.25
},
"connections": [
18,
25,
27,
31,
32
],
"max": {
"population": 1580000,
"agriculture": 10000,
"commerce": 8000,
"security": 9000,
"defence": 20600,
"wall": 19400
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"낙양",
"진유",
"여남",
"초",
"수춘"
]
}
},
{
"id": 27,
"name": "여남",
"level": 5,
"region": 2,
"position": {
"x": 329.75,
"y": 222.75
},
"connections": [
18,
19,
26,
32,
33
],
"max": {
"population": 410000,
"agriculture": 5000,
"commerce": 5000,
"security": 5000,
"defence": 15500,
"wall": 14500
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"낙양",
"신야",
"허창",
"수춘",
"단양"
]
}
},
{
"id": 28,
"name": "시상",
"level": 6,
"region": 2,
"position": {
"x": 329.75,
"y": 344.25
},
"connections": [
20,
21,
34
],
"max": {
"population": 665000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 10400,
"wall": 9600
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"강하",
"장사",
"여강"
]
}
},
{
"id": 29,
"name": "평원",
"level": 5,
"region": 2,
"position": {
"x": 370.25,
"y": 60.75
},
"connections": [
24,
30,
35,
36
],
"max": {
"population": 548000,
"agriculture": 5000,
"commerce": 5000,
"security": 5000,
"defence": 5200,
"wall": 4800
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"업",
"복양",
"계",
"남피"
]
}
},
{
"id": 30,
"name": "복양",
"level": 7,
"region": 2,
"position": {
"x": 370.25,
"y": 101.25
},
"connections": [
24,
25,
29,
31,
36,
37
],
"max": {
"population": 770500,
"agriculture": 6000,
"commerce": 8000,
"security": 7000,
"defence": 15600,
"wall": 14400
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"업",
"진유",
"평원",
"초",
"남피",
"소패"
]
}
},
{
"id": 31,
"name": "초",
"level": 6,
"region": 2,
"position": {
"x": 370.25,
"y": 141.75
},
"connections": [
24,
25,
26,
30,
37
],
"max": {
"population": 514000,
"agriculture": 4000,
"commerce": 6000,
"security": 6500,
"defence": 10000,
"wall": 10000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"업",
"진유",
"허창",
"복양",
"소패"
]
}
},
{
"id": 32,
"name": "수춘",
"level": 7,
"region": 2,
"position": {
"x": 370.25,
"y": 222.75
},
"connections": [
26,
27,
33,
38
],
"max": {
"population": 705000,
"agriculture": 8000,
"commerce": 8000,
"security": 8000,
"defence": 15400,
"wall": 14600
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"허창",
"여남",
"단양",
"건업"
]
}
},
{
"id": 33,
"name": "단양",
"level": 6,
"region": 2,
"position": {
"x": 370.25,
"y": 263.25
},
"connections": [
27,
32,
34,
38
],
"max": {
"population": 540000,
"agriculture": 7000,
"commerce": 6000,
"security": 5000,
"defence": 10300,
"wall": 9700
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"여남",
"수춘",
"여강",
"건업"
]
}
},
{
"id": 34,
"name": "여강",
"level": 5,
"region": 2,
"position": {
"x": 370.25,
"y": 303.75
},
"connections": [
33,
28
],
"max": {
"population": 350000,
"agriculture": 4000,
"commerce": 4000,
"security": 4000,
"defence": 5100,
"wall": 4900
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"단양",
"시상"
]
}
},
{
"id": 35,
"name": "계",
"level": 7,
"region": 2,
"position": {
"x": 410.75,
"y": 20.25
},
"connections": [
29,
36,
39
],
"max": {
"population": 855000,
"agriculture": 7000,
"commerce": 7000,
"security": 7000,
"defence": 15300,
"wall": 14700
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"평원",
"남피",
"북평"
]
}
},
{
"id": 36,
"name": "남피",
"level": 7,
"region": 2,
"position": {
"x": 410.75,
"y": 60.75
},
"connections": [
29,
30,
35,
39,
40
],
"max": {
"population": 1173000,
"agriculture": 8000,
"commerce": 7000,
"security": 7500,
"defence": 15200,
"wall": 14800
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"평원",
"복양",
"계",
"북평",
"북해"
]
}
},
{
"id": 37,
"name": "소패",
"level": 5,
"region": 2,
"position": {
"x": 410.75,
"y": 141.75
},
"connections": [
30,
31,
40,
41,
42
],
"max": {
"population": 314000,
"agriculture": 4000,
"commerce": 5000,
"security": 4000,
"defence": 5100,
"wall": 4900
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"복양",
"초",
"북해",
"하비",
"광릉"
]
}
},
{
"id": 38,
"name": "건업",
"level": 8,
"region": 2,
"position": {
"x": 410.75,
"y": 222.75
},
"connections": [
32,
33,
42,
43
],
"max": {
"population": 980000,
"agriculture": 8000,
"commerce": 10000,
"security": 9000,
"defence": 20700,
"wall": 19300
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"수춘",
"단양",
"광릉",
"오"
]
}
},
{
"id": 39,
"name": "북평",
"level": 6,
"region": 2,
"position": {
"x": 451.25,
"y": 20.25
},
"connections": [
35,
36,
45
],
"max": {
"population": 855000,
"agriculture": 7000,
"commerce": 5000,
"security": 6000,
"defence": 10100,
"wall": 9900
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"계",
"남피",
"양평"
]
}
},
{
"id": 40,
"name": "북해",
"level": 6,
"region": 2,
"position": {
"x": 451.25,
"y": 101.25
},
"connections": [
36,
37,
41,
48
],
"max": {
"population": 654000,
"agriculture": 6000,
"commerce": 6000,
"security": 7000,
"defence": 15200,
"wall": 14800
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"남피",
"소패",
"하비",
"사비"
]
}
},
{
"id": 41,
"name": "하비",
"level": 7,
"region": 2,
"position": {
"x": 451.25,
"y": 141.75
},
"connections": [
37,
40,
42
],
"max": {
"population": 798000,
"agriculture": 7000,
"commerce": 9000,
"security": 8000,
"defence": 15300,
"wall": 14700
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"소패",
"북해",
"광릉"
]
}
},
{
"id": 42,
"name": "광릉",
"level": 6,
"region": 2,
"position": {
"x": 451.25,
"y": 182.25
},
"connections": [
38,
41,
37
],
"max": {
"population": 650000,
"agriculture": 6000,
"commerce": 6000,
"security": 5000,
"defence": 15300,
"wall": 14700
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"건업",
"하비",
"소패"
]
}
},
{
"id": 43,
"name": "오",
"level": 6,
"region": 2,
"position": {
"x": 451.25,
"y": 263.25
},
"connections": [
38,
44
],
"max": {
"population": 690000,
"agriculture": 4000,
"commerce": 7000,
"security": 6000,
"defence": 15600,
"wall": 14400
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"건업",
"회계"
]
}
},
{
"id": 44,
"name": "회계",
"level": 5,
"region": 2,
"position": {
"x": 451.25,
"y": 303.75
},
"connections": [
43
],
"max": {
"population": 370000,
"agriculture": 5000,
"commerce": 4000,
"security": 4500,
"defence": 10400,
"wall": 9600
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"오"
]
}
},
{
"id": 45,
"name": "양평",
"level": 5,
"region": 2,
"position": {
"x": 491.75,
"y": 20.25
},
"connections": [
39,
46,
47
],
"max": {
"population": 350000,
"agriculture": 4000,
"commerce": 4000,
"security": 5000,
"defence": 5100,
"wall": 4900
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"북평",
"국내",
"한"
]
}
},
{
"id": 46,
"name": "국내",
"level": 7,
"region": 2,
"position": {
"x": 532.25,
"y": 20.25
},
"connections": [
45,
47,
49,
53
],
"max": {
"population": 850000,
"agriculture": 6000,
"commerce": 7000,
"security": 6500,
"defence": 15500,
"wall": 14500
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"양평",
"한",
"매소",
"졸본"
]
}
},
{
"id": 47,
"name": "한",
"level": 8,
"region": 2,
"position": {
"x": 532.25,
"y": 60.75
},
"connections": [
45,
46,
48,
49,
50,
53
],
"max": {
"population": 1150000,
"agriculture": 9000,
"commerce": 8000,
"security": 8500,
"defence": 20700,
"wall": 19300
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"양평",
"국내",
"사비",
"매소",
"서라벌",
"졸본"
]
}
},
{
"id": 48,
"name": "사비",
"level": 6,
"region": 2,
"position": {
"x": 532.25,
"y": 101.25
},
"connections": [
47,
49,
50,
40
],
"max": {
"population": 650000,
"agriculture": 6000,
"commerce": 7000,
"security": 4500,
"defence": 10300,
"wall": 9700
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"한",
"매소",
"서라벌",
"북해"
]
}
},
{
"id": 49,
"name": "매소",
"level": 5,
"region": 2,
"position": {
"x": 572.75,
"y": 60.75
},
"connections": [
46,
47,
48,
50,
53
],
"max": {
"population": 346500,
"agriculture": 4000,
"commerce": 5000,
"security": 4500,
"defence": 5000,
"wall": 5000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"국내",
"한",
"사비",
"서라벌",
"졸본"
]
}
},
{
"id": 50,
"name": "서라벌",
"level": 6,
"region": 2,
"position": {
"x": 572.75,
"y": 101.25
},
"connections": [
47,
48,
49
],
"max": {
"population": 740000,
"agriculture": 6000,
"commerce": 6000,
"security": 6000,
"defence": 10300,
"wall": 9700
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"한",
"사비",
"매소"
]
}
},
{
"id": 51,
"name": "운남",
"level": 4,
"region": 2,
"position": {
"x": 127.25,
"y": 425.25
},
"connections": [
4
],
"max": {
"population": 952000,
"agriculture": 6000,
"commerce": 8000,
"security": 7000,
"defence": 5100,
"wall": 4900
},
"initial": {
"population": 50000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 1000,
"wall": 1000
},
"meta": {
"source": "legacy",
"connectionNames": [
"건녕"
]
}
},
{
"id": 52,
"name": "천수",
"level": 5,
"region": 2,
"position": {
"x": 127.25,
"y": 182.25
},
"connections": [
5,
6,
2
],
"max": {
"population": 301000,
"agriculture": 5000,
"commerce": 5000,
"security": 5500,
"defence": 10200,
"wall": 9800
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"안정",
"한중",
"무도"
]
}
},
{
"id": 53,
"name": "졸본",
"level": 6,
"region": 2,
"position": {
"x": 572.75,
"y": 20.25
},
"connections": [
46,
47,
49
],
"max": {
"population": 619000,
"agriculture": 5500,
"commerce": 5500,
"security": 5500,
"defence": 10100,
"wall": 9900
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"국내",
"한",
"매소"
]
}
}
],
"defaults": {
"trust": 50,
"trade": 100,
"supplyState": 1,
"frontState": 0
},
"meta": {
"source": "legacy",
"mapName": "cr"
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,879 @@
{
"id": "pokemon_v1",
"name": "pokemon_v1",
"cities": [
{
"id": 1,
"name": "태초마을",
"level": 6,
"region": 1,
"position": {
"x": 169,
"y": 321
},
"connections": [
2,
11
],
"max": {
"population": 1200000,
"agriculture": 8000,
"commerce": 8000,
"security": 6000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"상록시티",
"홍련마을"
]
}
},
{
"id": 2,
"name": "상록시티",
"level": 5,
"region": 1,
"position": {
"x": 169,
"y": 231
},
"connections": [
1,
3,
12
],
"max": {
"population": 900000,
"agriculture": 6000,
"commerce": 6000,
"security": 4000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"태초마을",
"회색시티",
"챔피언로드(입구)"
]
}
},
{
"id": 3,
"name": "회색시티",
"level": 6,
"region": 1,
"position": {
"x": 174,
"y": 104
},
"connections": [
2,
4
],
"max": {
"population": 1200000,
"agriculture": 8000,
"commerce": 8000,
"security": 6000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"상록시티",
"달맞이산"
]
}
},
{
"id": 4,
"name": "달맞이산",
"level": 6,
"region": 1,
"position": {
"x": 297,
"y": 94
},
"connections": [
3,
5
],
"max": {
"population": 1200000,
"agriculture": 8000,
"commerce": 8000,
"security": 6000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"회색시티",
"블루시티"
]
}
},
{
"id": 5,
"name": "블루시티",
"level": 6,
"region": 1,
"position": {
"x": 452,
"y": 92
},
"connections": [
4,
10,
18,
21
],
"max": {
"population": 1200000,
"agriculture": 8000,
"commerce": 8000,
"security": 6000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"달맞이산",
"노랑시티",
"무인발전소",
"블루시티동굴"
]
}
},
{
"id": 6,
"name": "갈색시티",
"level": 7,
"region": 1,
"position": {
"x": 451,
"y": 278
},
"connections": [
19,
10
],
"max": {
"population": 1500000,
"agriculture": 10000,
"commerce": 10000,
"security": 8000,
"defence": 10000,
"wall": 10000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"IC",
"노랑시티"
]
}
},
{
"id": 7,
"name": "보라타운",
"level": 5,
"region": 1,
"position": {
"x": 627,
"y": 180
},
"connections": [
19,
10,
18
],
"max": {
"population": 1200000,
"agriculture": 6000,
"commerce": 6000,
"security": 4000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"IC",
"노랑시티",
"무인발전소"
]
}
},
{
"id": 8,
"name": "무지개시티",
"level": 8,
"region": 1,
"position": {
"x": 343,
"y": 180
},
"connections": [
10,
15
],
"max": {
"population": 1800000,
"agriculture": 12000,
"commerce": 12000,
"security": 10000,
"defence": 12000,
"wall": 12000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"노랑시티",
"사이클링로드(입구)"
]
}
},
{
"id": 9,
"name": "연분홍시티",
"level": 8,
"region": 1,
"position": {
"x": 357,
"y": 377
},
"connections": [
16,
17,
23
],
"max": {
"population": 1800000,
"agriculture": 12000,
"commerce": 12000,
"security": 10000,
"defence": 12000,
"wall": 12000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"사이클링로드(출구)",
"관동15로",
"쌍둥이섬"
]
}
},
{
"id": 10,
"name": "노랑시티",
"level": 8,
"region": 1,
"position": {
"x": 451,
"y": 180
},
"connections": [
7,
8,
5,
6
],
"max": {
"population": 1800000,
"agriculture": 12000,
"commerce": 12000,
"security": 10000,
"defence": 12000,
"wall": 12000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"보라타운",
"무지개시티",
"블루시티",
"갈색시티"
]
}
},
{
"id": 11,
"name": "홍련마을",
"level": 6,
"region": 1,
"position": {
"x": 169,
"y": 454
},
"connections": [
1,
23
],
"max": {
"population": 1200000,
"agriculture": 8000,
"commerce": 8000,
"security": 6000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"태초마을",
"쌍둥이섬"
]
}
},
{
"id": 12,
"name": "챔피언로드(입구)",
"level": 6,
"region": 1,
"position": {
"x": 90,
"y": 231
},
"connections": [
2,
13
],
"max": {
"population": 1200000,
"agriculture": 8000,
"commerce": 8000,
"security": 6000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"상록시티",
"챔피언로드(동굴)"
]
}
},
{
"id": 13,
"name": "챔피언로드(동굴)",
"level": 7,
"region": 1,
"position": {
"x": 90,
"y": 180
},
"connections": [
14,
12
],
"max": {
"population": 1500000,
"agriculture": 10000,
"commerce": 10000,
"security": 8000,
"defence": 10000,
"wall": 10000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"석영고원",
"챔피언로드(입구)"
]
}
},
{
"id": 14,
"name": "석영고원",
"level": 8,
"region": 1,
"position": {
"x": 90,
"y": 29
},
"connections": [
13
],
"max": {
"population": 1800000,
"agriculture": 12000,
"commerce": 12000,
"security": 10000,
"defence": 12000,
"wall": 12000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 5000,
"wall": 5000
},
"meta": {
"source": "legacy",
"connectionNames": [
"챔피언로드(동굴)"
]
}
},
{
"id": 15,
"name": "사이클링로드(입구)",
"level": 6,
"region": 1,
"position": {
"x": 252,
"y": 180
},
"connections": [
8,
16
],
"max": {
"population": 1200000,
"agriculture": 8000,
"commerce": 8000,
"security": 6000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"무지개시티",
"사이클링로드(출구)"
]
}
},
{
"id": 16,
"name": "사이클링로드(출구)",
"level": 7,
"region": 1,
"position": {
"x": 252,
"y": 377
},
"connections": [
15,
9
],
"max": {
"population": 1500000,
"agriculture": 10000,
"commerce": 10000,
"security": 8000,
"defence": 10000,
"wall": 10000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"사이클링로드(입구)",
"연분홍시티"
]
}
},
{
"id": 17,
"name": "관동15로",
"level": 6,
"region": 1,
"position": {
"x": 451,
"y": 377
},
"connections": [
9,
20
],
"max": {
"population": 1200000,
"agriculture": 8000,
"commerce": 8000,
"security": 6000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"연분홍시티",
"관동13로"
]
}
},
{
"id": 18,
"name": "무인발전소",
"level": 7,
"region": 1,
"position": {
"x": 627,
"y": 94
},
"connections": [
7,
5
],
"max": {
"population": 1500000,
"agriculture": 10000,
"commerce": 10000,
"security": 8000,
"defence": 10000,
"wall": 10000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"보라타운",
"블루시티"
]
}
},
{
"id": 19,
"name": "IC",
"level": 5,
"region": 1,
"position": {
"x": 627,
"y": 278
},
"connections": [
6,
7,
20
],
"max": {
"population": 900000,
"agriculture": 6000,
"commerce": 6000,
"security": 4000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"갈색시티",
"보라타운",
"관동13로"
]
}
},
{
"id": 20,
"name": "관동13로",
"level": 5,
"region": 1,
"position": {
"x": 627,
"y": 344
},
"connections": [
17,
19
],
"max": {
"population": 900000,
"agriculture": 6000,
"commerce": 6000,
"security": 4000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"관동15로",
"IC"
]
}
},
{
"id": 21,
"name": "블루시티동굴",
"level": 6,
"region": 1,
"position": {
"x": 451,
"y": 32
},
"connections": [
5,
22
],
"max": {
"population": 1200000,
"agriculture": 8000,
"commerce": 8000,
"security": 6000,
"defence": 8000,
"wall": 8000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 3000,
"wall": 3000
},
"meta": {
"source": "legacy",
"connectionNames": [
"블루시티",
"이수재의집"
]
}
},
{
"id": 22,
"name": "이수재의집",
"level": 7,
"region": 1,
"position": {
"x": 572,
"y": 32
},
"connections": [
21
],
"max": {
"population": 1500000,
"agriculture": 10000,
"commerce": 10000,
"security": 8000,
"defence": 10000,
"wall": 10000
},
"initial": {
"population": 150000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 4000,
"wall": 4000
},
"meta": {
"source": "legacy",
"connectionNames": [
"블루시티동굴"
]
}
},
{
"id": 23,
"name": "쌍둥이섬",
"level": 5,
"region": 1,
"position": {
"x": 263,
"y": 454
},
"connections": [
9,
11
],
"max": {
"population": 900000,
"agriculture": 6000,
"commerce": 6000,
"security": 4000,
"defence": 6000,
"wall": 6000
},
"initial": {
"population": 100000,
"agriculture": 1000,
"commerce": 1000,
"security": 1000,
"defence": 2000,
"wall": 2000
},
"meta": {
"source": "legacy",
"connectionNames": [
"연분홍시티",
"홍련마을"
]
}
}
],
"defaults": {
"trust": 50,
"trade": 100,
"supplyState": 1,
"frontState": 0
},
"meta": {
"source": "legacy",
"mapName": "pokemon_v1"
}
}
+1 -1
View File
@@ -5,5 +5,5 @@ export * from './lifecycle/turnDaemonLifecycle.js';
export * from './lifecycle/getNextTickTime.js';
export * from './scenario/scenarioLoader.js';
export * from './scenario/databaseUrl.js';
export * from './scenario/legacyMapLoader.js';
export * from './scenario/mapLoader.js';
export * from './scenario/scenarioSeeder.js';
+51
View File
@@ -0,0 +1,51 @@
import fs from 'node:fs/promises';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import type { MapDefinition } from '@sammo-ts/logic';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const DEFAULT_MAP_ROOT = path.resolve(
__dirname,
'..',
'..',
'resources',
'map'
);
export interface MapLoaderOptions {
mapRoot?: string;
filePrefix?: string;
}
const readJsonFile = async (filePath: string): Promise<unknown> => {
const raw = await fs.readFile(filePath, 'utf8');
return JSON.parse(raw) as unknown;
};
const resolveMapRoot = (options?: MapLoaderOptions): string =>
options?.mapRoot ?? DEFAULT_MAP_ROOT;
export const resolveMapDefinitionPath = (
mapName: string,
options?: MapLoaderOptions
): string => {
const prefix = options?.filePrefix ?? 'map_';
return path.resolve(resolveMapRoot(options), `${prefix}${mapName}.json`);
};
export const loadMapDefinition = async (
mapPath: string
): Promise<MapDefinition> => {
const raw = await readJsonFile(mapPath);
return raw as MapDefinition;
};
export const loadMapDefinitionByName = async (
mapName: string,
options?: MapLoaderOptions
): Promise<MapDefinition> => {
const mapPath = resolveMapDefinitionPath(mapName, options);
return loadMapDefinition(mapPath);
};
@@ -7,8 +7,8 @@ import {
type WorldSeedPayload,
} from '@sammo-ts/logic';
import type { LegacyMapLoaderOptions } from './legacyMapLoader.js';
import { loadLegacyMapDefinition } from './legacyMapLoader.js';
import type { MapLoaderOptions } from './mapLoader.js';
import { loadMapDefinitionByName } from './mapLoader.js';
import type { ScenarioLoaderOptions } from './scenarioLoader.js';
import { loadScenarioDefinitionById } from './scenarioLoader.js';
@@ -20,7 +20,7 @@ export interface ScenarioSeedOptions {
scenarioId: number;
databaseUrl: string;
scenarioOptions?: ScenarioLoaderOptions;
mapOptions?: LegacyMapLoaderOptions;
mapOptions?: MapLoaderOptions;
resetTables?: boolean;
now?: Date;
tickSeconds?: number;
@@ -93,7 +93,7 @@ export const seedScenarioToDatabase = async (
options.scenarioId,
options.scenarioOptions
);
const map = await loadLegacyMapDefinition(
const map = await loadMapDefinitionByName(
scenario.config.environment.mapName,
options.mapOptions
);
@@ -2,38 +2,45 @@ import fs from 'node:fs/promises';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import type {
MapCityDefinition,
MapCityStats,
MapDefinition,
} from '@sammo-ts/logic';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const DEFAULT_LEGACY_MAP_ROOT = path.resolve(
const LEGACY_MAP_ROOT = path.resolve(
__dirname,
'..',
'..',
'..',
'..',
'legacy',
'hwe',
'scenario',
'map'
);
const DEFAULT_LEGACY_BASE_FILE = path.resolve(
const LEGACY_BASE_FILE = path.resolve(
__dirname,
'..',
'..',
'..',
'..',
'legacy',
'hwe',
'sammo',
'CityConstBase.php'
);
const OUTPUT_ROOT = path.resolve(
__dirname,
'..',
'app',
'game-engine',
'resources',
'map'
);
const LEVEL_MAP: Record<string, number> = {
const MAP_NAMES = [
'che',
'miniche',
'miniche_b',
'miniche_clean',
'cr',
'chess',
'ludo_rathowm',
'pokemon_v1',
];
const LEVEL_MAP = {
'수': 1,
'진': 2,
'관': 3,
@@ -44,13 +51,12 @@ const LEVEL_MAP: Record<string, number> = {
'특': 8,
};
const LEVEL_LABELS: Record<number, string> = Object.entries(LEVEL_MAP)
.reduce<Record<number, string>>((acc, [label, value]) => {
acc[value] = label;
return acc;
}, {});
const LEVEL_LABELS = Object.entries(LEVEL_MAP).reduce((acc, [label, value]) => {
acc[value] = label;
return acc;
}, {});
const REGION_MAP: Record<string, number> = {
const DEFAULT_REGION_MAP = {
'하북': 1,
'중원': 2,
'서북': 3,
@@ -66,7 +72,7 @@ const BUILD_INIT_COMMON = {
trade: 100,
};
const BUILD_INIT: Record<string, MapCityStats> = {
const BUILD_INIT = {
'수': {
population: 5000,
agriculture: 100,
@@ -136,28 +142,7 @@ const BUILD_INIT: Record<string, MapCityStats> = {
const DEFAULT_SUPPLY_STATE = 1;
const DEFAULT_FRONT_STATE = 0;
interface LegacyCityRow {
id: number;
name: string;
level: string | number;
population: number;
agriculture: number;
commerce: number;
security: number;
defence: number;
wall: number;
region: string | number;
positionX: number;
positionY: number;
connectionNames: string[];
}
export interface LegacyMapLoaderOptions {
mapRoot?: string;
baseFilePath?: string;
}
const readFileOrNull = async (filePath: string): Promise<string | null> => {
const readFileOrNull = async (filePath) => {
try {
return await fs.readFile(filePath, 'utf8');
} catch {
@@ -165,7 +150,7 @@ const readFileOrNull = async (filePath: string): Promise<string | null> => {
}
};
const extractPhpArray = (source: string, marker: string): string | null => {
const extractPhpArray = (source, marker) => {
const markerIndex = source.indexOf(marker);
if (markerIndex < 0) {
return null;
@@ -176,7 +161,7 @@ const extractPhpArray = (source: string, marker: string): string | null => {
}
let depth = 0;
let inString: '"' | "'" | null = null;
let inString = null;
for (let i = start; i < source.length; i += 1) {
const char = source[i];
@@ -211,19 +196,19 @@ const extractPhpArray = (source: string, marker: string): string | null => {
return null;
};
const stripPhpComments = (source: string): string =>
const stripPhpComments = (source) =>
source
.replace(/\/\*[\s\S]*?\*\//g, '')
.replace(/\/\/.*$/gm, '')
.replace(/#.*$/gm, '');
const normalizePhpArray = (source: string): string =>
const normalizePhpArray = (source) =>
stripPhpComments(source)
.replace(/\bNULL\b/gi, 'null')
.replace(/'/g, '"')
.replace(/,(\s*[\]\}])/g, '$1');
const parseLegacyCityRows = (value: unknown): LegacyCityRow[] => {
const parseLegacyCityRows = (value) => {
if (!Array.isArray(value)) {
throw new Error('Legacy map data is not an array.');
}
@@ -251,40 +236,9 @@ const parseLegacyCityRows = (value: unknown): LegacyCityRow[] => {
if (typeof id !== 'number' || typeof name !== 'string') {
throw new Error(`Legacy map row ${index} has invalid id/name.`);
}
if (
typeof level !== 'string' &&
typeof level !== 'number'
) {
throw new Error(`Legacy map row ${index} has invalid level.`);
}
const stats = [
population,
agriculture,
commerce,
security,
defence,
wall,
];
if (stats.some((value) => typeof value !== 'number')) {
throw new Error(`Legacy map row ${index} has invalid stats.`);
}
if (
typeof region !== 'string' &&
typeof region !== 'number'
) {
throw new Error(`Legacy map row ${index} has invalid region.`);
}
if (
typeof positionX !== 'number' ||
typeof positionY !== 'number'
) {
throw new Error(`Legacy map row ${index} has invalid position.`);
}
const connectionNames = Array.isArray(connections)
? connections.filter(
(value): value is string => typeof value === 'string'
)
? connections.filter((value) => typeof value === 'string')
: [];
return {
@@ -305,7 +259,7 @@ const parseLegacyCityRows = (value: unknown): LegacyCityRow[] => {
});
};
const resolveLevelLabel = (level: string | number): string => {
const resolveLevelLabel = (level) => {
if (typeof level === 'string') {
return level;
}
@@ -316,7 +270,7 @@ const resolveLevelLabel = (level: string | number): string => {
return label;
};
const resolveLevelValue = (level: string | number): number => {
const resolveLevelValue = (level) => {
if (typeof level === 'number') {
return level;
}
@@ -327,21 +281,18 @@ const resolveLevelValue = (level: string | number): number => {
return value;
};
const resolveRegionValue = (region: string | number): number => {
const resolveRegionValue = (region, regionMap) => {
if (typeof region === 'number') {
return region;
}
const value = REGION_MAP[region];
const value = regionMap[region];
if (!value) {
throw new Error(`Unknown region label: ${region}`);
}
return value;
};
const buildCityDefinition = (
row: LegacyCityRow,
nameToId: Map<string, number>
): MapCityDefinition => {
const buildCityDefinition = (row, nameToId, regionMap) => {
const levelLabel = resolveLevelLabel(row.level);
const initial = BUILD_INIT[levelLabel];
if (!initial) {
@@ -350,13 +301,13 @@ const buildCityDefinition = (
const connections = row.connectionNames
.map((name) => nameToId.get(name))
.filter((value): value is number => typeof value === 'number');
.filter((value) => typeof value === 'number');
return {
id: row.id,
name: row.name,
level: resolveLevelValue(row.level),
region: resolveRegionValue(row.region),
region: resolveRegionValue(row.region, regionMap),
position: {
x: row.positionX,
y: row.positionY,
@@ -378,41 +329,60 @@ const buildCityDefinition = (
};
};
export const loadLegacyMapDefinition = async (
mapName: string,
options?: LegacyMapLoaderOptions
): Promise<MapDefinition> => {
const mapRoot = options?.mapRoot ?? DEFAULT_LEGACY_MAP_ROOT;
const baseFilePath = options?.baseFilePath ?? DEFAULT_LEGACY_BASE_FILE;
const mapFilePath = path.resolve(mapRoot, `${mapName}.php`);
const parseRegionMap = (source) => {
const raw = extractPhpArray(source, 'public static $regionMap');
if (!raw) {
return null;
}
const normalized = normalizePhpArray(raw);
const regex = /"([^"]+)"\s*=>\s*(\d+)/g;
const regionMap = {};
let match = regex.exec(normalized);
while (match) {
const [, key, value] = match;
regionMap[key] = Number(value);
match = regex.exec(normalized);
}
return Object.keys(regionMap).length > 0 ? regionMap : null;
};
const loadLegacyMapRows = async (mapName) => {
const mapFilePath = path.resolve(LEGACY_MAP_ROOT, `${mapName}.php`);
const [mapSource, baseSource] = await Promise.all([
readFileOrNull(mapFilePath),
readFileOrNull(baseFilePath),
readFileOrNull(LEGACY_BASE_FILE),
]);
if (!baseSource) {
throw new Error(`Legacy base map file is missing: ${baseFilePath}`);
throw new Error(`Legacy base map file is missing: ${LEGACY_BASE_FILE}`);
}
const mapInitCity =
const initCitySource =
(mapSource
? extractPhpArray(mapSource, 'protected static $initCity')
: null) ??
extractPhpArray(baseSource, 'protected static $initCity');
if (!mapInitCity) {
if (!initCitySource) {
throw new Error(`Legacy map data not found for ${mapName}.`);
}
const parsed = JSON.parse(normalizePhpArray(mapInitCity)) as unknown;
const parsed = JSON.parse(normalizePhpArray(initCitySource));
const rows = parseLegacyCityRows(parsed);
const baseRegionMap = parseRegionMap(baseSource) ?? DEFAULT_REGION_MAP;
const regionMap = mapSource
? parseRegionMap(mapSource) ?? baseRegionMap
: baseRegionMap;
return { rows, regionMap };
};
const buildMapDefinition = (mapName, rows, regionMap) => {
const nameToId = new Map(rows.map((row) => [row.name, row.id]));
return {
id: mapName,
name: mapName,
cities: rows.map((row) => buildCityDefinition(row, nameToId)),
cities: rows.map((row) => buildCityDefinition(row, nameToId, regionMap)),
defaults: {
trust: BUILD_INIT_COMMON.trust,
trade: BUILD_INIT_COMMON.trade,
@@ -425,3 +395,26 @@ export const loadLegacyMapDefinition = async (
},
};
};
const ensureOutputRoot = async () => {
await fs.mkdir(OUTPUT_ROOT, { recursive: true });
};
const writeMapDefinition = async (mapName, definition) => {
const filePath = path.resolve(OUTPUT_ROOT, `map_${mapName}.json`);
const payload = `${JSON.stringify(definition, null, 4)}\n`;
await fs.writeFile(filePath, payload, 'utf8');
};
const main = async () => {
await ensureOutputRoot();
for (const mapName of MAP_NAMES) {
const { rows, regionMap } = await loadLegacyMapRows(mapName);
const definition = buildMapDefinition(mapName, rows, regionMap);
await writeMapDefinition(mapName, definition);
console.log(`Generated map_${mapName}.json (${rows.length} cities)`);
}
};
await main();