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

scavenger gear increases extra encumbrance gained for wearing multiple backpacks #55249

Open
catdach opened this issue Feb 9, 2022 · 7 comments
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Character / Player Character / Player mechanics (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@catdach
Copy link
Contributor

catdach commented Feb 9, 2022

Describe the bug

Scavenger gear(and other items on the non specified torso strapped layer like loadbearing vests) increases extra encumbrance gained for wearing multiple items on the "hangs off back" layer; despite these items not conflicting directly with the scavenger gear.

Steps to reproduce

  1. Start a new game, spawn in the scavenger gear and some backpacks/anything worn on the "hangs off back" layer.
  2. Wear everything, note the amount of torso encumbrance after(on the right side) the "+" for wearing multiple backpacks
  3. Drop the scavenger gear (so that it doesn't go into either backpack)
  4. Note that the encumbrance after the "+" has changed.

Expected behavior

The penalty for wearing conflicting items shouldn't be affected by wearing a 3rd item that doesn't conflict with either of them.

Screenshots

with scav gear: 12+5
image
without scav gear: 5+2
image
Seems like it's adding the encumbrance of the 2 smaller items together but not always: 49+12 (note that 12 is not 11+2 (without the firearm repair kit the backpack is 10 encumbrance so maybe it's using that?))
image
when the scav gear is less encumbrance than the backpack it becomes a +9 rather than +12:
image

Versions and configuration

  • OS: Windows
    • OS Version: 10.0 2009
  • Game Version: 9c5e55b [64-bit]
  • Graphics Version: Tiles
  • Game Language: English [en]
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Bionic Professions [package_bionic_professions],
    Graphical Overmap [Graphical_Overmap],
    Stats Through Skills [StatsThroughSkills],
    Stats Through Kills [stats_through_kills],
    Mythical Martial Arts [MMA],
    SpeedyDex [speedydex],
    Magiclysm [magiclysm],
    Graphical Overmap Magiclysm [Graphical_Overmap_Magiclysm],
    C.R.I.T Expansion Mod [crt_expansion],
    Blaze Industries [blazeindustries]
    ]

Additional context

Pre-emptively pinging @bombasticSlacks as they have been working on these items and some similar issues with them.

@bombasticSlacks
Copy link
Contributor

Hey so the 11+2 = 12 is a bit of a weird rounding error though if stuff is bottoming in the players favor that doesn't seem like the worst thing 😉 .

As for the actual issue, I talk about this in the initial PR but it's an issue with our current system for calculating encumbrance.

Basically the game just tracks all the items except the biggest encumbrance on each layer and if you have any conflicts on the layer and body part applies that penalty. Rewriting it would take a lot of work (basically rewriting the whole thing since it would require a complete restructuring) and it doesn't come up often enough for me to make it a priority.

I am sympathetic since it really doesn't make sense in this case but in a lot of other cases it kinda does make sense to apply the penalty. If you were wearing two things of elbow pads and some forearm armor the elbow pads conflicting and moving around would probably also make the arm guards more uncomfortable for example.

So regrettably I wont be tackling this any time soon and it's fairly complicated. For anyone taking a peak the relevant refactoring/redesigning would happen in
Character::item_encumb
and
layer_item in character_attire.cpp

@catdach
Copy link
Contributor Author

catdach commented Feb 9, 2022

"rounding error" might be putting a bit lightly, here's a more extreme case:
image
regardless, I guess it makes some sense for the extra encumbrance to be there, at least in some cases. However it would be nice as a to have at least some sort of indication to where this extra encumbrance is coming from. (Was definitely a frustrating experience for me trying to figure out why my 2 encumbrance item was suddenly 12.)

So regrettably I wont be tackling this any time soon and it's fairly complicated.

Understandable, wish it was an easier problem to solve (as I do for most problems nowadays 😩).

@bombasticSlacks
Copy link
Contributor

Well the issue is because of the items highlighted in yellow. Like scavenger + 1 bag would be fine. Ideally the scavenger would be highlighted some other color but again would require some redesigning. For this situation where you wanna carry gun + bag I added the single point sling. It hangs off your front so you would get no encumbrance penalties wearing scavenger + backpack + single point sling.

Also I'll check the issue youve shown thanks for clarifying it's not just rounding error.

@martosss
Copy link

martosss commented Feb 10, 2022

First of all, it might help to read the wiki page for encumbrance - https://cddawiki.chezzo.com/cdda_wiki/index.php?title=Clothing_Encumbrance#Formula

Here's how I believe layering penalty works:

  • if an item has 0-2 Encumbrance, count it as 2: lower limit so you don't wear 10 items with 0 Encumbrance
  • if an item has 3-10 Encumbrance, count it as 3-10: unchanged;
  • if an item has 11+ encumbrance, count it as 10: upper limit for balancing reasons - the game is being nice to you

Layer penalty - sum up all items except the highest one

+Example: 2,3 => 2+3 - 3 = 2 (pic 2)
+Example: 0,0,0,1,2,5,12 => 2+2+2+2+2+5+10 - 10 = 15(I made that one up)

Now that we've set up some ground rules, here're my comments based on your pictures and on the wiki info:

I agree that something is wrong. I see 1 major problem:

Problem 1) The scavenger gear(SG) is treated as a strapped item and it's counted towards the penalty for the strapped layer. I think that explains your problems.

with scav gear: 12+5 image without scav gear: 5+2 image

I agree, here the penalty should always be "+2", regardless of whether you wear the SG or not. So the penalty in the first picture should be "+2" instead of "+5", I think here the game incorrectly treats SG as part of the same layer and therefore the penalty becomes

- 2,3,7 => 2+3+7 - 7 = 5.(I think that is wrong - it should be only "+2" in this case)

Seems like it's adding the encumbrance of the 2 smaller items together but not always: 49+12 (note that 12 is not 11+2 (without the firearm repair kit the backpack is 10 encumbrance so maybe it's using that?)) image

It's 10+2 (instead of 11+2) because the large tactical backpack is more than 10 and there's an upper limit of 10 per item, so it only adds 10 in this case.

- 2,11,26 => 2+10+46 - 46 = 12. SG is mistreated as a strapped item, apart from that the math is OK.

when the scav gear is less encumbrance than the backpack it becomes a +9 rather than +12: image

Here, again, SG is treated incorrectly as a strapping item and you get

- 2,7,44 => 2+7+44 - 44 = 9. That's what happens.
+ 2,44 => 2+44 - 44 = 2. That's what should happen, I think.

- (Problem 2, editing mistake?) Total values for normal Torso Encumbrance don't add up - on the picture they are 58 on the left, but 5+1+4+7+44+2 = 63?

"rounding error" might be putting a bit lightly, here's a more extreme case: image regardless, I guess it makes some sense for the extra encumbrance to be there, at least in some cases. However it would be nice as a to have at least some sort of indication to where this extra encumbrance is coming from. (Was definitely a frustrating experience for me trying to figure out why my 2 encumbrance item was suddenly 12.)

- 2,16,38 => 2+10+38 - 38 = 12. Again, mistreating SG as strapped, otherwise OK.

I hope that explains the issue and it can be addressed by fixing the SG being mislabeled as a strapped item.

I'm curious what would happen if you wear another item in the SG layer - would that item get penalized together with the SG, or not?

@bombasticSlacks
Copy link
Contributor

You should really try being on experimental to have up to date information.

#53533

I've rewritten large chunks of the conflict code
#52468

@martosss
Copy link

martosss commented Feb 10, 2022

I'd rather stick to "stable" stuff :) I don't want to have random changes in the game behavior. Actually, for the most part it works as expected, I just haven't played around with wearing multiple very encumbering items so I haven't noticed how the "+..." penalty is formed. I'm building up my armor pieces now, so soon I'll have to tackle that.

BTW above post tl;dr; The major issue above seems to be the SG mistreatment as strapped.

In any case, when you fight you want to have as little torso and hand encumbrance as possible, so ideally you should drop the backpacks and have 5-15 total torso encumbrance.

P.S. Bonus - Hand encumbrance also adds to your melee attack action point cost, so if you're using melee weapons you might want to take off any encumbering gloves.

@Traveler319
Copy link

Yeah, it seems like attaching stuff to the new equipment that supports pouches causes problems, but the fact it's doing it on scav gear which iirc has no pouch attachments seems odd to me. I don't have much to actually help here but I can confirm it happens to ballistic vests too. If I wear my tactical radio pouch on my waist directly and put a radio in it, I get 1+0 extra encumbrance, but if I attach it to my heavy ballistic vest it gives 1+7 encumbrance because it makes the vest strapped and conflicts with my chest rig.

@Maleclypse Maleclypse added Mechanics: Character / Player Character / Player mechanics (S2 - Confirmed) Bug that's been confirmed to exist [C++] Changes (can be) made in C++. Previously named `Code` labels Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Character / Player Character / Player mechanics (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

5 participants