-
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
Characters have actual volume, sane-ify sane-ified vehicle size checks. Enforce with unit tests #74162
Characters have actual volume, sane-ify sane-ified vehicle size checks. Enforce with unit tests #74162
Conversation
I spent a long time trying to get power armor to stop people from fitting through windows and sitting comfortably in compact cars, but every fix I tried wound up messing with BMI and calorie requirements. If this actually makes the player feel like they're wearing T-60 power armor (including making them big enough to use knockdown and knockback techs on bigger enemies) that will be completely awesome. |
cc7d8ce
to
aa6def4
Compare
aa6def4
to
ea41c1c
Compare
ea41c1c
to
f8eaf93
Compare
Volume based on height is great, but what if my character is "Morbidly Obese" as well (e.g. "Weight XXXL" starting trait)? |
Can't wait until this get merged. will you be unable to use Mech suits / Combat Exosceletons designed for normal sized people with this? |
item_location wep = get_wielded_item(); | ||
units::volume wep_volume = wep ? wep->volume() : 0_ml; | ||
// Note: Does not measure volume of worn items that do not themselves contain anything | ||
return get_base_volume() + volume_carried() + wep_volume; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
volume_carried() here doesn't seem appropriate, unless I'm reading it wrong wearing a giant empty rucksack counts as 0, while a snack bar in my jeans pocket apparently makes the space I'm in more cramped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the intention. Using worn clothes' volume would be wildly inappropriate, since (depending on the clothing in question) it would add negligible amounts of volume to your person. A wetsuit is 5L, but it's definitely not going to add 5L of volume to your person when being worn.
There is room for more nuance here, like separating out rigid and non-rigid items and materials.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
volume_carried() is wildly inappropriate too imo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How? If you're carrying a 500L fridge and you try to step into a vehicle it's... just not gonna work? Same thing if you're wearing a huge box backpack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same thing if you're wearing a huge box backpack.
volume_carried() doesn't count that as volume unless it's full which was my original point...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does? In the tests we use a giant novelty backpack with 80L of volume capacity. Putting it on and putting a 10L rock into it causes an open tile to become cramped for movement purposes. It increases the character's volume from 70L to above 75L (where the aisle starts being cramped). If it counted the full 80L then our total volume would be 70+80 = 150L, and we couldn't move through the aisle at all. But we can, and it's just cramped.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's my point... the novelty backpack should be counting the full 80L (or whatever volume takes up when empty) bc it's not surrounding the player like a wetsuit. At the very least you should be counting BELTED stuff.
It's also pretty silly that like a flak jacket with plates would count the plates volume but an empty power armour suit wouldn't count as anything.
There is no difference in volume calculation based on body fat. I tried reading up on it but calculating that turns out to be "it's complicated" and varies greatly depending on age and sex. If you are interested in adding this, I recommend |
Summary
None
Purpose of change
Fixes #74068
Please stop pinging me. Yes I saw the first one
Describe the solution
Give characters actual volume
Remove pain from cramped space
Completely different volume calculation for characters, not related to monster calculation
(this is a big one)
--- >Character volume includes carried volume, including their weapon < ---
(big one up above!)
Flip an oopsie greater than
Embrace testing, testing is good
Describe alternatives you've considered
Revert?
Testing
my own unit test is currently failing.it passes nowAdditional context
Character size to volume is based on height, but here is a (better) graph plotted to the average heights for each size class:
Note: There still might be some json weirdness where volumes don't match up to what is 'expected'. I would expect some seats to be cramped, this is intended. Cramped space no longer gives pain and a penalty to fighting inside a restricted vehicle space makes sense to me. So yes, if you can't swing your broadsword 100% effectively from the driver's seat that is intended behavior.
If you find a vehicle part that looks wrong, please feel free to PR a fix. I did not exhaustively review each and every cargo vehicle part.