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

Dumpster and vehicle storage #70184

Merged
merged 31 commits into from
Dec 22, 2023
Merged

Conversation

worm-girl
Copy link
Contributor

@worm-girl worm-girl commented Dec 13, 2023

Summary

Bugfixes "Vehicle parts check creature size, increases storage of dumpster and vehicle parts"

Purpose of change

Closes #69159
Closes #70180

Several vehicle parts which should logically be able to store a human corpse, namely beds and seats, were unable to do so. Additionally, dumpsters were not providing any storage advantage despite that being their explicit purpose IRL.

As pointed out in the comments, simply turning up the storage volume on seats was problematic as you could then have a seat store both a corpse and a person. Therefore I took the opportunity to make characters and monsters dynamically check cargo space when moving through vehicles. This makes being a mutant, especially a large or huge one, more impactful, and will similarly affect power armor and CBMs if these are ever able to change a character's effective size.

Describe the solution

image

  • Went with the smallest bin here for the dumpster, as it only takes up one tile, though most tilesets mush multiples into a single bigger dumpster. So it's 1500 ml per tile, either way
  • Added LIQUIDCONT to dumpsters, as they will hold fluids IRL if you want to use them that way, and also if you don't

VEHICLE SEAT STORAGE AND COMFORT

  • Made vehicle seats able to hold 80 liters. Reclining seats naturally can make more space, so they get bumped up to 84. The wooden seat and the prison seat are really only just big enough to hold a body, so they get 62.5
  • Vehicle beds hold 100 liters
  • Makeshift seats, cloth seats, bike saddles etc. still hold nothing
  • Also noticed that vehicle back seats were comfort 4, which is the same as a vehicle bed. This made vehicle beds pointless and was causing some players to always replace their front seats with back seats, which doesn't seem like desirable behavior. Reclining and bench seats still have the BED flag, but remain slightly inferior to an actual purpose-build bed
  • Renamed back seats to bench seats and gave them their own item. Many vehicles, particularly older ones, use bench seats up front. Also renamed regular seats to bucket seats to make the delineation clear
  • Reclining seats and bench seats are now both comfort 3, the same as an armchair. If you're a player, that means reclining seats are ideal for maximizing storage and comfort, but bench seats are still slightly superior to normal seats
  • Livestock stalls are now comfort 2, the same as a straw bed. They also have the BED flag
  • Converted bench and bucket seats to use nylon rather than cotton in their construction and repair
  • Gave aisles 100 liters of storage. The vehicle part is described as one square meter in size. A flat one square meter area can actually hold 333 liters of soil (random example item) if you stacked it in a cone shape one meter high, assuming a ~30 degree angle of repose. But this is a vehicle and there's bound to be other stuff in the way, and it's unsecured, etc., so we'll err on the side of caution here. For reference, a standard trunk tile is 300 liters, so aisles are not replacing proper storage any time soon
  • Upgraded floor trunks to 100 liters of storage for parity with aisles. I was not able to find any kind of commercially available floor trunk when searching online. I did see a few custom jobs which I assume is what's going on here, but they seemed quite small. Ideally IMO this vehicle part would be better as a "pocket" for securing items beneath a regular aisle and adding to its storage space, but that isn't currently possible. As-is, this is still a straight upgrade over the aisle as it secures the contents
  • Gave non-upholstered bench-style seats 1 comfort, to match what benches have outside of a vehicle

