Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make some of the UNIQUE overmap specials globally unique #49322

Closed
wants to merge 1 commit into from

Conversation

eltank
Copy link
Contributor

@eltank eltank commented Jun 16, 2021

Summary

Bugfixes "Make some of the UNIQUE overmap specials globally unique"

Purpose of change

There are several overmap specials that are supposed to be unique, i.e. you should only ever encounter one of them in any game world. Examples include the refugee center, Hub 01, the Tacoma commune and the Isherwood farm. In general, any overmap special that spawns scripted NPCs that give unique quests should not be duplicated. Encountering a second refugee center full of cloned NPCs that offer duplicate quests is a very jarring / immersion-breaking experience. It's unrealistic and can be exploited.

This PR adds functionality that can be used to prevent these overmap specials from being generated more than once per game world. This is tied to a new JSON flag, GLOBALLY_UNIQUE. The flag is applied to one overmap special as a proof of concept.

This could be used to address #48241 (not actually fixed in this PR)

Describe the solution

  • Create a global data structure to keep track of placed unique specials (as a field on the global overmapbuffer object)
  • Change the overmap special placement code to enforce uniqueness
  • Introduce a new JSON flag, GLOBALLY_UNIQUE, and use it to tag overmap specials that should really be unique [just one for now]
  • Persist the placed unique specials in the master save file

Based on feedback received, I have applied the flag to a single location. I personally believe that it's safe to apply it to any overmap special that has a breadcrumb quest leading to it, but others may insist that further changes (more PRs) are needed before the flag can be applied to more locations.
I picked the Refugee Center because it's the overmap special that's most easily discovered. You can get a breadcrumb quest leading to it from any evac shelter console and evac shelters are all over the place (8-12 instances per overmap). Players should have no trouble finding the Refugee Center regardless of starting scenario.

Describe alternatives you've considered

Making the existing UNIQUE flag actually mean unique. However, there are plenty of overmap specials that are currently tagged with this flag but do make sense to spawn multiple times per gameworld, e.g. bee hive, strange temple, labs. I considered switching those to a new flag (e.g. RARE) but since UNIQUE is probably used by mods I don't want to break them. Mod authors can choose which of their UNIQUE specials to convert to GLOBALLY_UNIQUE.

I considered creating a new JSON save file to store the placed specials, but it didn't seem worth it for a single line of JSON.

Testing

Started a new game, revealed several overmaps. Did not find duplicate refugee centers, Hub 01, Tacoma ranch or Isherwoods.
Saved the game, inspected the overmap save files and found no duplicates there either.

Additional context

I'm only planning to make the specials that have NPCs globally unique. If anyone thinks that other specials should also be unique (e.g. Necropolis, Collapsed Tower) please add a comment explaining why.

Globally unique specials should probably have their spawn chance bumped up. Right now I think they've been nerfed as a workaround to the duplication bug, but if they spawn too infrequently the quests that need them may fail to locate them.

The placed specials are stored in an unordered_set. I wonder if I should bother sorting them when serializing (for determinism).

"Bugfix" may not be the right category for this PR. Should I use something else?

@Venera3
Copy link
Member

Venera3 commented Jun 16, 2021

Both Isherwood and the Ranch can be spawned by its mission, so I don't think they need adjusting - the refugee center mission uses an old hardcoded mission start that can't, so they could get bumped up a bit. Maybe even as a gasp mandatory special so that the starting OM always has one.

