CleverRaven / Cataclysm-DDA

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

Cats Don't Avoid Fire #73674

Open KyunKitsune opened 1 month ago

KyunKitsune commented 1 month ago

Describe the bug

Tamed cats will not attempt to avoid fire and will randomly path into fireplaces while left idle around PC.

Attach save file

N/A

Steps to reproduce

  1. Tame a cat
  2. Do some crafting near a fireplace
  3. Wait for cat to immolate self for greater good.

Expected behavior

I expected cats to be opposed to cooking themselves.

Screenshots

No response

Versions and configuration

OS: Windows 11. Game Version: 73b6cf7 (tiles). Language: English. Mods Loaded: Disable NPC Needs, Portal Storms Ignore NPCs, Slowdown Fungal, Bionic Professions, sees_player_retro, SpeedyDex, StatsThroughSkills, Alternative Map Key, Tamable Wildlife, Mining Mod, Original Drug Names, Translate Complex Dialogue, Stats Through Kills.

Additional context

No response

mqrause commented 1 month ago

I've seen a regular untamed chicken walk into a fire a while ago, so I assume this is a more general issue.

KyunKitsune commented 1 month ago

I can only speak to my own experience, I wouldn't be surprised if it was a larger issue but I also cannot directly confirm that it is.

PGR-14 commented 1 month ago

Can confirm, almost any creature will fearlessly let itself become a beef wellington at the slightest opportunity.

Karol1223 commented 1 month ago

Yeah either PATH_AVOID_DANGER_1 used to include avoidance of fire and there's a regression, or we assumed it includes it for years. Because most animals don't have PATH_AVOID_FIRE. I've been adding it to things I touched as I went along but there's tons still missing it.

Amnestasia commented 1 month ago

my siamese cat was a bit silly and did the aforementioned deed of self immolation.

/confirm

KyunKitsune commented 1 month ago

This is now the Pet Immolation Support Service (don't check our acronym)

PGR-14 commented 1 month ago

This works on almost any tamed animal, unless it's a friendly feral (Spawned in through debug menu) AKA Has the PATH_AVOID_DANGER_1 flag

PGR-14 commented 1 month ago

A fix to this could be adding the PATH_AVOID_DANGER_1 flag to most creatures (They won't be able to open doors though)

KyunKitsune commented 1 month ago

That shouldn't be an issue for most creatures, and I imagine the ones where it would be an issue could get a fire specific flag, right?

Karol1223 commented 1 month ago

This works on almost any tamed animal, unless it's a friendly feral (Spawned in through debug menu) AKA Has the PATH_AVOID_DANGER_1 flag

This is entirely false. Animals ALL have this flag. Ferals avoid fire due to their path settings field. Check out the solution I mentioned above for how to actually solve it through a flag.

mischief commented 3 weeks ago

this seems to be caused by https://github.com/CleverRaven/Cataclysm-DDA/pull/72662. this also affects spike pits and barbed wire, for tame and non tamed creatures. when reverting that change locally, my dog no longer crosses barbed wire. cc @nornagon

mischief commented 3 weeks ago

pets can also fall off of ledges/into craters and fall into spike pits such as those around survivor camps or in the entry hallway of the Exodii base, and animals on farms that flee will run outside of the barbed wire fence surrounding it as well.

nornagon commented 3 weeks ago

Yeah, makes sense that #72662 would cause this. Whoops. Unfortunately the fix isn't straightforward; the pathfinding logic is duplicated in a few places and I think sorting it out such that creatures can path through traps when needed and don't do it unless they absolutely have to is going to take some doing. I'm not sure the solution will be backportable.