STORAGE VS CREATURE SIZE

  • Unless a vehicle has CARGO_PASSABLE (doors, floor trunks), if it is able to contain items, the size of characters and monsters will be checked when they try to enter it. CARGO_PASSABLE vehicle parts get a string explaining this feature from the vpart flag
  • This feature currently checks the average volume of a creature of your size, and does not account for BMI or worn equipment. These would be fine expansions to this system, but are out of scope for now
  • If 100% of your body volume is free, you can enter just fine
  • If there is less than 100% but more than 75% of your body volume in free space, you can squeeze in. This applies a negative effect unless you have BENDY1, BENDY2, or BENDY3. Elves and slimes rejoice
  • The cramped space effect slows you, debuffs dex and str, and causes pain. It goes away when you free yourself. It's impossible to sleep in cramped spaces and NPCs will periodically complain about them if stuck there
  • If there is less than 75% of your body volume available, you will be unable to enter
  • If the space has no roof, vehicle tiles have 20% extra space to fit people. Actual cargo space is unchanged
  • Dropping stuff in a space you currently occupy will cause that space to become cramped for you until either you move to a better tile or you move the items which are in the space
  • If you are huge, you will always get the cramped space debuff unless you're in an aisle or a tile with the HUGE_OK flag. Currently that includes the livestock stall, yokes, and cargo spaces, so you're good to ride in the trunk or sleep in the cow carrier. Driving is possible but currently it will always be uncomfortable. However, the new effect is much less janky than the old one, which used to just infinitely apply pain
  • Updated dialog snippets involving NPCs complaining about cramped space. Since people of any size can be cramped, it was inappropriate to have ones directly referencing their hugeness. I took them out and added some more which are less specific
  • Monsters which are more than 850 liters simply cannot fit in any tile which doesn't have HUGE_OK. Very few monsters are actually that big, mostly just hulks, trapped tendrils, the yrax sphenocorona, armored centipede, titan stag beetle and a few others

Describe alternatives you've considered

None

Testing

  • Spawned in, spawned a car, used debug hamerspace to install and uninstall the new seats, saw that they produced the correct items when uninstalled
  • Checked storage capacity on all modified items
  • Checked crafting recipes to ensure nothing weird happened
  • Set up different configurations of vehicle tiles with different amounts of stuff in them. Mutated to different sizes and tested that I could pass only where appropriate for my size
  • Stuck a dead person in a car seat with all the gear they would have been able to wear in it while alive
  • Tried getting in cars with NPCs when there was stuff on the seats. They successfully pathfinded to other seats as well as they ever have
  • Made friendly NPCs of different sizes and observed that they knew which seats would hold them
  • Spawned a vehicle, sat in the driver's seat with the passenger door open, placed a corpse in the passenger seat. Zombies outside were unable to move through the passenger seat, but were happy to smash the car until they could get through.
  • Did the above test with a grappler zombie, saw that it did not use RANGED_PULL as long as the filled seat was in the way, as it's an impassable tile
  • Put a pet cow in a livestock pen, saw that a pet cow was unable to sit in a car seat
  • Let a pet dog into the car and saw that it could go where it needed
  • Saw that vehicle-pushing monsters aren't acting weird
  • Spawned monsters inside of a vehicle to make sure that was working too

Additional context

Overall this is a pretty big buff for vehicle storage, but I don't really see that as an issue if it's more realistic this way. Additionally, players are constantly needing more storage space as crafting gets more complex and more junk gets added for them to haul around.

I do absolutely think that when swerving at high speeds or colliding with things, unsecured items should go flying around the inside of the vehicle, possibly breaking, getting flung from the car, or hurting the occupants. I suspect it would be difficult to do this without massive lag but it would be super funny.

While working on this, I realized it may be a good idea to add a json field for furniture and vehicle parts that increases the cost to retrieve items stored there. This would be appropriate for high volume storage solutions which have no compartments or shelving, such as the dumpster. It can hold a lot, but getting stuff out of it would be inconvenient.

image

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Vehicles Vehicles, parts, mechanics & interactions Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. <Bugfix> This is a fix for a bug (or closes open issue) json-styled JSON lint passed, label assigned by github actions astyled astyled PR, label is assigned by github actions labels Dec 13, 2023
@github-actions github-actions bot added BasicBuildPassed This PR builds correctly, label assigned by github actions and removed BasicBuildPassed This PR builds correctly, label assigned by github actions labels Dec 13, 2023
data/json/recipes/other/parts.json Outdated Show resolved Hide resolved
data/json/recipes/other/parts.json Outdated Show resolved Hide resolved
@PatrikLundell
Copy link
Contributor

I still don't think seats should both act as large storages at the same time as a passenger seat (or bed). While you could presumably (no personal experience, obviously) strap in a corpse in a passenger seat, trying to stack the same volume of random stuff on the seat will be quite dangerous, as stuff would topple off the tile during driving and some of it could end up under the driver's pedals.

@worm-girl
Copy link
Contributor Author

worm-girl commented Dec 14, 2023

