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

Basecamp: fix issues with basecamp recipes #35262

Merged
merged 3 commits into from
Nov 5, 2019

Conversation

mlangsdorf
Copy link
Contributor

@mlangsdorf mlangsdorf commented Nov 2, 2019

Summary

SUMMARY: Bugfixes "Basecamp: fix issues with basecamp recipes"

Purpose of change

Fixes #34776
Fixes #32643

The basecamp construction requirement autocalc code is not supposed to save the tinymap at 0,0,0 used to determine construction requirements, but does. Work around the issue by creating the tinymap at 0,0,-9 where most players are unlikely to find it.

Basecamp recipes that use "skill_used" and "difficulty" did not correctly report the skill requirements during mission selection, even though the requirements showed up during companion selection. Fix that issue and generally clean up handling of skill requirements during companion selection.

Describe the solution

Create the fake_map used to set up construction requirements at 0,0,-9 instead of 0,0,0.

Print recipe requirements that use "skill_used" and "difficulty" instead of the the skills_required map. For recipes that use skills_required, print each skill and whether the NPC meets the requirements in the companion selection menu. Confirm that NPCs meet the requirements and don't let them be selected if they do not.

Describe alternatives you've considered

skill_used and difficulty should be just rolled into skills_required, possibly, but I'm not sure about the additional effects in other part of the code.

Testing

Started a new game and teleported to 0,0,0 and confirmed that it was a normal field like the fields all around it. Then teleported to 0,0,-9 and confirmed there was the remnants of the fake map.

Created a faction camp, and verified that complex buildings like wattle-and-daub displayed both skills (Fabrication 4, Survival 3) in both the mission description and companion selection menu. Confirmed that single skill recipes like the Garage showed correctly in both menus. Confirmed that I couldn't select an NPC that didn't have the required skills and that I could select an NPC that could.

The code that calculates the resource cost for faction camp activities
needs to scribble on a tiny map.  The tiny map is not supposed to be
saved, but it is, leading to weird, half-built buildings at overmap
position (0,0,0).

Move the fake map to (0,0,-9) where it is much less likely that
anyone will ever encounter it.
@mlangsdorf mlangsdorf requested review from esotericist and a user November 2, 2019 20:27
@mlangsdorf mlangsdorf added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Map / Mapgen Overmap, Mapgen, Map extras, Map display Player Faction Base / Camp All about the player faction base/camp/site labels Nov 2, 2019
@esotericist esotericist removed their request for review November 2, 2019 21:27
@esotericist
Copy link
Contributor

I'm not in a position to look closely at the actual c++ code right now, but as a stop-gap measure to fix the user-facing bug on the way to 0.E, this makes sense (given that it'd basically require a max depth lab to happen to spawn at 0,0).

Hopefully the actual problem can be tracked down at some point, after we're past the release.

@mlangsdorf mlangsdorf force-pushed the basecamp_fixes branch 2 times, most recently from 7e79bbc to 75d4d68 Compare November 3, 2019 03:10
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've forgotten a lot of faction camp code, but I'll try and dig in a bit more later.

src/recipe.cpp Outdated Show resolved Hide resolved
src/mission_companion.cpp Outdated Show resolved Hide resolved
I don't want to know about how a recipe is storing the skills internally,
I just want to print out what skills are needed to do something.
Fixes CleverRaven#32643

Adjust how skill requirements are reported and handled: multiple skills
are reported both in the mission description and the companion selection
menu, legacy "skill_used" requirements are reported and honored, and the
player cannot select a companion who doesn't have the skills to do a job.

The legacy " COMBAT : SURVIVAL : INDUSTRY " header is only used for jobs
that don't require any skills.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Map / Mapgen Overmap, Mapgen, Map extras, Map display Player Faction Base / Camp All about the player faction base/camp/site
Projects
None yet
3 participants