CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
9.92k stars 4.08k forks source link

Oops! All Nemesis! (Multiple Relentless Zombie Hulks) #74621

Open 1rebis1 opened 1 week ago

1rebis1 commented 1 week ago

Describe the bug

Character begins with "Hunted" Scenario, eventually kills the relentless zombie hulk, but more spawn en masse.

Attach save file

Extension-trimmed.tar.gz

Steps to reproduce

  1. Make character with "Hunted" scenario
  2. Play until relentless zombie hulk is encountered
  3. Kill relentless zombie hulk
  4. "Hunted" trait is not dropped, nor is there any indication of the defeated enemy (mission, achievement, etc)
  5. Inevitably encounter another, or even multiple others, especially around other monsters

Expected behavior

The "Hunted" scenario is supposed to end when the relentless zombie hulk is killed. Then, the "Hunted" trait should resolve, and the mission be completed successfully.

Screenshots

No response

Versions and configuration

Additional context

I use the Catapult launcher to launch CDDA. I have used the debug menu before, but not to alter or edit missions/monsters. I sometimes quit with Alt-4. I killed the first nemesis I found with a grenade.

Brambor commented 1 week ago

The "Hunted" scenario is supposed to end when the relentless zombie hulk is killed. Then, the "Hunted" trait should resolve, and the mission be completed successfully.

Are you sure? I think that was changed so that you are always hunted and the hunter power increases over time.

SkuliAdams commented 1 week ago

The hunter coming back is intentional, as per #73227. The problem is encountering multiple hunters simultaneously.

1rebis1 commented 1 week ago

I'm doing the "Hunted" scenario, not "Hunted Forever". The flavor text for "Hunted" implies you can escape by killing the nemesis. Is that being changed? If so, should I close this and resubmit the bug?

SkuliAdams commented 1 week ago

No, my bad. I believe that pr just added the "Hunted Forever" scenario, the "Hunted" scenario is supposed to work as you think.

I tried to replicate this in the most recent experimental by debug spawning a relentless hulk and killing it with a grenade, but found that the trait and mission cleared as expected.

Swootch commented 5 days ago

Might be related to #74703, quitting with Alt+F4 is also know to cause strange behavior.

PatrikLundell commented 3 days ago

I don't think #74703 is responsible, because I don't think this monster is part of a mapgen location (but rather is controlled by EoC magic. However, I failed to find out how it's spawned (the functionality seems to be hard coded, but I still failed to find the spawning code).

Testing it with both the #74703 code and the master code (as of this morning, my time) shows no difference: I get new hulks spawning in front of me on new terrain that hasn't been generated previously,

I can't ruling out the PR introducing #74169 being responsible, but I don't know how. It would have to call whatever is generating new hulks without properly checking whether it should (i.e. one still being active). Debugging with a break point in that code and then head into uncharted terrain should find the call chain and find the point where the erroneous extra copies are generated.

Brambor commented 3 days ago

I am not sure if you looked at the PRs and their code. If not there they are:

If you did look at the PRs and the code is just too convoluted, then ignore this.

PatrikLundell commented 3 days ago

Thanks for the references. As far as I can tell, there isn't anything specific for Nemesis when it comes to actually materializing, but it's created as a horde and then the horde logic takes care of the spawning into the reality bubble (and back to a horde when kicked out of it, I assume). Furthermore, I can't see that hordes are involved in the code changed, as it seems to consist of only map extras and static spawns tied to the overmap terrain type (assuming terrain_type->get static_spawns() isn't a misleading name).

Unfortunately, it doesn't seem the game is particularly consistent in showing where nemesis hordes are. Sometimes I've had the character pursued by a couple of hulks, with a horde symbol a number of OMTs off (with another hunter showing up when reaching that area), and I've had a case where I dislodged the pursuing hulks by getting them to hunt aphids instead and then saw a small triple Z horde symbol where I left them, and found them still hunting aphids when returning, but most of the time there's no horde symbols, so it's hard to guess if spawns come from hordes that the game think are there or they come from somehow spawning the horde you can see.

Brambor commented 3 days ago

it doesn't seem the game is particularly consistent in showing where nemesis hordes are.

Reading the code, it assumes there is only one nemesis and then breaks the loop. So maybe it would work well if there was only one nemesis.

Also, I only looked at the references I provided. I didn't look at the current code.

PatrikLundell commented 3 days ago

Unfortunately, code that works well when the rest is working correctly isn't that helpful in tracking down what's gone wrong...

PatrikLundell commented 3 days ago

I still haven't found where hordes are introduced into the reality bubble in the code. However, I have two pieces of news:

And finally at @1rebis1: Looking at the mission screen, the text says you can't really kill your pursuer and that it won't end until you die. This indicates the scenario is really the Hunted Forever version, unless the text is misleading.