Cataclysm-DDA icon indicating copy to clipboard operation
Cataclysm-DDA copied to clipboard

Corpse rising too early while being butchered

Open PatrikLundell opened this issue 3 weeks ago • 1 comments

Describe the bug

I killed two acid ants, brought them back to base, bled them and butchered them. Way through the butchering of the second one it "rose" as a meat cocoon. I destroyed it, and was left without any butchery results (apart from the blood). The ants were the second smallest, with a 33 minute bleeding time and a "3 hour" full butchery time (which means anywhere from 3-4 hours, due to C truncation).

Attach save file

N/A. I can't provide anything that provides any info beyond the above.

Steps to reproduce

  1. Kill two acid ants.
  2. Bring them back to base (probably 15 minutes or so).
  3. Bleed them and butcher them.
  4. Instruct companions to perform new crafting and move 500 wheat in two batches a short distance (picking up takes time).
  5. Have your butchery of the second one interrupted by the "rising" of a meat cocoon.

Expected behavior

  • It should take a much longer time than 8 or so hours for a corpse to rise.
  • A corpse under active butchery shouldn't be able to rise as it's being actively damaged further.

Screenshots

No response

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.26200.7171 (25H2)
  • Game Version: cdda-experimental-2025-10-09-0624-903-g7dde6c460f-dirty [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [ Dark Days Ahead [dda], Disable NPC Needs [no_npc_food], Portal Storms Ignore NPCs [personal_portal_storms], PALU [PALU] ] The PALU mod disables portal storms, wheel damage, and changes the graphics of wild rice to burdock so I can find it.

Additional context

I've encountered a similar case where I'd brought back 4 ants, and it was probably the second to the last one that rose, as the butchering could be resumed after dealing with the cocoon. At that time I didn't notice that/if one corpse had been lost in the process.

I suspect something is wrong with the meat cocoon handling, both in kicking in way too early and in not checking corpse damage properly.

When "harvesting" the ants I noticed a cocoon being destroyed by an ant. The corpse producing it had been generated the day before (so <=24 hours, as that expedition was performed later in the day) by hunting failures on my part (having to kill more than I needed to get away, and thus without time to pulp the corpses (no suicide NPCs to try to do that)).

PatrikLundell avatar Dec 06 '25 16:12 PatrikLundell

It seems corpses are evaluated every 2 seconds or so, and once 7 hours have passed since they died there is a 1/47 to 1/41 chance for it to rise in each of these checks. I've made some experiments where I debug spawned 6 acid ants (the second smallest version), debug killed them, debug advanced time 7 hours, and then passed one tick at at time, as well as the same test with bulldogs, and the acid ants in a gathered in a pile under the PC. The longest it took for all 6 critters to rise was about 12 minutes (bulldogs) and the shortest was less than 3½. After that I've also done the same with cows, where the last one rose at a little less than 14½ minutes later. The code prevents field dressed corpses (whether successful or not) from rising, so you can be safe with long butchery or butchery of 7+ hour corpses if field dressing of them has been finalized before that timeout. Acid ant's don't have organs, unlike "regular" ants, so they can't be field dressed... Also note that field dressing a cow takes 4 hours (truncated), and that's not the largest critter (not even considering the dino mod).

I also debug spawned a cow, debug killed it, debug waited 6 hours, and started a full butchery of it. The bugger rose when the task was 97% complete. Single attempts at full butchery directly and after 1 hour completed the task without the corpse rising, though, but single attempts make for poor statistics. Regardless, something isn't right when corpses being actively butchered rise in the middle (or at the end) of it.

Corpses contain info about their butchery progress, but you can't just use the fact that it has progress, as that would open up the exploit of starting butchery and then immediately abort it, so you probably need to add the time the progress indication was updated to it. If that time is say older than 30 minutes this could be ignored for corpse rising purposes, but if it's younger it should block rising the same way field dressing does (you should give the player some leeway to have time to eat, fend off enemies appearing, etc. so the grace period shouldn't be too short. Even managing companion crafting can take time if you have to move numerous products off of the workbench to make room for the next job).

PatrikLundell avatar Dec 07 '25 12:12 PatrikLundell

It happened to me in a similar way with wasps. A queen and some guards corpses, while dragging them from the car to the butcher rack, they spawned meat cocoons. Same when started butchering / dissecting the remaining ones.

alef avatar Dec 11 '25 20:12 alef

Killed necrowolf spider, begun quick butcher it(7 hours) it raises as meat cocon. I like this suggestion about time. Will timer after 30min start anew or use time after death?

Tiareth avatar Dec 12 '25 09:12 Tiareth

My suggestion was that active butchering should disable rising, and butchering would be considered active for 30 minutes after the last update of it, and it would not change the normal timer after death, so once the butchering timer runs out, the normal raising logic would apply. You could keep a corpse from rising by resuming butchering every 29 minutes, but that's a rather tedious exploit.

You can disable raising completely through field dressing (successful as well as unsuccessful) and quartering (which usually requires field dressing, but some creatures can't be field dressed) in the current game.

PatrikLundell avatar Dec 12 '25 10:12 PatrikLundell

I'd like to suggest checking if the corpse is frozen too. Currently this does nothing to prevent it rising.

Nandorianen avatar Dec 14 '25 09:12 Nandorianen

I don't think that's a good idea. It would change the game play in early spring and in winter, making things significantly easier. Blob magic doesn't respect laws of physics.

PatrikLundell avatar Dec 14 '25 09:12 PatrikLundell