-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Conversation
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. |
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. |
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. |
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. |
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. |
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. |
I think I'd be happy with a solution that guaranteed a few things:
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 |
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. |
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:
some related notes i understand to be facts about our system as it is now:
given the above, here are some important undesirable consequences i think we need to somehow avert:
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. |
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). 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. |
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. 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. |
Breadcrumbs quests and the computer in evac shelter can probably provide the "other ways to find it other than stumbling randomly onto it". |
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'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.
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) |
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. |
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. |
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. |
@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. |
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. |
Oh wow, #42658 finally moved to the "done" pile. If the release is less than a week away then sure, I'll wait.
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. 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. |
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.) |
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). |
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. |
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.) |
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. |
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:
|
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). |
Alright, that sounds like it could work for the Refugee Center, though it doesn't address other problems like:
|
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. |
Not currently, no. My plan is to change worldgen and om-special definitions to enforce placement constraints.
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). |
I see at least two versions of additional refugee centers:
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). |
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. |
One possible way to handle GLOBALLY_UNIQUE locations that should, hopefully, be a decent compromise between both "realism" and implementation:
|
Closing as abandoned but bookmarking for hopeful pickup |
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
overmap specials that should really be unique[just one for now]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?