Other candidates: Necropolis is big, obvious and pretty unfinished so I'd limit it as well. The collapsed tower special only exists so that the mission can spawn one in a field if it can't find one in a city (mandatory city locations aren't a thing, ans the mission start code sets the target special to mandatory on newly genned overmaps), so I don't think you need to include it. The abandoned farm and St Jones (?) farm both have some story bits and the latter has named zombies, so they could be limited as well. The second island prison has fixed NPCs.

@pehamm
Copy link
Contributor

pehamm commented Jun 16, 2021

Is there a way to alleaviate the issue that the player may set off in the wrong direction at the start and never find the special? From what I understand, that was the reason the flag did not actually enforce uniqueness in the first place.

I personally would have preferred a solution where theoretical duplicates can spawn, but only the one that enters the players reality bubble first gets a tag as "the one" special, and the other specials to be abandonned/nonfunctional. This would be roughly similar to the Tacoma commune, which from what I understand starts as a normal farmhouse but spawns NPCs once the mission to reach them is given. Coincidentally, this would make an evac center basecamp (#49248) much more viable.
On the flipside, I simply do not know how much work needs to go into these "alternative specials", e.g. whether simply emptying duplicate Hub01s would work or whether we would need ruined versions just for that.

@esotericist esotericist added [C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world Game: Mechanics Change Code that changes how major features work Map / Mapgen Overmap, Mapgen, Map extras, Map display labels Jun 16, 2021
@RenechCDDA
Copy link
Member

As Pehamm said, I was under the impression this was fully intentional. I remember reading that it was expressly for those situations - where the player set out in one direction from their start and it being... really unwelcome if they could never find certain things, just by 3 in 4 chance.

I will try to locate the statements and share them here for context, but regardless I would recommend some lead input before this one goes ahead.

@curstwist
Copy link
Contributor

Other related concerns are if the single unique building spawns next to triffids, fungals or something else hazardous to their survival. The refugee center has all that land as a buffer because of non-player NPC massacres but most specials don't.

@Venera3
Copy link
Member

Venera3 commented Jun 16, 2021

For Isherwood at least the forest around them prevents other locations from being placed there, so they should be safe at least, same for the island prison.

An easy solution would be to take a note from the collapsed tower - make "naturally spawning" locations have the new flag, but include copies with 0,0 occurrences for the missions to place if they can't find the location on the the generated overmaps.

E: I think "oh no the one ranch got eaten by triffids" is fun emergent storytelling, but I might be underestimating how attached people are to NPCs.

@kevingranade
Copy link
Member

Making these locations totally unique makes the player's initial spawn location extra special. If they ever pick up and move, they will be leaving all the unique NPCs behind.

Fixing this issue requires spreading these locations out so they aren't all clustered in one area, but makes them more difficult to find, which in turn means we need some sognposting features to widely scatter items, events and locations that will point to these special locations.

@mlangsdorf
Copy link
Contributor

I think I'd be happy with a solution that guaranteed a few things:

  • all UNIQUE locations spawn within 3 overmap buffers of the starting location
  • no UNIQUE location is spawned within 3 overmap buffers of another instance of another copy of the same location

it seems like that would satisfy the desire for there being multiple chances to find UNIQUE locations while preventing the starting overmap buffer from being overly special and stopping the weird phenomenon of having two Hub-01 sites within walking distance of each other.

Separately, we need to add better signposting for these locations

@actual-nh
Copy link
Contributor

actual-nh commented Jun 16, 2021

I think I'd be happy with a solution that guaranteed a few things:

  • all UNIQUE locations spawn within 3 overmap buffers of the starting location
  • no UNIQUE location is spawned within 3 overmap buffers of another instance of another copy of the same location

A third stipulation: No UNIQUE location will spawn another instance until at least X% of other UNIQUE locations have spawned an instance. In other words, remove UNIQUE locations from a pool until the pool has (100-X)% of the original locations, at which point refresh the pool.

EDIT: This may be of particular importance if the first stipulation above can't be done due to UNIQUE location placement requirements.

@esotericist
Copy link
Contributor

esotericist commented Jun 16, 2021

let me start off with staying that what i'm about to write is not in any way a critique of the goal or execution. i think this is a thing we want, and i have no concrete objections to that it is being done, nor why and how it is being done.

but i do think 'when' is a factor; i believe there is reason to consider it premature and it's possible (although i am not currently asserting the truth of it) that the things that make it premature might influence the ultimate shape of the feature hole this PR is meant to fill.

first a rather long list things i believe about our world generation and the gameflow implications of it:

  • a lot of our usage of the UNIQUE tag on map specials has become not a declaration that only one of these should ever exist, or even that it necessarily should be rare, but that it should be generated with a degree of aproximity. for the purposes of discussion (but not as an actual technical proposal, i just needed a different word) i am going to collectively refer to these DISTINCT specials
  • having multiple copies of distinct named NPCs showing up in the world without some kind of explanatory factor (clones, dimensional analogs, etc, none of which i think are currently slated but which might be) violated verisimilitude, and thus is undesirable
  • distinct named NPCs will generally be attached to DISTINCT locations, which are often but not exclusively expected to be GLOBALLY_UNIQUE locations
  • there should always be ways for players to locate a GLOBALLY_UNIQUE location through a means other than randomly stumbling over it, and DISTINCT locations which are not actually unique should generally have more ways to be found
  • for locations which are DISTINCT, and contain distinct, named NPCs, but are not reasonably genuinely unique in and of themselves, we should have a way for the locations to appear without the NPCs in question (or any pertinent resources that should be attached to the NPCs).
    • there might be more than one instance refugee center building, but there's only one free merchants faction
    • there is only one HUB01 whatsoever (although there might be other, analogous facilities, they won't be the same building)
  • it is okay for a GLOBALLY_UNIQUE location to become inoperable due to player action or inaction, or the natural course of gameflow (an unchecked mycus incursion left going for an extended period of time)
  • it is not desirable for a GLOBALLY_UNIQUE location to generate inoperable due to conditions that would have caused the location to either not be inhabited in the first place, or to have been abandoned before game start. like multiple copies of distinct named NPCs, this is a severe verisimilitude violation
  • it's important to be able have reasonable spatial relationships between DISTINCT locations, and even those locations and player start. examples:
    • the player start evac shelter starting out a long way away from the refugee center is fine as it essentially functions as procedural narrative; it provides a context of a journey of hardship
    • the player start evac shelter starting out in line of site of the refugee center is mildly but not severely problematic in the questions it raises (why didn't the player go there first)
    • a refugee center spawning adjacent to the targeted tacoma ranch violates assumptions about the two locations (they're enough far away from each other to need go-betweens, and that they can function as distinct factions
    • a refugee center spawning too far from the targeted tacoma ranch violates assumptions about the two locations (if they're providing food, they have to be at a distance where shipments can conceivably happen)
  • there's been what appears to be a general consensus within the team that a lot of our practical distances are irrationally short, and that we don't want things too close together (although the two big blockers for scaling things more sensibly are better city generation, and actual highway/freeway generation)
  • mission and player start allowances for searching for a thing being spawned should be much more lenient than they are now

some related notes i understand to be facts about our system as it is now:

  • we have no way of guaranteeing or even forcing final distributions of locations. we might want one of a location out of every 5 overmap buffers, but we have no way of ensuring that they actually show up in any specific quantity even with 50 generated overmap buffers (beyond making them mandatory, and that tends to be on an overmap buffer basis and not what we want in almost all cases)
  • we have no way of creating functional exclusion zones around DISTINCT locations. for instance, the refugee center has a very large span of OMTs ringing it that are empty, but that doesn't actually meaningfully preclude ants, mycus, or other things from just merrily overlapping it.
    • (anecdote: i once had a refugee center with several military bunkers surrounding it such there was no approach that didn't put you in range of turrets)

given the above, here are some important undesirable consequences i think we need to somehow avert:

  • if the instantiation of a GLOBALLY_UNIQUE special a player finds is broken on generation, entire spans of content will probably be rendered inoperable and/or incoherent
  • if key instantiations are too far apart, content might be functionally inaccessible.
  • if key instantiations are too close together, the need for exploration is sharply reduced (and player engagement potentially suffers)

i'm confident i had other things that i was going to include in all three lists with this when i started, but it turns out writing an entire wall of text while still waking up results in some thoughts getting misplaced.

so anyway, back up to the top: i am not saying all of these things to say "we shouldn't do this", but i think we need to be able to start making certain guarantees about the shape of the world before we start going highlander on key locations, and i think having an understanding of the relationships we actually want to establish within the worldspace is an important precursor.

@eltank
Copy link
Contributor Author

eltank commented Jun 17, 2021

Well, that's a lot more feedback than I expected.

I think it's pretty unreasonable to expect that I'll be able to satisfy all of the proposed requirements in this PR. So I have a proposal for making some incremental progress towards an acceptable solution that I'd like project members to comment on:

I can implement the functionality for the GLOBALLY_UNIQUE overmap special flag in this PR. I could either leave the functionality completely unused or I could tag a single special with this flag (e.g. the refugee center).
Future PRs can address other requirements (e.g. extra placement constraints) needed to expand the usage of the flag. In the mean time the functionality would be available to modders and other contributors to experiment with.

I'd like to address one point that's been brought up by a couple of folks: that the player may be unable to find GLOBALLY_UNIQUE specials if they set off in "the wrong direction". The solution to this problem is already in the game: breadcrumb quests. Interact with the computer console in any evac shelter and you'll get directions to the Refugee Center. Talk to the Merchant NPC there and you'll get quests pointing you to Hub 01 and Tacoma. The Isherwood farm doesn't have a breadcrumb quest but one could easily be added (maybe one of the Tacoma workers). As for other unique specials like Mr. Lapin's cabin, do you really need to find them in every run?

@natsirt721
Copy link
Contributor

natsirt721 commented Jun 17, 2021

I'd like to address one point that's been brought up by a couple of folks: that the player may be unable to find GLOBALLY_UNIQUE specials if they set off in "the wrong direction". The solution to this problem is already in the game: breadcrumb quests. Interact with the computer console in any evac shelter and you'll get directions to the Refugee Center. Talk to the Merchant NPC there and you'll get quests pointing you to Hub 01 and Tacoma. The Isherwood farm doesn't have a breadcrumb quest but one could easily be added (maybe one of the Tacoma workers). As for other unique specials like Mr. Lapin's cabin, do you really need to find them in every run?

Lapin will point you to the Isherwoods after you do a few quests for him - definitely agree that breadcrumb quests can mitigate the wrong direction problem. I think a more defined method of placing specials is required, its clear that the "1 in n chance + global blacklist" implementation is deficient for a number of reasons, mostly for spacing concerns.

@Aphegis
Copy link

Aphegis commented Jun 17, 2021

I created an issue last year about a quest giver npc (Bo Baronyx) that spawned 2 times (inside 2 different churches) in the same city and it was causing an error.

#43359

I dont remember if this npc "Bo Baronyx" is from a mod, and i dont know if this approach would fix this "multiple spawning of quest givers" problem in mods, but if it fixes it, then we could close this issue as well.

@Zireael07
Copy link
Contributor

Breadcrumbs quests and the computer in evac shelter can probably provide the "other ways to find it other than stumbling randomly onto it".
Speaking of, IIRC some other locations also have computer consoles (banks, pharmacies?) so those could also point to GLOBALLY_UNIQUE locations

@esotericist
Copy link
Contributor

Well, that's a lot more feedback than I expected.

I think it's pretty unreasonable to expect that I'll be able to satisfy all of the proposed requirements in this PR. So I have a proposal for making some incremental progress towards an acceptable solution that I'd like project members to comment on:

I can implement the functionality for the GLOBALLY_UNIQUE overmap special flag in this PR. I could either leave the functionality completely unused or I could tag a single special with this flag (e.g. the refugee center).
Future PRs can address other requirements (e.g. extra placement constraints) needed to expand the usage of the flag. In the mean time the functionality would be available to modders and other contributors to experiment with.

i agree that it would be unreasonable to try to solve all the stuff i brought up in this PR, and i wasn't even remotely intending to imply that you should.

instead, i think we might think of some mitigations to the concerns as pre-requisites to us getting enthusiastic about locking off extra copies of things.

my preference would be for us to postpone this specific PR until after some of that other work is done, but i could be convinced to limit it to a single location. it shouldn't be the refugee center, though; the refugee center being broken-at-worldgen cuts off huge swaths of content, so the ability to try to find a substitute (difficult though that can turn out to be sometimes) without starting a new world is still useful.

I'd like to address one point that's been brought up by a couple of folks: that the player may be unable to find GLOBALLY_UNIQUE specials if they set off in "the wrong direction". The solution to this problem is already in the game: breadcrumb quests. Interact with the computer console in any evac shelter and you'll get directions to the Refugee Center. Talk to the Merchant NPC there and you'll get quests pointing you to Hub 01 and Tacoma. The Isherwood farm doesn't have a breadcrumb quest but one could easily be added (maybe one of the Tacoma workers). As for other unique specials like Mr. Lapin's cabin, do you really need to find them in every run?

i've been asking for more of these breadcrumb quests for quite some time. fortunately, some people have stepped forward; for instance, #46821 will guide you to isherwood from lapin, and it'd make sense for a route to also be available through other locations.

my ideal would be for you to be able to get to any of the key faction locations regardless of which key faction location you found first. we don't have all of that right now, but we've been making progress.

Speaking of, IIRC some other locations also have computer consoles (banks, pharmacies?) so those could also point to GLOBALLY_UNIQUE locations

i'm not too keen on the idea of trying to add more stuff like that to consoles given most of them shouldn't be operable in the first place, but i would like to see someone try converting some of the current code that guides you to the refugee center to something sufficiently generic that you can more reasonably use from e.g. a handwritten map you might find somewhere, which shows a route to a destination.

(also i want more road maps in general, but that's secondary to the topics pertinent to this PR)

@PatrikLundell
Copy link
Contributor

I think the distinction between "distinct" and GLOBALLY_UNIQUE is a good step. A possibility might be to use new terms for locally distinct and globally distinct in an attempt to eventually remove the use of UNIQUE once current usages have been migrated.

In the longer term (outside the scope of this PR), placement of GLOBALLY_UNIQUE locations should probably be done at world generation such that the game "knows" where those locations are from the beginning, and the generation of their tiles and immediate surroundings should be constrained so they're free of troublesome neighbors, i.e. there can't be any ants within a distance of X, triffids within a distance of Y, etc. (probably with a default, not very large, distance for "normal" trouble, overridden by specified distances for larger trouble, such as mycus). Basically, GLOBALLY_UNIQUE locations would guide the shape of their surroundings, rather than being fitted in as best you can into what's generated.

@eltank
Copy link
Contributor Author

eltank commented Jun 18, 2021

it shouldn't be the refugee center, though; the refugee center being broken-at-worldgen cuts off huge swaths of content, so the ability to try to find a substitute (difficult though that can turn out to be sometimes) without starting a new world is still useful.

I'd like to understand what you mean by "refugee center being broken-at-worldgen". That's something that's never happened to me. Now I haven't played dozens or hundreds of CDDA runs, but I also can't think of any scenario that would make the refugee center unreachable or overrun with monsters. Maybe you mean broken in some other way?

I created 10 new worlds using a build that includes this PR and the default scenario. I used the evac shelter console and got directions to the (unique) refugee center. 9 times out of 10 it failed to give me a direct path via the road network ("you have no idea how to get there by road") but still gave me a map marker to a location on another overmap. I used Reveal Map + Teleport several times to verify that it's still possible to get there using a vehicle (as long as it can go off-road). I also teleported to the refugee center building and checked for monsters, found none. One time the center was close to a mi-go scout tower and another time there was an acid anthill nearby, but even then there were no monsters attacking the refugees. The large buffer space around the building and the lack of transparent windows does a good job of keeping the location safe unless you lure some monsters in yourself.

One bad thing that can happen if you linger too long in the refugee center is the back bay zombies breaking out and killing quest-giving NPCs but that's got nothing to do with worldgen and is usually preventable. If that happens I think players should accept the consequences or restart/reload, rather than find another refugee center where the dead NPCs are magically resurrected.

@eltank eltank changed the title [WIP] Make unique overmap specials actually unique Make some of the UNIQUE overmap specials globally unique Jun 19, 2021
@eltank eltank marked this pull request as ready for review June 19, 2021 04:08
@eltank
Copy link
Contributor Author

eltank commented Jun 19, 2021

Well, I didn't really get a clear "yea" or "nay" but there seems to be some support for this idea so I implemented the rest of it. It's ready for review now.

Edit: I'm pretty sure that the segfault in monster_attack_test has nothing to do with my PR.

src/overmap.cpp Outdated Show resolved Hide resolved
@eltank
Copy link
Contributor Author

eltank commented Jun 19, 2021

@esotericist Based on the newly added tag, I take it that a rebase onto 0.F-dev is in order?

@esotericist
Copy link
Contributor

@esotericist Based on the newly added tag, I take it that a rebase onto 0.F-dev is in order?

you could, but we're also hoping to really-for-really-realz get release soon, so you might wait for that to get sorted and for us to move to the next experimental span before doing that (because you might end up having to rebase again).

also gives us a little more time to brainstorm how to address some of the things mentioned here. i do want this, i just want to be sure we don't have this hitting before we get some other things going to mitigate concerns. maybe i can cajole more of our content folks to add more signpost missions once we're out of content freeze.

@esotericist
Copy link
Contributor

I'd like to understand what you mean by "refugee center being broken-at-worldgen". That's something that's never happened to me. Now I haven't played dozens or hundreds of CDDA runs, but I also can't think of any scenario that would make the refugee center unreachable or overrun with monsters. Maybe you mean broken in some other way?

since i didn't respond to this yet:

even with the buffer zone around the refugee center, i have personally experienced both ants all over the refugee center area and mycus all over the refugee center area. plus i mentioned strange weirdnesses with e.g. turret-bearing specials blocking off access to the refugee center, which is incoherent from a worldgen standpoint.

these all can effectively invalidate the content, most especially the mycus.

until we can get closer to ensuring that the world will not spawn the refugee center already compromised in some fashion other than the back bay zombies (which also should probably be adjusted to be somewhat less volatile, since it sometimes go sideways well out of scale with the intent of the content), i'm not comfortable having only one populated refugee center in the world.

@eltank
Copy link
Contributor Author

eltank commented Jun 19, 2021

you could, but we're also hoping to really-for-really-realz get release soon, so you might wait for that to get sorted and for us to move to the next experimental span before doing that (because you might end up having to rebase again).

Oh wow, #42658 finally moved to the "done" pile. If the release is less than a week away then sure, I'll wait.

also gives us a little more time to brainstorm how to address some of the things mentioned here. i do want this, i just want to be sure we don't have this hitting before we get some other things going to mitigate concerns. maybe i can cajole more of our content folks to add more signpost missions once we're out of content freeze.

I have some ideas about new player-guiding missions so I could help out with that, although creative writing is not my forte so don't expect award-winning dialogue.
I also have some thoughts about a "known locations" UI but I'll save that for another thread.

In the mean time, this PR is designed to be minimally intrusive by changing only one location in the game, and that part's negotiable. As I mentioned before, I'm also fine with turning this into an infrastructure PR that adds functionality without changing the gameplay.

@actual-nh
Copy link
Contributor

actual-nh commented Aug 1, 2021

In the mean time, I thought about making the "unique" behavior optional (through a menu entry in the World Options). Turn it on to get certain overmap specials appear exactly once, or leave it off for the current behavior.

I don't know, I hear only negative about unique locations spawning more than once.
Besides, Kevin is opposed to adding more world options, I doubt he will approve this.

Prioritizing the appearance of globally-unique specials close by - run the code to try to place them once in the overmap tiles surrounding + the origin, if that doesn't work try 1 overmap further out, etc. - could help. (This won't work for something only spawned by mission code, of course.)

@eltank
Copy link
Contributor Author

eltank commented Aug 1, 2021

Alright, unless someone chimes in with another idea that makes this PR merge-able I'm putting it in draft mode until I figure out how to guarantee that the unique locations (or at least some of them) spawn within a certain minimum/maximum distance from the player's spawn point.

This'll likely require introducing a new configuration field to the overmap special JSON (for the min/max distance setting) as well as changes to worldgen code. In particular, one thing I plan to change is to make the player always spawn in the (0, 0) overmap by redoing worldgen for that overmap until a valid starting location is found, then generate the world around that, possibly redoing that multiple times as well until the constraints are met (also forcing placement of specials when necessary).

@eltank eltank marked this pull request as draft August 1, 2021 05:13
@Venera3
Copy link
Member

Venera3 commented Aug 3, 2021

How complicated would be to mess with their spawn chances dynamically? Ie, Refugee center starts at 70% inclusion chance, when it gets placed that gets dropped to 0% and for each new overmap it gets incrementally raised (in 5% steps, for example) up to their default - that means the chances of a neighboring overmap having copies is exceedingly rare, but as you discover more of the world your chances of finding it again grow as a failsafe.

@PatrikLundell
Copy link
Contributor

I don't like copies of unique locations at all. Sure, multiple refugee centers would be reasonable, but only if they contained distinct groups of people, so the "original" would have the current cast, while the additional ones would have generic groups of people that only provided generic quests (unless someone put in the effort of designing refugee center 2, 3, ..., in which case each of those should be unique).

@actual-nh
Copy link
Contributor

I don't like copies of unique locations at all. Sure, multiple refugee centers would be reasonable, but only if they contained distinct groups of people, so the "original" would have the current cast, while the additional ones would have generic groups of people that only provided generic quests (unless someone put in the effort of designing refugee center 2, 3, ..., in which case each of those should be unique).

If this is done (and I don't know how difficult this would be to code), then I suggest that initially, all refugee centers would have the unique NPCs - but once one such unique NPC is encountered, then all other refugee centers have their unique NPCs replaced with generic ones. (Note that for at least some of them, at least the role - e.g., guard, beggar, merchant... - may be preserved.)

@PatrikLundell
Copy link
Contributor

I completely agree that the first instance of the refugee center, etc. should the the "original", and also that the generic versions ought to have standard roles corresponding to the "structural" part of the site. For refugee center instances, that would include guards, merchants, and refugees. I wouldn't include the beggars as I think they should be unique, and it's a judgement call whether the old guard should have a presence or not.
For convenience, I'd have merchants in the additional refugee centers belong to the Free Merchants faction and deal with Merchs, with the tenuous explanation that they know of other centers even if they don't have direct contact with them, and use a common payment system (logically, each site would have its own proprietary money, but that's rather tedious for the player).

@jbytheway
Copy link
Contributor

It occurs to me that the work I've been doing for parametric mapgen could help with this. We could have a mapgen parameter that is an integer index that increments each time a particular special is spawned, so that the unique content could be restricted to only index 0 (and different unique content for index 1, and so on, for as long as people care enough to keep making more). The index could be assigned when the first OMT for the special is mapgenned (i.e. once the player comes within a few OMTs of it).

@eltank
Copy link
Contributor Author

eltank commented Aug 21, 2021

It occurs to me that the work I've been doing for parametric mapgen could help with this. We could have a mapgen parameter that is an integer index that increments each time a particular special is spawned, so that the unique content could be restricted to only index 0 (and different unique content for index 1, and so on, for as long as people care enough to keep making more). The index could be assigned when the first OMT for the special is mapgenned (i.e. once the player comes within a few OMTs of it).

Interesting, IIUC what you're proposing is editing the mapgen definition for places like the Refugee Center to make the unique NPCs spawn only on the first instance you visit. Do you have any thoughts on avoiding this glitch:

  • visit the first Refugee Center but only move the reality bubble far enough to trigger mapgen for the lobby
  • find another RC; the lobby will be empty but as you advance further the back area will be full of NPCs since the mapgen for those OMTs will trigger for the first time
  • go back to the first RC, the lobby NPCs will be there but the ones in the back will not be (they're in the second RC)
    Also depending on how the "back bay zombies" are coded (if they only spawn on the first instance) then this could make the mission to clear out the back bay trivial as only the named zombie would spawn there in the first RC.

@jbytheway
Copy link
Contributor

jbytheway commented Aug 22, 2021

  • visit the first Refugee Center but only move the reality bubble far enough to trigger mapgen for the lobby

  • find another RC; the lobby will be empty but as you advance further the back area will be full of NPCs since the mapgen for those OMTs will trigger for the first time

  • go back to the first RC, the lobby NPCs will be there but the ones in the back will not be (they're in the second RC)

It wouldn't happen that way. The parameters are shared by all OMTs within an overmap special, so as soon as one OMT is generated that instance will be the unique first one, and the remaining OMTs will know that too, even if they haven't been generated yet.

We could have other copies of the Refugee Center to have a quest to find your way back to the original one, in case players came close enough to generate it without actually seeing it (that's more of a risk with the refugee center than most specials because it has a lot of empty fields around it).

@eltank
Copy link
Contributor Author

eltank commented Aug 22, 2021

Alright, that sounds like it could work for the Refugee Center, though it doesn't address other problems like:

  • it's possible to start a new game and have the RC, Hub01 and Tacoma all on the starting overmap which trivializes multiple quests
  • multiple locations named Hub 01 doesn't make sense
  • the duplicate Refugee Centers would make perfect player bases with 0 effort; they'd also qualify for the "safe zone" treatment (Prevent overmap mongroups from spawning on top of faction bases #49377) because worldgen doesn't know they're uninhabited

@actual-nh
Copy link
Contributor

actual-nh commented Aug 22, 2021

  • it's possible to start a new game and have the RC, Hub01 and Tacoma all on the starting overmap which trivializes multiple quests

Is there something currently preventing this?

Can the spawning of an overmap special be used to trigger effects, most particularly EOCs, and can EOCs be altered - assuming they are not currently able - to check the "am I a duplicate" parameter? If so, as well as potentially being used to spawn monsters or other problems (via update_mapgen, for instance) for the player to have to remove before they could be a faction base, they could also add the mission mentioned above.

@eltank
Copy link
Contributor Author

eltank commented Aug 22, 2021

  • it's possible to start a new game and have the RC, Hub01 and Tacoma all on the starting overmap which trivializes multiple quests

Is there something currently preventing this?

Not currently, no. My plan is to change worldgen and om-special definitions to enforce placement constraints.

Can the spawning of an overmap special be used to trigger effects, most particularly EOCs, and can EOCs be altered - assuming they are not currently able - to check the "am I a duplicate" parameter? If so, as well as potentially being used to spawn monsters or other problems (via update_mapgen, for instance) for the player to have to remove before they could be a faction base, they could also add the mission mentioned above.

That's starting to sound much more complicated than spawning a single om-special in a "good" location (that satisfies a bunch of placement constraints). If we want to have other Refugee Centers that have lots of zombies in them and are not "safe zones" that can be done simply by adding another non-unique overmap special with similar spawn conditions and different mapgen (e.g. broken windows instead of fortified, no food and z hordes).

@PatrikLundell
Copy link
Contributor

I see at least two versions of additional refugee centers:

  • Failed ones, overrun by monsters.
  • Additional ones populated by generic NPCs with generated names fulfilling generic roles (no quests, but probably trading), possibly with a quest/mission to find the "real" refugee center for one reason or another (if there's a generic Old Guard representative there this might be the right person for such a task). You'd have a generic merchant, generic guards, generic refugees in the back, no back bay monsters, and no lobby squatters.

As mentioned, crafted additional centers (both failed ones and inhabited ones) should be welcome.

Another possible variant would be bandit overrun centers (although they are a kind of monsters, of course).

If possible, Tacoma ought to be generated only for the "real" refugee center (although crafted ones might be given it too).

@stale
Copy link

stale bot commented Sep 21, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not 'bump' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

@stale stale bot added the stale Closed for lack of activity, but still valid. label Sep 21, 2021
@actual-nh actual-nh added (P5 - Long-term) Long-term WIP, may stay on the list for a while. and removed stale Closed for lack of activity, but still valid. labels Sep 21, 2021
@Tamiore
Copy link
Contributor

Tamiore commented Oct 15, 2021

One possible way to handle GLOBALLY_UNIQUE locations that should, hopefully, be a decent compromise between both "realism" and implementation:

  • GLOBALLY_UNIQUE locations are never generated as part of "normal" world exploration (just traveling down a road at random, etc)
  • each GLOBALLY_UNIQUE locations has a number of locator beacons that can and do spawn as part of "normal" world exploration
  • locator beacons are things like: terminals/journals/maps/radio transmissions/NPC's that directly mention the location, black-box transcripts, "you see a light in the distance" via observation post (on the top of radio tower or something), scout drones you can track back (to Hub 01), etc. You get the idea. Unlike the location itself, these need not be unique, and can just keep spawning (every so often) until players interacts with one of them.
  • when locator beacons gets activated, then GLOBALLY_UNIQUE location is generated in the nearest non-generated overmap buffer and the player is given a clear indication where to look. Other locator beacons from this particular GLOBALLY_UNIQUE location now point to this newly generated location.
  • This insures both that the location is within reasonable reach, but also that it can me generated with plenty of "safe space buffer" around it to prevent it from overlapping with something undesirable. Since at this point the player is already aware of the location at the core, but it's generated in a new overmap buffer, even really wide "safe space buffers" shouldn't be an issue.
  • from practical standpoint, I think it might be ok to even have a small subscript dedicated to generation of "featureless" new overmap buffers. This script would allow existing overmap features (rivers, roads, etc) to continue into area, but would otherwise generate nothing undesirable, plus ample spots for GLOBALLY_UNIQUE location.

@I-am-Erk
Copy link
Member

Closing as abandoned but bookmarking for hopeful pickup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world <Enhancement / Feature> New features, or enhancements on existing Game: Mechanics Change Code that changes how major features work Map / Mapgen Overmap, Mapgen, Map extras, Map display (P5 - Long-term) Long-term WIP, may stay on the list for a while.
Projects
Development

Successfully merging this pull request may close these issues.