CleverRaven / Cataclysm-DDA

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

Spawns sealed food container with insufficient contents #67634

Open marimarigi opened 1 year ago

marimarigi commented 1 year ago

Describe the bug

In low "Item spawn scaling factor" world, spawns sealed food containers with insufficient contents such as one canned tomato.

Attach save file

N/A

Steps to reproduce

  1. Create a world with low "Item spawn scaling factor". (e.g. 0.10)
  2. Start the game in that world.
  3. Explore some houses, find sealed food containers.

Expected behavior

Either a sealed food containers with full contents is spawned or nothing is spawned.

Screenshots

referenceImage

Versions and configuration

Additional context

Probably related to #60885. I think this is because the result of '"charges": X' is either 0 or X, but the result of '"count": X' is spread from 0 to X.

mqrause commented 1 year ago

The version right after yours has a fix for a bunch of related issues. I'm not sure how item spawn scaling is affecting all this, though, so would be great if you could test and reconfirm it with an updated version.

marimarigi commented 1 year ago

It also happens on version 2023-08-13-0522.

referenceImage2

SurFlurer commented 1 year ago

/confirm I think I can figure out a fix for this.

SurFlurer commented 1 year ago

So there are two separate issues...

  1. Cans will spill, so is_container_full() in seal() will falsely report that they are full.
  2. Sealed itemgroups aren't placed monolithically, so low item spawn rate will make the game harder than it should be: nearly no container are to be spawned sealed, making shelf-stable food too rare.
marimarigi commented 1 year ago
  1. Sealed itemgroups aren't placed monolithically, so low item spawn rate will make the game harder than it should be: nearly no container are to be spawned sealed, making shelf-stable food too rare.

Players with low spawn rate whould basically want it. Also, if players think it's too hard, they should readjust the rate.