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

Simplify/jsonify NPC generation from npc classes #70314

Merged
merged 5 commits into from
Dec 22, 2023

Conversation

RenechCDDA
Copy link
Member

@RenechCDDA RenechCDDA commented Dec 20, 2023

Summary

Infrastructure "Simplify/jsonify NPC generation from npc classes"

Purpose of change

I look at npc::randomize and I see hardcoded modifiers defined per-class. I weep.

Describe the solution

c44cd1a Prep work, just explained our existing docs and replaced some of the unhelpful existing examples with the full range of what is possible. (We support several ways to define these values but only had one documented...)

08a56d2 Add support to read personality modifiers from the classes' json and modify appropriately. Update docs to explain this, document how it works, etc.

cf77958 Clamp personality scores to the previously-set-but-not-enforced range of -10, 10.

771bbce Migrate the hardcoded modifiers to json

6b9e752 Update the debug menu to display class IDs in addition to class names wherever possible.
image

Describe alternatives you've considered

Testing

Compiles, scores generate as expected. Confirmed that the modifiers apply by putting in some silly values (+200 aggression) before the clamping commit. Debug spawned NPCs until I got one of that class and confirmed their aggression was >200.

Additional context

This PR should probably not be squashed if merged.

Two hardcoded modifiers for increasing the characters' cash value were not maintained. As far as can be told, these were dead code so there is no loss of functionality.

A comment for TODO: give ninja his styles back was also deleted but that appears to be referring to character-specific techniques detached from modern implementations of MAs. And well it's been sitting there for a decade, so... not too worried about anyone missing it.

@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 [C++] Changes (can be) made in C++. Previously named `Code` [Markdown] Markdown issues and PRs Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Dec 20, 2023
@Procyonae
Copy link
Contributor

Wow the way that's working is hella gross, nice work <3

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Dec 20, 2023
@Maleclypse Maleclypse merged commit 3450382 into CleverRaven:master Dec 22, 2023
25 of 29 checks passed
@RenechCDDA RenechCDDA deleted the NPC_class_generation branch December 23, 2023 01:23
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` Code: Infrastructure / Style / Static Analysis Code internal infrastructure and style <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions [Markdown] Markdown issues and PRs NPC / Factions NPCs, AI, Speech, Factions, Ownership
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants