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

Encryption Codes mission creates workstation consoles where they shouldn't be #27618

Closed
DeltaEpsilon7787 opened this issue Jan 14, 2019 · 6 comments · Fixed by #49230
Closed
Labels
<Bug> This needs to be fixed Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions

Comments

@DeltaEpsilon7787
Copy link
Contributor

DeltaEpsilon7787 commented Jan 14, 2019

To Reproduce
Steps to reproduce the behavior:
0. Observe "By Cycle"

  1. Talk to the Doctor
  2. Get a mission to get encryption codes from him
  3. "By Cycle" dungoofed into a random number of consoles.

Expected behavior
A mission should not take less than 5 seconds to complete.

Screenshots
Before
After

Versions and configuration(please complete the following information):

  • OS: Win7
  • Game Version: 8408, 8409, 8419
  • Mods loaded:
[
  "dda",
  "no_npc_food",
  "filthy_morale",
  "novitamins",
  "more_classes_scenarios",
  "no_reviving_zombies",
  "DP_XOTTO_INDICATORS",
  "blazemod",
  "Tanks",
  "deoxymod",
  "boats",
  "Urban_Development",
  "oa_additional_buildings_mod",
  "more_locations",
  "FujiStruct",
  "national_guard_camp",
  "alt_map_key",
  "mutant_npcs",
  "modular_turrets",
  "Salvaged_Robots",
  "no_religious_Texts"
]

Additional context
Save ZIP: save.zip

@DeltaEpsilon7787
Copy link
Contributor Author

DeltaEpsilon7787 commented Jan 14, 2019

UPD: Those consoles are spawned in different places and different amounts, but roughly the same location each time. This may or may not be a memory issue as such. Also the car does get visibly deleted sometimes.

@Zireael07
Copy link
Contributor

Car getting deleted is another issue, already reported.

@ZhilkinSerg ZhilkinSerg added <Bug> This needs to be fixed (S1 - Need confirmation) Report waiting on confirmation of reproducibility Missions Quests and missions Map / Mapgen Overmap, Mapgen, Map extras, Map display labels Jan 27, 2019
@Qrox
Copy link
Contributor

Qrox commented Jul 29, 2019

I haven't tested it, but this could probably happen if there aren't any research facilities nearby in a given range:

void mission_start::create_hidden_lab_console( mission *miss )
{
// Pick a hidden lab entrance.
tripoint loc = g->u.global_omt_location();
loc.z = -1;
tripoint place = mission_util::target_om_ter_random( "basement_hidden_lab_stairs", -1, miss, false,
0, loc );
place.z = -2; // then go down 1 z-level to place consoles.
create_lab_consoles( miss, place, "lab", 3, "Workstation", "Download Encryption Routines" );

At line 655, the range to find lab stairs in is set to '0', meaning a 'whole overmap diameter', as shown here (line 944):

std::vector<tripoint> overmapbuffer::find_all( const tripoint &origin,
const omt_find_params &params )
{
std::vector<tripoint> result;
// dist == 0 means search a whole overmap diameter.
const int dist = params.search_range ? params.search_range : OMAPX;

The value of OMAPX is 180, defined here:

// Size of the overmap. This is the number of overmap terrain tiles per dimension in one overmap,
// it's just like SEEX/SEEY for submaps.
#define OMAPX 180
#define OMAPY 180

However, if no lab stairs are found, the return value is instead the current overmap tile the player is in (line 330):

tripoint mission_util::target_om_ter_random( const std::string &omter, int reveal_rad,
mission *miss, bool must_see, int range, tripoint loc )
{
if( loc == overmap::invalid_tripoint ) {
loc = g->u.global_omt_location();
}
auto places = overmap_buffer.find_all( loc, omter, range, must_see );
if( places.empty() ) {
return g->u.global_omt_location();
}

The following code then searches for labs 2 z-levels beneath the player in a 4-overmap-tile range, which obviously do not exist, so the location of the player is again returned.

void static create_lab_consoles( mission *miss, const tripoint &place, const std::string &otype,
int security,
const std::string &comp_name, const std::string &download_name )
{
// Drop four computers in nearby lab spaces so the player can stumble upon one of them.
for( int i = 0; i < 4; ++i ) {
tripoint om_place = mission_util::target_om_ter_random( otype, -1, miss, false, 4, place );

The end result is that the consoles are placed just nearby the player, as described in the OP.

@inverimus
Copy link
Contributor

The issue appears to be that hidden labs are not spawning/far too rare for one to be found to place the console most of the time.

@PatrikLundell
Copy link
Contributor

0.E2 stable: All the doctor lab missions were bugged for me.

  • The first one showed a lab location, but the actual console was generated two levels deeper than the level marked, but at the same location. If I remember correctly, two identical consoles were generated next to each other.
  • The second one generated a console on the path up to the refugee center, while showing a location down in the central lab. There wasn't any console anywhere in that lab.
  • The third one was two tiles north of the location specified, inside a lab my character had visited earlier (in a desperate search for a working centrifuge, as the ones in the hospitals visited seemed to be the first thing zombies smashed). The level was the correct one, though.
  • The ice lab one was indeed in an ice lab, at the top lab level where the marker indicated it should be. The quest, however, indicated it would be at level four.
  • The rail console was an added function to the rail console in the same lab as the third one, while the marker was higher up and not directly above. No new console spawned at the indicated location.

@int-ua int-ua removed the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label Jan 14, 2021
@int-ua
Copy link
Contributor

int-ua commented Jan 14, 2021

Please add more context to the description. Steps to reproduce are not clear enough.

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 Map / Mapgen Overmap, Mapgen, Map extras, Map display Missions Quests and missions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants