Skip to content
Permalink
Browse files

Overmap specials overhaul (step 2) (#19144)

* Define connections in JSON (instead of computation)

* Introduce 'existing' connections and remove 'by_road' location

* Nicer/more efficient terrain demands

No need to build temporary vectors and perform map lookup all the time.

* Rewrite placing of overmap specials

Nicer code and performance boost.

* Remove unused JSON fields

- Remove unused "unique" field
- Remove unused "required" field
- Remove unused "ROTATE" flag
- Remove empty ranges in disabled objects

* Nicer code for 'city' structs and restore city size requirements

Added (probably restored) support of 'min_city_size' and 'max_city_size'.

* Correct number of specials per map + separate getter from modifier

Added (probably restored) support of 'min_occurrences'.

* Implement 'UNIQUE' flag

* Small fixes

- City coordinates may be negative
- Added a comment to 'overmap::get_sectors()'

* Add a warning for unplaced mandatory specials
  • Loading branch information...
codemime authored and Coolthulhu committed Nov 7, 2016
1 parent 957d118 commit e8ec1770bd5fc53be6de837e19931a9a8eb52c09

Large diffs are not rendered by default.

@@ -30,10 +30,13 @@

{ "point":[0,4,0], "overmap": "factory_blc_north"},
{ "point":[1,4,0], "overmap": "factory_be_north"},
{ "point":[2,4,0], "overmap": "factory_be_gate_north", "connect":"road"},
{ "point":[2,4,0], "overmap": "factory_be_gate_north"},
{ "point":[3,4,0], "overmap": "factory_be_north"},
{ "point":[4,4,0], "overmap": "factory_brc_north"}
],
"connections" : [
{ "point" : [2,5,0], "terrain" : "road" }
],
"locations" : [ "wilderness" ],
"city_distance" : [20, -1],
"city_sizes" : [1, 12],
@@ -30,7 +30,7 @@

{ "point":[0,4,0], "overmap": "mil_outpost_yblc_north"},
{ "point":[1,4,0], "overmap": "mil_outpost_ybe_north"},
{ "point":[2,4,0], "overmap": "mil_outpost_ybe_gate_north", "connect":"road"},
{ "point":[2,4,0], "overmap": "mil_outpost_ybe_gate_north"},
{ "point":[3,4,0], "overmap": "mil_outpost_ybe_north"},
{ "point":[4,4,0], "overmap": "mil_outpost_ybrc_north"},