I still don't think seats should both act as large storages at the same time as a passenger seat (or bed). While you could presumably (no personal experience, obviously) strap in a corpse in a passenger seat, trying to stack the same volume of random stuff on the seat will be quite dangerous, as stuff would topple off the tile during driving and some of it could end up under the driver's pedals.

70 liters isn't large storage. I've driven with groceries in my lap and I have driven with unsecured furniture and huge piles of groceries, boxes of books, and God knows what else in the passenger seat. There were no problems, and it's hardly less safe than anything else characters do, especially as the game takes place in a world with no traffic.

As stated in the PR, I think adding consequences for unsecured belongings and bad driving is a swell idea, but it's no reason to prevent logical and realistic behavior. People do this IRL all the time.

@worm-girl
Copy link
Contributor Author

And to be clear, this wasn't just down the street and back. I moved over a thousand miles with all of my earthly belongings loaded up this way at high speeds on the freeway.

@OldFriendEr
Copy link
Contributor

putting a corpse or tons of junk on the seat is ok in my opinion, but what about storing 60L of items on the seat and then sitting on it and taking controls?
I think the main issue with seat item capacity is that the items and living creatures do not share the space on the seat.

@worm-girl
Copy link
Contributor Author

putting a corpse or tons of junk on the seat is ok in my opinion, but what about storing 60L of items on the seat and then sitting on it and taking controls? I think the main issue with seat item capacity is that the items and living creatures do not share the space on the seat.

I addressed this in the PR.

@worm-girl
Copy link
Contributor Author

Working on a solution to characters not counting as cargo. I think I've almost got it, will reopen when I do.

