-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Restore variable encumbrance #40321
Restore variable encumbrance #40321
Conversation
I see @wapcaplet (#40314) and I have trodden on each others toes a bit here. I need to rebase now. |
b9133d2
to
b90af43
Compare
looks like json needs linting |
maybe cargo pants can finally be less encumbering than many armours with this eh? |
0798d92
to
1ee7e59
Compare
I've realised that this is actually a fairly substantial behaviour change because previously the variable encumbrance only applied to things that either had an explicit We probably need a review of the encumbrance of all those items. Or maybe we can think of a better default behaviour than what I've currently implemented for items lacking a |
There are some issues in the tests I need to get to the bottom of, so marking as draft. I'd still appreciate thoughts on how to deal with increased encumbrance for existing items, though. In particular, is it acceptable to merge this first and fix the items later? |
I'm sure we can fix it in items, I'll happily go through some after this is merged! |
I would say that there is no problem with fixing the items later, many probably will need some thinking to balance their encumbrance numbers, cargo pants being a great example, in the future it would be better to drop the base encumbrance of all the items with several pockets so as to not end with an insane encumbrance... That said, in the meantime the cargo pants will be basically useless haha, I think those could do better with a max_encumbrance and a reduced base encumbrance. In another note, many players will be annoyed by the sudden change in encumbrance of their regular clothes, so a little warning could do. Edit: Why don´t, in the meantime, you have the formula for encumbrance check the max volume storage of the item, and, as more storage the item has, the less encumbrance it receives for every 250 ml of items? The items with a low number in storage capacity are (generally) not designed to have their pockets full and be comfortable to use, but the items with more storage capacity, like the cargo pants are designed in a way to make the items in storage not encumbrance you so much. In that way, most items will have encumbrance in reasonable levels in the meantime of being changed their exact numbers. |
I've written a script which does a decent job of identifying the items that need updating. Hopefully I'll be able to adapt it to perform a minimally reasonable update to these items so that encumbrance doesn't go too crazy as soon as this is merged. |
Great! Thanks! |
732dec7
to
2fb4503
Compare
1b4b6d6
to
0d6fc16
Compare
One feature that got lost in the nested containers implementation was that non-rigid worn items should change their encumbrance with volume. Reinstate that feature. It makes more sense than it did previously because now we know how full each individual item is, rather than having to approximate based on the overall inventory usage.
These tests had been marked !mayfail as part of the nested containers implementation. Now they can be fixed. Fix them, updating the test data accordingly, and remove the !mayfail marking.
Rename function to clarify meaning.
This assertion hit in the CI tests, so it shouldn't be fatal.
This calculates the actual maximum volume of contents of the pocket. Unlike item_pocket::volume_capacity, which doesn't account for ammo contents.
Now pocket_data's former max_contains_volume is called volume_capacity and there's a new method max_contains_volume that calculates the actual maximum possible volume of contents.
9e78847
to
7e89377
Compare
This tests the calculation of ammo volumes.
7e89377
to
4ed430d
Compare
I got the automated script working. For all the things that appeared to be "regular storage" clothing and didn't already have a I think that should suffice for a first pass, but people will need to keep an eye out for items with silly values. Then there was a bug with quiver volumes that took me several days to track down. Now finally fixed, I believe. Along the way I enhanced the iteminfo tests (changes I made to debug that quiver issue, but which are probably a good idea regardless). So, if the tests now look good, then I think this one should be ready to go. |
Looks like these flags were overlooked in the migration.
I'm fairly sure both of these were intended to be rigid. Probably got lost in the migration to pockets.
For each item which had non-zero encumbrance, but not max encumbrance, and which wasn't a holster, restricted container, or rigid: - Add a max_encumbrance field equal to the old encumbrance value. - Update encumbrance to max(max_encumbrance / 2, max_encumbrance - capacity / 250ml).
To help debug encumbrance test failures.
I saw a failure here in the recipe test where the avatar knew the recipe when they shouldn't. I didn't get to the bottom of what was going on, but calling clear_avatar fixes it.
Remove a stray comment in item.h This close-brace no longer has a matching opening brace. I guess it was lost in the nested containers implementation. Delete the dangling brace. Typo in an unrelated comment.
4ed430d
to
5a49ef7
Compare
My script had updated the encumbrance of power armour because the pockets thereon were non-rigid. I'm fairly sure power armour storage should be rigid. Make it so, and restore the old encumbrance values.
Summary
SUMMARY: Features "Restore variable encumbrance for non-rigid containers"
Purpose of change
One feature that got lost in the nested containers implementation was that non-rigid worn items should change their encumbrance with volume.
Describe the solution
Reinstate that feature.
It makes more sense than it did previously because now we know how full each individual item is, rather than having to approximate based on the overall inventory usage.
Each 250ml adds one unit of encumbrance, unless an explicit
max_encumbrance
value is given, in which case the encumbrance interpolates between the two endpoints.Describe alternatives you've considered
Requiring
max_encumbrance
to be given.Testing
Restored the
iteminfo
unit tests which cover this case (they are no longer[!mayfail]
) and update the test data accordingly.Additional context
I was getting annoyed by the expected failures in the tests.