CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.62k stars 4.17k forks source link

Adding granularity to items representing collections #53718

Closed pjf closed 1 year ago

pjf commented 2 years ago

Is your feature request related to a problem? Please describe.

As discussed in #53635, we have objects—such as handfuls of nuts, powders, and spices—which really represent a collection of smaller objects. While we don't want to model individual nuts or flakes of oregano, we do want some way of indicating the size of the granules in the collection.

Having this granularity information means we can do checks like making sure string or mesh bags can't hold things like a handful of sand, and means that having containers for items like spices and powders makes more sense, especially since they already spawn in these containers.

The granule size may also impact rummage/clutter mechanics as suggested in #53657 and elsewhere.

Solution you would like.

Some sort of JSON attribution on items to indicate the smallest hole size they cannot pass through.

@I-am-Erk has suggested this might go into phase attribute, but we may have a dedicated granule_size or similar. I'm not familiar enough with the code to have an expert opinion on this.

Describe alternatives you have considered.

Heaping all of my herbs, spices, and nuts into a big pile under the sink without any containers and bags. :)

Additional context

No response

Alex-Folts commented 2 years ago

Something like: add grid size parameter to non watertight containers and same parameter for powders(non liquid items with charges), and if container grid size > item grid size do not accept item because it will fall through holes in container?

I-am-Erk commented 2 years ago

I'm not sure how valuable it would be to track size of individual objects that closely

Photoloss commented 2 years ago

The larger ones could probably be converted to single items using longest_side for the particle size and a stack size for the current portions. We already do this for marbles, pebbles and bearings because they are used as individual ammo, food might need an exception to #53631 and some changes to recipe handling so we can easily shell and eat individual nuts.

If longest_side is used to represent grain size then that should definitely be noted in a comment, we do use a tiny max_item_volume on bottles to basically restrict them to liquids which basically is the inverse problem.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. Please do not \'bump\' or comment on this issue unless you are actively working on it. Stale issues, and stale issues that are closed are still considered.

Night-Pryanik commented 1 year ago

Closing as stale, since stalebot can't do it by itself.