CleverRaven / Cataclysm-DDA

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

Items have more mass than the sum of their parts #36399

Open Bejofo opened 4 years ago

Bejofo commented 4 years ago

Describe the bug

Some items in game seem to defy conservation of matter when disassembled or assembled

Steps To Reproduce

Steps to reproduce the behavior:

  1. Disassemble a sand bag.
  2. Note the decreased mass ( 24.41 kg-> 0.49 kg)

Expected behavior

Things to remain more or less similar in mass.

Versions and configuration

Additional context

I wrote a script to try and find other such cases. I'am fairly certain it missed quite a few, and some of the numbers are off, but I think it's a start.

Item Weight Calculated weight (g) Actual weight (g) Δ (g) Percent diff
washing_machine 8093 31752 23659 292.34
sandbag 895 24415 23520 2627.93
amplifier_head 1323 11339 10016 757.07
hard_plate 24000 32640 8640 36.00
multi_cooker 2728 11339 8611 315.65
welder_crude 1002 7250 6248 623.55
blunderbuss 2741 8267 5526 201.61
steel_plate 8000 12880 4880 61.00
extinguisher 5509 9071 3562 64.66
voltmeter 468 3000 2532 541.03
fan 329 2857 2528 768.39
char_smoker 1005 2600 1595 158.71
coilgun 1817 3341 1524 83.87
oxygen_tank 900 2268 1368 152.00
sm_extinguisher 900 2267 1367 151.89
rifle_223 2741 4080 1339 48.85
camera_pro 978 2268 1290 131.90
leather_harness_dog 997 2145 1148 115.15
vac_sealer 1309 2449 1140 87.09
snipercup commented 4 years ago

Nice, I did a similar thing with the weight analyser in https://github.com/snipercup/CCDA-JS-data-browser except from a recipe perspective, looks like you are coming from a disassemble perspective. I did some balancing then, for example #34916. It all spawned from issue #33327.

Basically you want the item to conseve mass when constructing and deconstructing. You already indexed some items where the mass is not preserved in deconstructing. In issue #33327 there was talk of enforcing the conservation of mass trough c++ but I only invested in balancing the current items in preperation for that.