Skip to content

Conversation

@Procyonae
Copy link
Contributor

@Procyonae Procyonae commented Jun 29, 2025

Purpose of change (The Why)

Closes #6757

Describe the solution (The How)

If RESPECT_GLOBALLY_UNIQUE is set to false GLOBALLY_UNIQUE (max one per world) specials are instead treated as though they're UNIQUE (max one per overmap)
They're still tracked as being placed in case you turn it back on mid save
Obsolete no_global_uniques mod as it's superceded by the option and errorlessly remove it

Describe alternatives you've considered

I attempted to migrate the new option to false if you had the mod for an updating world but it's not convenient to inject that in the place where BN does mod replacements due to call order and I didn't want to scope creep into trying store it and alter it later (the reverted commit does change the setting to false but also pops up an error and loses other non default world settings)

Testing

Changed cabin_lapin to be [99, 100] occurances and have a unique omt name to make it easily searchable
Genned a default world, found one cabin_lapin in ~16 overmaps as expected
Genned a world with RESPECT_GLOBALLY_UNIQUE set to false, found 2 cabin_lapin's in 5 overmaps

Additional context

Cloned BN so I can port the not yet merged rainbows to DDA and figured I might as well nab an easy C++ PR while I'm here

Checklist

Mandatory

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. mods PR changes related to mods. labels Jun 29, 2025
@Procyonae Procyonae force-pushed the AddRESPECT_GLOBALLY_UNIQUEWorldOption branch from a5b9876 to 78bf959 Compare July 19, 2025 08:57
@Procyonae Procyonae force-pushed the AddRESPECT_GLOBALLY_UNIQUEWorldOption branch 4 times, most recently from b2a4c94 to 0f66252 Compare July 20, 2025 15:36
@Procyonae Procyonae force-pushed the AddRESPECT_GLOBALLY_UNIQUEWorldOption branch from 0f66252 to 20e6ede Compare July 20, 2025 17:37
@Procyonae Procyonae marked this pull request as ready for review July 20, 2025 19:45
@scarf005 scarf005 self-requested a review July 27, 2025 14:23
@scarf005 scarf005 changed the title revert(mods): Obsolete no_global_uniques in favour of a RESPECT_GLOBALLY_UNIQUE world option feat(mods/no_global_uniques): Obsolete no_global_uniques in favour of a RESPECT_GLOBALLY_UNIQUE world option Jul 27, 2025
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed cabin_lapin to be [99, 100] occurances and have a unique omt name to make it easily searchable
Genned a default world, found one cabin_lapin in ~16 overmaps as expected
Genned a world with RESPECT_GLOBALLY_UNIQUE set to false, found 2 cabin_lapin's in 5 overmaps

sorry, could you be more specific? even after increaing occurances to [99, 100] i wasn't able to find any "cabin" in overmap. how do i give it a unique name?

@Procyonae
Copy link
Contributor Author

Procyonae commented Jul 27, 2025

--- a/data/json/overmap/overmap_terrain/overmap_terrain.json
+++ b/data/json/overmap/overmap_terrain/overmap_terrain.json
@@ -185,7 +185,7 @@
   },
   {
     "type": "overmap_terrain",
-    "id": [ "cabin", "cabin_1", "cabin_2", "cabin_3", "cabin_4", "cabin_5", "cabin_6", "cabin_7", "cabin_lapin", "bandit_cabin" ],
+    "id": [ "cabin", "cabin_1", "cabin_2", "cabin_3", "cabin_4", "cabin_5", "cabin_6", "cabin_7", "bandit_cabin" ],
     "name": "cabin",
     "sym": "C",
     "color": "i_green",
@@ -194,6 +194,17 @@
     "mondensity": 2,
     "flags": [ "RISK_LOW", "SOURCE_SAFETY", "SOURCE_FOOD" ]
   },
