Random NPCs have the same starting skills and proficiencies as the average new character #74013
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Balance "Random NPCs have the same starting skills and proficiencies as the average new character"
Purpose of change
Players got buffed, but our NPCs are still churls without driver's licenses?!
Maintainability for NPCs is poor, let's fix that.
Describe the solution
-Fix a pretty bad bug with bad variable handling. Proficiencies and a few other values were being set by the passed argument
type
... this was in all cases npc_class_id::NULL_ID().myclass
was set by randomizing from a common NPC classCataclysm-DDA/src/npc.cpp
Line 605 in 9640195
...but
myclass
was not used to determine the resulting proficiency/other values. Always the emptytype
. This meant that if the new NPC randomized into a class with proficiencies... it didn't get the proficiencies, because the nulltype
has no proficiencies. Enormous sigh.-Apply the default starting character background to NPCs if they are randomly generated (unique classes can still do whatever they want). Add a special modifier so that the skills gained from these backgrounds don't interfere with existing skill definitions, they only raise the bare minimum. Basically this means random NPCs start proficient in driving and home cooking with very basic skill levels, just like the player character.
NPCs have learned how to drive! Hooray!Not yet.Because this draws form the same starting background as the player character it should automatically track any future changes without any specific handling. Maintainability!
-In the interests of maintainability and ease of contributing, make their proficiency learning recursive instead of simply failing if a pre-req is missing. This means that if our proficiency trees change in the future (by adding a new proficiency or removing an existing link into a new tree), contributors will not to go through and laboriously re-verify every NPC class' proficiencies. They simply define the top-level ones they should have, and all the pre-reqs fill in from there.
Describe alternatives you've considered
Completely combining professions and NPC classes? That is a suggestion which has been put forth before...
common
is maybe not the optimal way to determine if the adult_basic_background should be applied, but bumping that out to a new json value is incredibly simple if any problems arise.Testing
Many newly generated NPCs, all of which had driving, food prep, and minimum skill levels. Here's one:
Additional context