Skip to content

Roadmap to managing friendly fire better #73570

Open
@I-am-Erk

Description

Is your feature request related to a problem? Please describe.

Currently, the friendly fire assessment model for NPCs is mostly nonexistent. If you hit an allied NPC, for any reason, they'll either attack you or run away from you. As we get more robust NPC followers with nice long storylines and hundreds of lines of dialogue and reasons to trust you, this gets increasingly silly. We need a proper way to assess whether or not a friendly fire attack was:

  1. harmless, eg firing a bb gun into melee where your friend is dressed in head-to-toe plate armour
  2. justifiably risky, eg. firing into a melee because your friend is about to die if you don't
  3. bad but forgiveable, eg. hitting your old buddy Liam with a polearm in melee one time
  4. bad and unforgiveable, eg. stabbing your old buddy Liam repeatedly for no reason because you're an edgelord who treats all NPCs as walking meat, seriously why, food is not scarce.

Solution you would like.

NPCs should use a few different stats to decide if they care about being hit in friendly fire. Specifically:

  • NPC's trust in you should be the single most important factor
  • NPC's fear of you should also matter, if they're terrified of you they might be more afraid of what would happen if they turn on you.
  • NPC's altruism should matter slightly. An extremely altruistic NPC might assume their injury is for the greater good.
  • NPC's bravery should matter a fair bit, specifically in deciding how much their fear of you matters.
  • The amount of damage inflicted on the NPC should be quite important in deciding their reaction
  • The number of previous times you've hit the NPC with friendly fire should also be tracked and become quite important. Most NPCs would probably forgive a first time, but not a second, and definitely not a third. By the fourth or fifth, even Liam is probably going to tell you to GTFO.
  • The amount of danger the NPC is currently in should be important. if you're pulling out the big guns to try to save your NPC from getting ganked, they're probably going to be a lot more forgiving than they would be if you just decided to do target practice on the tree right behind them.

This leads me to a general, rough plan of attack: I made a flowchart. I hope it's less, not more, confusing than my usual writeup...

Untitled Diagram

As you can see, the first branch point is based on the NPC's assessment of current danger. An NPC that figures they're in a truly desperate situation is going to be much more tolerant of you making an attack that doesn't hurt them. However, all these checks are going to rely significantly on how many times this has happened before,

When we log "benign" friendly fire, I'd like the NPC to use a 3 strikes system. The first time it logs a benign hit, it has no other effects. It's not used in calculations to see if the NPC decides you suck, it doesn't impact trust. This is most likely to be a low-risk shot that happened to hit them and didn't cause damage. The second time, they still don't care. The third time, they log it exactly as if it were a "dangerous" friendly fire incident, and from this point on, they no longer use the 'benign' friendly fire pathway. They now consider you reckless, because you've probably been using them as bait. That's rude.

  • I would suggest that we log the time stamp on this as well. If you go more than a week without any more benign friendly fire incidents, we can drop the tally by one. If the tally is less than 3, they revert to allowing you to ping their armour a little again. This allows you to occasionally shoot towards your well-armoured allies, if you must, but it's not a tactic you should be doing regularly.
  • Note that even if you're doing a ton of benign shots, if you're using a weapon that could never damage the NPC, they'll just keep logging them as friendly fire incidents but the pathway doesn't lead to them going hostile over this. This would produce an NPC who will tolerate the behaviour but will get mad at you the moment you actually do use something that can hurt them. I think this is reasonable, if a bit rigid

When we log "dangerous" friendly fire, the total count of the number of times you've hit them will constantly ramp up. If you've hurt yusuke significantly by shooting into melee before, he's going to remember it even if it happens a year later. People don't like being shot. Also note that a single dangerous friendly fire event will have a significant negative impact on trust that regains over a few days; this should help to keep your NPC from letting you beat on them no matter how kind and forgiving they are.


To come: I'll post some concept calculations for the rolls depicted in yellow in the chart.

Describe alternatives you have considered.

The system doesn't have to be this complicated, but I don't think this is really all that much to code, so I won't propose a bunch of simpler versions of the same.

Additional context

It might be worth considering a special flag for NPCs that will never leave you, to use for Liam in specific, or at least that just causes them to run away temporarily... or we could just hard code liam to be very trusting and altruistic.

Metadata

Assignees

No one assigned

    Labels

    (P5 - Long-term)Long-term WIP, may stay on the list for a while.<Suggestion / Discussion>Talk it out before implementingMechanics: Character / PlayerCharacter / Player mechanicsNPC / FactionsNPCs, AI, Speech, Factions, OwnershipQuality of LifeQoL: degree to which players are comfortable, and able to enjoy CDDA

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions