-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Add support for partial armor coverage for monsters #51304
Conversation
Oh, this is great! I have some very specific implementation details for this that I think we should either include at the start, or make sure we future-proof our design for at least. Do you mind switching to draft so I can write that up? |
Lovely! Do remember to add documentation of these fields to |
#51305 is a hastily constructed implementation suggestion. This accomplishes what we need for the first pass, but I hope you can change the JSON formatting and algorithm to fit without too much trouble? It's important so that we can continue onward without getting a giant spaghetti tangle. |
db40cf8
to
b525b22
Compare
bbf7abb
to
eaa50ef
Compare
Phenomenal! I will see if I can find time to add coverage data to some monsters today |
* Modify load_damage_array to specify default * Add weakpoint.h * Implement weakpoint.cpp * Various compiler fixes * Add weakpoints to mtype. * Let weakpoints modify monster armor. * Compiler fixes * weakpoint bugfixes. * Run astyle * Add json documentation * Run json_formatter * Run clang tidy * Fix GCC-only warning * clang-tidy * Clarify weakpoint docs and switch to percentage coverage. * Rename armor offset to armor penalty, flipping the sign.
Hello, I'm starting to add this to DinoMod. One thing I've wanted a long time is to set "the soft underbelly" as a weak point, but only available when the monster is knocked to the ground. This is how every apex dino predator appears to have hunted, especially against ankylosaurids and ceratopsians. Any chance you want to do the code to enable that? https://books.google.com.ph/books?id=IJ9nBUq_hKkC&printsec=frontcover&source=gbs_atb&hl=en#v=onepage&q=tipping&f=false |
Ooh, an effect that adds a weak point temporarily would be nifty. The underbelly suggestion would have to be by monster though. You should suggest it in #51305 |
Summary
Features "Add support for monsters weakpoints: Part 1"
Purpose of change
The change lets contributors specify partial armor coverage for monsters using JSON fields. This also acts as the first pass of #51305.
Many monster have armor that should offers only partial protection. For example, the zombie soldier wears a ESAPI vest that should cover only a part of the torso. However, armor values for monsters currently offer 100% coverage.
In particular, this negatively effects the performance of archery. Many have complained about the inability of bows to deal with even moderately armored monsters. This pull request, combined with several JSON changes, would make archery capable of damaging lightly armored enemies.
This change does not modify any in-game monsters. Determining appropriate coverage and unarmored resistances should be handled in a separate discussion. Given the interest around archery balance, contributors willing to make the JSON only changes should be forthcoming.
Describe the solution
Let contributors specify a list of weakpoints as follows:
Each weakpoint has the following fields:
name
: The name of the weakpoint. Should fit into the sentence: "You hit the zombie in for 13 damage".id
: The ID of the weakpoint. Currently unused, but may become important for weakpoint inheritance. Defaults toname
.armor_mult
: An object that can be parsed byload_damage_array
. Specifies the multiplier in armor when hitting the weak point.armor_offset
: An object that can be parsed byload_damage_array
. Specifies the offset in the armor when hitting the weak point.coverage
: The probability of hitting the weakpoint. In the future, this could be increased by high skill levels.Under the hood
We create a new compilation unit "weakpoint". It contains two structs:
weakpoint
andweakpoints
. Theweakpoints
struct has methods for selecting the weakpoint to hit, and theweakpoint
struct has methods for modifying resistance values. Both have methods for reading from JSON.We add a
weakpoints
field tomtype
and make the necessary modification to "monstergeneration" to support parsing. The reduction in resistances / weakpoint selection is handled inMonster::absorb_hit
.Describe alternatives you've considered
Previously considered solution
Monsters now have an "armor_coverage" field that determines the probability of their armor protecting them. Armor coverage only effects kinetic damage types (blunt/cut/pierce/bullet); acid and fire are unaffected.
In addition, monsters can have "unarmored" resistances. These represent protection that cannot be avoided. For example a soldier zombie's skin is probably as strong as a tough zombie's. Either armored or unarmored resistance is used for protection; they are added together.
Other alternatives
Testing
Verify unarmored resistances
Verify no changes to existing monsters
Additional context
We still need to add messaging support (printing message like "