@@ -97,7 +97,9 @@
{ "point":[1,3,-4], "overmap": "mil_outpost_ublc_north"},
{ "point":[2,3,-4], "overmap": "mil_outpost_ube_north"},
{ "point":[3,3,-4], "overmap": "mil_outpost_ubrc_north"}

],
"connections" : [
{ "point" : [2,5,0], "terrain" : "road" }
],
"locations" : [ "wilderness" ],
"city_distance" : [20, -1],
@@ -4,13 +4,16 @@
"id" : "3storyA",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "3storyA_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "3storyA_first_north" },
{ "point":[0,0,1], "overmap": "3storyA_second_north" },
{ "point":[0,0,2], "overmap": "3storyA_third_north" },
{ "point":[0,0,3], "overmap": "3storyA_roof_north" },
{ "point":[0,0,-1], "overmap": "3storyA_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -21,13 +24,16 @@
"id" : "3storyB",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "3storyB_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "3storyB_first_north" },
{ "point":[0,0,1], "overmap": "3storyB_second_north" },
{ "point":[0,0,2], "overmap": "3storyB_third_north" },
{ "point":[0,0,3], "overmap": "3storyB_roof_north" },
{ "point":[0,0,-1], "overmap": "3storyB_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -38,13 +44,16 @@
"id" : "3storyC",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "3storyC_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "3storyC_first_north" },
{ "point":[0,0,1], "overmap": "3storyC_second_north" },
{ "point":[0,0,2], "overmap": "3storyC_third_north" },
{ "point":[0,0,3], "overmap": "3storyC_roof_north" },
{ "point":[0,0,-1], "overmap": "3storyC_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -55,13 +64,16 @@
"id" : "3storyD",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "3storyD_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "3storyD_first_north" },
{ "point":[0,0,1], "overmap": "3storyD_second_north" },
{ "point":[0,0,2], "overmap": "3storyD_third_north" },
{ "point":[0,0,3], "overmap": "3storyD_roof_north" },
{ "point":[0,0,-1], "overmap": "3storyD_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -72,13 +84,16 @@
"id" : "3storyE",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "3storyE_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "3storyE_first_north" },
{ "point":[0,0,1], "overmap": "3storyE_second_north" },
{ "point":[0,0,2], "overmap": "3storyE_third_north" },
{ "point":[0,0,3], "overmap": "3storyE_roof_north" },
{ "point":[0,0,-1], "overmap": "3storyE_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -89,13 +104,16 @@
"id" : "3storyF",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "3storyF_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "3storyF_first_north" },
{ "point":[0,0,1], "overmap": "3storyF_second_north" },
{ "point":[0,0,2], "overmap": "3storyF_third_north" },
{ "point":[0,0,3], "overmap": "3storyF_roof_north" },
{ "point":[0,0,-1], "overmap": "3storyF_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -106,12 +124,15 @@
"id" : "2storyA",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "2storyA_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "2storyA_first_north" },
{ "point":[0,0,1], "overmap": "2storyA_second_north" },
{ "point":[0,0,2], "overmap": "2storyA_roof_north" },
{ "point":[0,0,-1], "overmap": "2storyA_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -122,12 +143,15 @@
"id" : "2storyB",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "2storyB_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "2storyB_first_north" },
{ "point":[0,0,1], "overmap": "2storyB_second_north" },
{ "point":[0,0,2], "overmap": "2storyB_roof_north" },
{ "point":[0,0,-1], "overmap": "2storyB_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -138,12 +162,15 @@
"id" : "2storyC",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "2storyC_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "2storyC_first_north" },
{ "point":[0,0,1], "overmap": "2storyC_second_north" },
{ "point":[0,0,2], "overmap": "2storyC_roof_north" },
{ "point":[0,0,-1], "overmap": "2storyC_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -154,12 +181,15 @@
"id" : "2storyD",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "2storyD_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "2storyD_first_north" },
{ "point":[0,0,1], "overmap": "2storyD_second_north" },
{ "point":[0,0,2], "overmap": "2storyD_roof_north" },
{ "point":[0,0,-1], "overmap": "2storyD_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -170,12 +200,15 @@
"id" : "2storyE",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "2storyE_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "2storyE_first_north" },
{ "point":[0,0,1], "overmap": "2storyE_second_north" },
{ "point":[0,0,2], "overmap": "2storyE_roof_north" },
{ "point":[0,0,-1], "overmap": "2storyE_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -186,12 +219,15 @@
"id" : "2storyF",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "2storyF_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "2storyF_first_north" },
{ "point":[0,0,1], "overmap": "2storyF_second_north" },
{ "point":[0,0,2], "overmap": "2storyF_roof_north" },
{ "point":[0,0,-1], "overmap": "2storyF_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [0,-1,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -203,14 +239,17 @@
"overmaps" :
[
{ "point":[0,0,0], "overmap": "combohouseA_first_north"},
{ "point":[1,0,0], "overmap": "combogarageA_first_north", "connect":"road" },
{ "point":[1,0,0], "overmap": "combogarageA_first_north" },
{ "point":[0,0,1], "overmap": "combohouseA_second_north" },
{ "point":[1,0,1], "overmap": "combogarageA_second_north" },
{ "point":[0,0,2], "overmap": "combohouseA_roof_north" },
{ "point":[1,0,2], "overmap": "combogarageA_roof_north" },
{ "point":[0,0,-1], "overmap": "combohouseA_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [2,0,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -221,15 +260,18 @@
"id" : "combohouseB",
"overmaps" :
[
{ "point":[0,0,0], "overmap": "combohouseB_first_north"},
{ "point":[1,0,0], "overmap": "combogarageB_first_north", "connect":"road" },
{ "point":[0,0,0], "overmap": "combohouseB_first_north" },
{ "point":[1,0,0], "overmap": "combogarageB_first_north" },
{ "point":[0,0,1], "overmap": "combohouseB_second_north" },
{ "point":[1,0,1], "overmap": "combogarageB_second_north" },
{ "point":[0,0,2], "overmap": "combohouseB_roof_north" },
{ "point":[1,0,2], "overmap": "combogarageB_roof_north" },
{ "point":[0,0,-1], "overmap": "combohouseB_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [2,0,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 1],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -241,14 +283,17 @@
"overmaps" :
[
{ "point":[0,0,0], "overmap": "combohouseC_first_north"},
{ "point":[1,0,0], "overmap": "combogarageC_first_north", "connect":"road" },
{ "point":[1,0,0], "overmap": "combogarageC_first_north" },
{ "point":[0,0,1], "overmap": "combohouseC_second_north" },
{ "point":[1,0,1], "overmap": "combogarageC_second_north" },
{ "point":[0,0,2], "overmap": "combohouseC_roof_north" },
{ "point":[1,0,2], "overmap": "combogarageC_roof_north" },
{ "point":[0,0,-1], "overmap": "combohouseC_basement_north" }
],
"locations" : [ "by_road" ],
"connections" : [
{ "point" : [2,0,0], "terrain" : "road", "existing" : true }
],
"locations" : [ "land" ],
"city_distance" : [-1, 2],
"city_sizes" : [1, 12],
"occurrences" : [20, 50],
@@ -2,32 +2,14 @@
{
"type" : "overmap_special",
"id" : "Fungal Bloom",
"locations" : [],
"city_distance" : [0, 0], "//":"how far from a city it should be",
"city_sizes" : [0, 0], "//":"what city sizes should it spawn in",
"occurrences" : [0, 0], "//":"how many per overmap",
"rotate" : false, "//":"allow rotation",
"unique" : false, "//":"only allow one per city",
"required" : false, "//":"is this special required for valid city sizes"
"locations" : []
},{
"type" : "overmap_special",
"id" : "Fungal Tower",
"locations" : [],
"city_distance" : [0, 0], "//":"how far from a city it should be",
"city_sizes" : [0, 0], "//":"what city sizes should it spawn in",
"occurrences" : [0, 0], "//":"how many per overmap",
"rotate" : false, "//":"allow rotation",
"unique" : false, "//":"only allow one per city",
"required" : false, "//":"is this special required for valid city sizes"
"locations" : []
},{
"type" : "overmap_special",
"id" : "Fungal Flowers",
"locations" : [],
"city_distance" : [0, 0], "//":"how far from a city it should be",
"city_sizes" : [0, 0], "//":"what city sizes should it spawn in",
"occurrences" : [0, 0], "//":"how many per overmap",
"rotate" : false, "//":"allow rotation",
"unique" : false, "//":"only allow one per city",
"required" : false, "//":"is this special required for valid city sizes"
"locations" : []
}
]
@@ -2,12 +2,6 @@
{
"type" : "overmap_special",
"id" : "Triffid Grove",
"locations" : [],
"city_distance" : [0, 0], "//":"how far from a city it should be",
"city_sizes" : [0, 0], "//":"what city sizes should it spawn in",
"occurrences" : [0, 0], "//":"how many per overmap",
"rotate" : false, "//":"allow rotation",
"unique" : false, "//":"only allow one per city",
"required" : false, "//":"is this special required for valid city sizes"
"locations" : []
}
]

0 comments on commit e8ec177

Please sign in to comment.
You can’t perform that action at this time.