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

Consoles for MISSION_SCIENCE_REP_3 spawn in refugee center #49106

Closed
eltank opened this issue May 31, 2021 · 14 comments · Fixed by #49230 or #49957
Closed

Consoles for MISSION_SCIENCE_REP_3 spawn in refugee center #49106

eltank opened this issue May 31, 2021 · 14 comments · Fixed by #49230 or #49957
Labels
<Bug> This needs to be fixed <Exploit> Unintended interactions or behavior, usually breaking how the game is balanced Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions Spawn Creatures, items, vehicles, locations appearing on map

Comments

@eltank
Copy link
Contributor

eltank commented May 31, 2021

Describe the bug

The 3rd mission for the refugee center doctor ("Download Encryption Codes", a.k.a. MISSION_SCIENCE_REP_3) tasks you with finding and hacking some console in a hidden underground lab. The mission marker points you to an underground tile in a nearby lab (usually the same lab where you did "Download Workstation Data" a.k.a. MISSION_SCIENCE_REP_2) but the consoles spawn right outside the front entrance to the refugee center.

Steps To Reproduce

  1. Start a new game in an evac shelter
  2. Use the computer to get the refugee center location
  3. Teleport to refugee center
  4. Talk to the doctor and complete the first 2 missions (e.g. by teleporting to given locations, debug-killing monsters, etc. OR just mark the missions as complete via the Edit Player debug menu)
  5. Talk to the doctor again and accept the third mission
  6. Observe consoles appeared just outside (possibly "under" your car if you parked there)

As an alternative to steps 1-4, load this save: DebugWorld2.zip

Expected behavior

  1. The consoles should spawn in the location pointed to by the map marker and not on the same overmap tile as the quest giver.
  2. The map marker should point to a hidden lab, not a normal one (but that's a less jarring issue I'm willing to overlook)

Screenshots

refctr

Versions and configuration

  • OS: Windows
    • OS Version: 10.0 2009
  • Game Version: deb7618 [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food]
    ]

Additional context

The next mission, which sends you to the nearest ice lab to hack yet another console does appear to be working properly (more-or-less, I found the console 1 room below the quest marker).

Unrelated: The screenshot shows the mercenary spawning in the locked room with the doctor, I guess you'd need a blowtorch to get them out after recruiting, but that's a separate issue.

I might have a go at fixing this. I noticed that create_hidden_lab_console() in mission_start.cpp doesn't use overmap_buffer.find_closest like the other 2 (create_lab_console, create_ice_lab_console) so I could try changing that to see what happens.

@eltank
Copy link
Contributor Author

eltank commented May 31, 2021

Hmm, I can't find any overmap specials (in json or c++) that can generate the "basement_hidden_lab_stairs" OMT needed for this mission. That sounds like the root cause of the bug. Now I guess I'll have to dig through the code history to find out when and why that happened.

@actual-nh actual-nh added <Bug> This needs to be fixed <Exploit> Unintended interactions or behavior, usually breaking how the game is balanced Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions Spawn Creatures, items, vehicles, locations appearing on map labels May 31, 2021
@eltank
Copy link
Contributor Author

eltank commented May 31, 2021

As far as I can tell hidden lab basements were still working at the time of #37939 in February 2020.
"house_31" and "house_32" had a basement OMT "basement" which had a 1 in 5 chance to turn into "basement_hidden_lab_stairs" (see regional_map_settings.json in that PR).

But #39198 removed all basement conversions (as obsolete). As a result, since April 2020 there haven't been any more basement_hidden_lab_stairs generated in the game world.

Now I see 2 possible solutions:

  • change house_31 and/or house_32 to always have basement_hidden_lab_stairs under them; this may cause too many hidden labs to spawn, but that could be mitigated by decreasing the frequency of those houses
  • implement hidden lab basements as a map special, similar to "Prison Hidden Lab" which spawns the prison_1_b_8_hidden_lab_stairs_north OMT (specials.json); I don't know how feasible that is since most of the specials I see in there spawn outside cities

@eltank
Copy link
Contributor Author

eltank commented Jun 1, 2021

Tagging in @Venera3 who seems to be an expert on overmap specials. Could you offer any advice about the proposed solutions? In particular, is it possible to create an overmap special that has a chance to replace one specific OMT with another OMT (e.g. basement -> basement_hidden_lab_stairs)?

@actual-nh
Copy link
Contributor

change house_31 and/or house_32 to always have basement_hidden_lab_stairs under them; this may cause too many hidden labs to spawn, but that could be mitigated by decreasing the frequency of those houses

Note that you could also copy house_31 and house_32 and have the copied versions be the ones with basement_hidden_lab_stairs, with the total rates of occurrence of these left unchanged.

@eltank
Copy link
Contributor Author

eltank commented Jun 1, 2021

Found previous reports: #27618 #48306.
But those don't contain discussion on how to actually fix the problem and #27618 predates #39198, which means it was most likely broken for some other reason (and that it was possibly fixed, temporarily, by #37939).

@Venera3
Copy link
Member

Venera3 commented Jun 1, 2021

I dug into it briefly while fixing some other mission weirdness. There's a way to essentially unhardcode that whole questline, doing away with a lot of mission_start.cpp in the process but it's pretty work-intensive.

JSON mission starts can search for a set terrain tile, update it with a new map tile or nested mapgen and even spawn a fitting overmap special, so theoretically one could just throw out all that hardcoded stuff and redo them using that system. They could even point at the more common microlabs, or show off tower labs while we're at it.

@actual-nh
Copy link
Contributor

Regarding un-hardcoding specials - @Night-Pryanik?

@Night-Pryanik
Copy link
Contributor

I always support de-hardcoding stuff. It's just really time-consuming work.

@eltank
Copy link
Contributor Author

eltank commented Jun 8, 2021

Ok, I've started working on this. Going to try implementing the hidden lab as a map special using only JSON, but I can tweak the C++ code too if necessary. I must say that both https://github.com/CleverRaven/Cataclysm-DDA/blob/master/doc/MAPGEN.md and the code itself are very confusing in terms of figuring out how map special placements are validated, especially for "connections". Also terms like "terrain" and "location" seem to be used inconsistently.

Please check out #49230 if interested. So far it's not working but I'll continue to debug. Advice and comments are welcome.

@leemuar
Copy link
Contributor

leemuar commented Jul 14, 2021

I've just experienced it on F-stable version of the game.
2 consoles spawned right near Refugee Center Entrance. And mission pointer points to a clear field, not to a building

But Im playing my save file exported from E-2 stable version of the game, maybe it is important

@eltank
Copy link
Contributor Author

eltank commented Jul 15, 2021

Ok, I can confirm that this is broken on 0.F with a newly generated map and no mods. It's broken in a different way compared to last time. The hidden lab does spawn, but for some reason the mission code is unable to find it.

Here's a save file. Talking to the doctor and asking for the next mission triggers the bug. The closest hidden lab is at -1,169 x 67.
DefaultWorld.zip

@leemuar
Copy link
Contributor

leemuar commented Jul 15, 2021

@ZhilkinSerg Could you please reopen this issue?

@leemuar
Copy link
Contributor

leemuar commented Jul 15, 2021

This is my safe, it has 2 consoles spawned near Refugee Center entrance and mission pointer points to a clear field, there are no buildings around

Хатто.zip

@eltank
Copy link
Contributor Author

eltank commented Jul 15, 2021

Created #49957 to fix this again. If you're playing 0.F you won't be able to get the fix until the first patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed <Exploit> Unintended interactions or behavior, usually breaking how the game is balanced Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions Spawn Creatures, items, vehicles, locations appearing on map
Projects
None yet
5 participants