+  {
+    "type": "overmap_terrain",
+    "id": [ "cabin_lapin" ],
+    "name": "SEARCHFORME",
+    "sym": "!",
+    "color": "red",
+    "see_cost": 5,
+    "extras": "build",
+    "mondensity": 2,
+    "flags": [ "RISK_LOW", "SOURCE_SAFETY", "SOURCE_FOOD" ]
+  },
   {
     "type": "overmap_terrain",
     "id": [

There's generic cabins all over tho so idk how you can't find any '^^

@scarf005 scarf005 changed the title feat(mods/no_global_uniques): Obsolete no_global_uniques in favour of a RESPECT_GLOBALLY_UNIQUE world option feat(mods): Obsolete no_global_uniques in favour of a RESPECT_GLOBALLY_UNIQUE world option Jul 27, 2025
@scarf005
Copy link
Member

image

i could find cabin but i couldn't find any SEARCHFORME terrain; could you me more specific, like newbie-friendly level of specific?

Details
diff --git a/data/json/overmap/overmap_special/specials.json b/data/json/overmap/overmap_special/specials.json
index 9581c311838..5f116b89d83 100644
--- a/data/json/overmap/overmap_special/specials.json
+++ b/data/json/overmap/overmap_special/specials.json
@@ -330,9 +330,9 @@
       { "point": [ 0, 0, 1 ], "overmap": "cabin_roof_lapin_north" }
     ],
     "locations": [ "forest" ],
-    "city_distance": [ 25, -1 ],
-    "occurrences": [ 75, 100 ],
-    "flags": [ "CLASSIC", "WILDERNESS", "GLOBALLY_UNIQUE", "ELECTRIC_GRID" ]
+    "city_distance": [ -1, -1 ],
+    "occurrences": [ 100, 100 ],
+    "flags": [ "CLASSIC", "WILDERNESS", "UNIQUE", "GLOBALLY_UNIQUE", "ELECTRIC_GRID" ]
   },
   {
     "type": "overmap_special",
diff --git a/data/json/overmap/overmap_terrain/overmap_terrain.json b/data/json/overmap/overmap_terrain/overmap_terrain.json
index 6b7e973ae68..9ab98abd854 100644
--- a/data/json/overmap/overmap_terrain/overmap_terrain.json
+++ b/data/json/overmap/overmap_terrain/overmap_terrain.json
@@ -185,7 +185,7 @@
   },
   {
     "type": "overmap_terrain",
-    "id": [ "cabin", "cabin_1", "cabin_2", "cabin_3", "cabin_4", "cabin_5", "cabin_6", "cabin_7", "cabin_lapin", "bandit_cabin" ],
+    "id": [ "cabin", "cabin_1", "cabin_2", "cabin_3", "cabin_4", "cabin_5", "cabin_6", "cabin_7", "bandit_cabin" ],
     "name": "cabin",
     "sym": "C",
     "color": "i_green",
@@ -194,6 +194,17 @@
     "mondensity": 2,
     "flags": [ "RISK_LOW", "SOURCE_SAFETY", "SOURCE_FOOD" ]
   },
+  {
+    "type": "overmap_terrain",
+    "id": [ "cabin_lapin" ],
+    "name": "SEARCHFORME",
+    "sym": "!",
+    "color": "red",
+    "see_cost": 5,
+    "extras": "build",
+    "mondensity": 2,
+    "flags": [ "RISK_LOW", "SOURCE_SAFETY", "SOURCE_FOOD" ]
+  },
   {
     "type": "overmap_terrain",
     "id": [

Copy link
Member

@chaosvolt chaosvolt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good at a glance.

  1. Compiled and load-tested.
  2. Spawned at refugee center, had no issues finding it.
  3. Temporarily set them to be a 100% mandatory special, started debugging across multiple overmaps and did not find a second one.
  4. Went back and set the option off.

Problem: even though I set occurrences to 1/1 for refugee centers to test a world where global specials were definitely set to off, which SHOULD force an appearance of the refugee center in every single world, I'm still not finding more than one after having visited several overmaps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

JSON related to game datas in JSON format. mods PR changes related to mods. src changes related to source code.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

World option to disable GLOBALLY_UNIQUE

3 participants