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

damaged armor scaling appropriately #59529

Merged
merged 5 commits into from
Jul 24, 2022

Conversation

bombasticSlacks
Copy link
Contributor

@bombasticSlacks bombasticSlacks commented Jul 23, 2022

Summary

None

Purpose of change

Damaged armor was completely broken for calculating protection values and has been for years. the damage value (0-4) was being subtracted from thickness to arrive at a protection value. Recently with bringing in real thicknesses and multi materials this means that any damage to almost all armor made it useless. This was also applied separately to each material. So for example everything under 1mm 0 protection after 1 tick, everything under 2mm 0 protection after 2 ticks, half protection after 1. This also made really thick stuff like ballistic plates extra powerful since 25 - 4 (nearly destroyed state) is still 21 thickness.

Describe the solution

Removed this direct additive scaling of thickness.

Now for each damage level the OVERALL protection of an item after all calculations is scaled by 12.5%. So something about to fall apart has 50% defense, something that is only slightly damaged will have 12.5% reduction in protection value.

Describe alternatives you've considered

Testing

Curious if this breaks any DPS tests

Additional context

This probably fixes a number of "why is my armor breaking so fast" issues, since the armor would still be getting hit but have a protection value of 0 to resist taking further damage.

Also I really need to at some point in the future refactor all these functions they are all identical except for a single nested call.

@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Jul 23, 2022
@descan
Copy link
Contributor

descan commented Jul 24, 2022

This is probably beyond the scope of this PR, but perhaps different materials should have different scales for how much protection they lose per tick? Some things would still be fairly protective even at tatters, while other things are more dependent on a cohesive structure for their strength. Something like leather is probably still fairly protective even with a fair few holes in it, while a cracked/shattered ceramic plate is a lot less protective than its whole counterpart. (which we have a specific item for, but it's an example - other materials are also fairly structurally dependent).

Would likely need some research for a) if enough materials represented in-game are so different enough to warrant the infrastructure for this, if it's not already extant, and b) what those different ticks should be.

@bombasticSlacks
Copy link
Contributor Author

Yeah similarly, some materials should probably increase encumbrance and decrease coverage as they take damage. Not looking to overhaul rn tho, just looking to fix.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Jul 24, 2022
@kevingranade kevingranade merged commit 4abdbc8 into CleverRaven:master Jul 24, 2022
@NetSysFire NetSysFire added <Bugfix> This is a fix for a bug (or closes open issue) Items: Armor / Clothing Armor and clothing labels Jul 24, 2022
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 <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Items: Armor / Clothing Armor and clothing json-styled JSON lint passed, label assigned by github actions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants