CleverRaven / CleverRaven/Cataclysm-DDA

NPC unable to swith from gun to sword while in melee

Open
#48,614 1 comment 0 reactions 0 assignees View on GitHub
<Bug> Melee NPC / Factions
Dominant language
C++
Stars
13.2k
Forks
4.6k
Avg merge
2d 1h
Merged PRs (30d)
205

Description

# Describe the bug

NPC wears scabbard with a sword, but while in close combat they prioritize shooting or hitting with a handgun over switching to the sword

# Steps To Reproduce

Have NPC wield a gun and wear some holster with a good melee weapon
Have them enter melee and run out of ammo
Observe how they smash with a handgun

# Expected behavior

NPC switch weapons according to situation

# Versions and configuration

- OS: Windows
- OS Version: 10.0 2004
- Game Version: 0.E-10383-gad91f6a [64-bit]
- Graphics Version: Tiles
- Game Language: English [en]
- Mods loaded: [
Dark Days Ahead [dda],
Disable NPC Needs [no_npc_food],
Aftershock [aftershock],
Blaze Industries [blazeindustries],
Magiclysm [magiclysm],
Graphical Overmap [Graphical_Overmap],
Graphical Overmap Magiclysm [Graphical_Overmap_Magiclysm],
Mythical Martial Arts [MMA],
C.R.I.T Expansion Mod [crt_expansion],
No Fungal Monsters [No_Fungi],
Stats Through Kills [stats_through_kills],
SpeedyDex [speedydex],
Bionic Professions [package_bionic_professions],
Aftershock - UndeadPeople Tileset [AftershockUDP],
Blaze Industries - UndeadPeople Tileset [BlazeIndustriesUDP],
C.R.I.T Expansion Mod - UndeadPeople Tileset [crt_expansionUDP],
Magiclysm - UndeadPeople Tileset [MagiclysmUDP],
Mythical Martial Arts - UndeadPeople Tileset [MMAUDP]
]

# Additional context

Possibly related to DPS calculations?
Recently when I tried "use this" on NPC and give them a sword they said their handgun was better (300+ DPS vs 20 DPS), maybe even without ammo it assumes a gun to be a superior weapon?
@KorGgenT I saw you merged at least some of your DPS calculations rewrite to master, could this change something?

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported NPC scenario: equip a gun and a good melee weapon, enter close combat, and run out of ammunition. Trace NPC weapon selection and the DPS calculations mentioned in the issue. Done means the NPC recognizes the unavailable gun and switches to the sword when melee is appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.