@worm-girl worm-girl marked this pull request as draft December 15, 2023 14:13
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` and removed astyled astyled PR, label is assigned by github actions labels Dec 15, 2023
@worm-girl
Copy link
Contributor Author

I thought I had a very clever solution that worked quite well, and then I discovered that the stuff I edited in game.cpp was at the avatar level and not character. I have no idea how NPCs move.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Dec 15, 2023
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
src/monster.cpp Outdated Show resolved Hide resolved
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Dec 21, 2023
@worm-girl
Copy link
Contributor Author

There we go. All tests are passing except a mapgen test which is failing for all PRs and has nothing to do with this.

@Maleclypse Maleclypse merged commit c390b86 into CleverRaven:master Dec 22, 2023
21 of 26 checks passed
@ehughsbaird
Copy link
Contributor

The vehicle part is described as one square meter in size

This description is clearly out of line with other handling of vehicle tile size, e.g. #68603.

@worm-girl
Copy link
Contributor Author

The vehicle part is described as one square meter in size

This description is clearly out of line with other handling of vehicle tile size, e.g. #68603.

Tiles are not consistently sized and never will be, it's all just ballparked between one and three square meters. This means in cases where I don't have a real world item (such as a wheelbarrow or specific vehicle trunk) to go off of, I am forced to make somewhat arbitrary decisions.

If you start trying to do otherwise, you realize that all of our cars are like twice as big as they should be, tile-wise, but if they weren't as big as they are, we wouldn't be able to fit the necessary number of characters and seats inside, because in this game a human takes up an entire tile, just like a rat or an elephant. It's unfortunately necessarily nonsensical.

An aisle usially means something like the aisle of a city bus, which is about that wide in my city. Since that's the case they're most often placed in the world as, that's what I have gone with. It also matched the existing description. It makes logical sense that such a space could hold as much as it does, so that's what we have.

@ehughsbaird
Copy link
Contributor

As far as I can tell, the established standard is vehicle parts are 0.5x0.5m square. For things like storage volume especially, this seems like an appropriate measure to use.

@worm-girl
Copy link
Contributor Author

worm-girl commented Dec 24, 2023

There isn't really any kind of standard like that. A vehicle bed for instance would have to be almost two meters long and easily a meter wide, but it only occupies one tile. A wing mirror is a few inches across, still fills a tile.

An aisle must hold more than a seat and be easier to maneuver through. These things are true because it's bigger. It has less capacity than something like a trunk (whosd volume is derived from actual manufacturer measurements). Logically about 100 liters of stuff (a corpse and a backpack, for instance) could be piled up there. That all checks out.

If there's some issue with the description, it still wouldn't affect the storage volume, as the volume was decided somewhat arbitrarily since it is not a container but a flat space. The dirt example in the PR text was a sanity check which common sense says we still pass. I said one square meter could hold 333 liters of dirt. If it's a half square, that's 115, which is just about what we have.

@worm-girl worm-girl deleted the storage-buff branch December 24, 2023 22:25
@ehughsbaird
Copy link
Contributor

I have reason to believe there is: #68705 (comment)

@worm-girl
Copy link
Contributor Author

worm-girl commented Dec 25, 2023

🤷‍♀️ Even so it doesn't affect anything other than a single comment line in the json that I didn't write. I wildly undershot the cargo size because 333 liters seemed excessive (how could an aisle hold more than a trunk?) and it looks like I was correct to do so.

A trunk, if it's a .5 meter space, holds 300 liters. It is able to do this because it's enclosed. An aisle, if it's a .5 meter space, holds 100 liters. It holds less than a trunk because it's not enclosed. Makes sense to me.

I don't think changing a single number in a comment line that players can't even see is worth opening a new PR for.

@ehughsbaird
Copy link
Contributor

Sorry, I was just trying to notify that what that aisle is saying is (by a statdard partially applied to some parts) wrong. I wasn't trying to suggest changes or anything (it's a comment on a closed PR, I wouldn't be surprised if nobody read it), unless you thought changes were necessary as a result.

@worm-girl
Copy link
Contributor Author

I changed the comment in #70393

@TinglePan
Copy link

TinglePan commented Dec 28, 2023

I dragged my travois into a deadend and found myself stuck, with prompt "There's not enough room for you to fit there". Kinda annoying.
Me be like:
"###"
"#@#"
"#o#"
"@" is me, "o"is my travois.

@worm-girl
Copy link
Contributor Author

I dragged my travois into a deadend and found myself stuck, with prompt "There's not enough room for you to fit there". Kinda annoying. Me be like: "###" "#@#" "#o#" "@" is me, "o"is my travois.

Thank you for bringing this to my attention, I'm doing a PR to fix something else tonight and I can make travois work properly too. It's just a couple of sticks on the ground, you should be able to step over it even if it's full.

@kasanryukin
Copy link
Contributor

kasanryukin commented Dec 29, 2023

https://safesandmore.com/products/truckvault-floorvault-base-line-for-suv-vehicle-floor-storage-2-compartments?variant=43490782871712

Floor trunks are marketed as floor vaults if you want to do some research into that for a future PR.

@worm-girl
Copy link
Contributor Author

I dragged my travois into a deadend and found myself stuck, with prompt "There's not enough room for you to fit there". Kinda annoying. Me be like: "###" "#@#" "#o#" "@" is me, "o"is my travois.

This issue will be solved if #70393 is merged.

@@ -202,7 +213,7 @@
"damage_modifier": 60,
"durability": 95,
"description": "A small but comfortable bed.",
"size": "50 L",
"size": "100 L",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprised this passed tests you appear to have added an extra space after the number (More interested in tests catching this in future than a change to this specifically)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, yeah. I have fixed it in #70560 but that's something that shouldn't be getting through.

@maniak1349
Copy link

maniak1349 commented Jan 26, 2024

  • Upgraded floor trunks to 100 liters of storage for parity with aisles.

It seem to still be 87.5L. Did you forgot to change it?
Also right now floor trunk makes no sense whatsoever - it requires the same amount of time-effort-additional-resource to install, have the same durability and walk speed, but requires specific part instead of readily available sheet metal, weights more and accepts less cargo (same cargo when fixed).

@kasanryukin
Copy link
Contributor

kasanryukin commented Jan 26, 2024 via email

@maniak1349
Copy link

he floor trunk is meant as a walkable option when it's full, unlike an aisle which blocks passage when full.

Oh, I see. Didn't know that. That's a fair game then.
Also is there a way to tell a tileset to show full parts like that differently?

@kasanryukin
Copy link
Contributor

kasanryukin commented Jan 26, 2024 via email

kevingranade added a commit that referenced this pull request Jun 12, 2024
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` Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Monsters Monsters both friendly and unfriendly. NPC / Factions NPCs, AI, Speech, Factions, Ownership Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Dumpster volume is too low and should be incrased Vehicle beds should be capable of holding a human corpse
10 participants