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

Random NPCs have the same starting skills and proficiencies as the average new character #74013

Merged
merged 4 commits into from
May 24, 2024

Conversation

RenechCDDA
Copy link
Member

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 class

myclass = npc_class::random_common();

...but myclass was not used to determine the resulting proficiency/other values. Always the empty type. This meant that if the new NPC randomized into a class with proficiencies... it didn't get the proficiencies, because the null type 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:
image

Additional context

Randomized NPCs were getting values from NC_NONE instead of their actual randomized class. FIX THAT.
Also remove extraneous class reference "the_class" to head off future confusion
@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. NPC / Factions NPCs, AI, Speech, Factions, Ownership [JSON] Changes (can be) made in JSON Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Character / World Generation Issues and enhancements concerning stages of creating a character or a world Game: Balance Balancing of (existing) in-game features. json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels May 22, 2024
@github-actions github-actions bot added Mods Issues related to mods or modding Mods: Aftershock Anything to do with the Aftershock mod labels May 23, 2024
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label May 23, 2024
@dseguin dseguin merged commit 92260da into CleverRaven:master May 24, 2024
27 checks passed
@RenechCDDA RenechCDDA deleted the NPC_proficiencies branch May 24, 2024 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Character / World Generation Issues and enhancements concerning stages of creating a character or a world <Documentation> Design documents, internal info, guides and help. Game: Balance Balancing of (existing) in-game features. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs Mods: Aftershock Anything to do with the Aftershock mod Mods Issues related to mods or modding Mutations / Traits / Professions/ Hobbies Mutations / Traits / Professions/ Hobbies NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants