Cataclysm-dda: NPC faction ownership of stuff

Created on 6 Jan 2019  路  9Comments  路  Source: CleverRaven/Cataclysm-DDA

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

As I begin working on NPC behaviour around the refugee center, one thing I'm going to start running into as a problem is the lack of NPC reaction when the player messes with stuff in the center. I don't need these done tomorrow or anything, but over the next couple weeks as I continue expanding the center.

Describe the solution you'd like
I see three potentially separate types of ownership to be considered. I'll list them in order of how easy I think they would be to code.

  1. Terrain/furniture: I think this could be managed with a mapgen flag, like "faction_owner": "free_merchants". A map that had a faction owner would get a few features.
  2. if you smash furniture or terrain, NPCs from that faction react with a snippet like , which would contain phrases like "what are you doing? Stop that" etc.
  3. if you do it again within a span of time x (based on faction standing?) the NPC responds with a more angry snippet .
  4. if you do it a third time before the timer expires you lose faction standing and the NPC gets a bonus to Anger.
  5. if you attempt to disassemble furniture while a factional NPC can see you, you get an interruption along the lines of "John Doe, guard, isn't going to let you take that apart."
  6. a mapgen tile with faction ownership should have furniture and terrain (not items etc) reset to their base state every few days to represent the faction keeping it up, fixing broken windows, moving furniture back, etc.

  7. Vehicles: I'd like to be able to give the free merchants some turrets and things similar to what the player has, but I don't want to allow the player to steal them.

  8. I think a faction_owner tag here (added to the vehicle in its section of the mapgen file) could either prevent the player from examining the vehicle at all if a faction member is in range (maybe a snippet from nearby factional NPC? Or just an error message "jane Smith, guard, isn't going to let you poke around at that")
  9. a more granular alternative might let the player examine the vehicle but not remove parts or siphon fuel. I'm not sure this is necessary though.
  10. faction vehicles should also either automatically fully repair after a while (maybe slower than furniture and terrain) or (better) should slowly auto-heal to represent their attendants keeping them fixed.

  11. Items: I feel like this would be the toughest but maybe not. Faction items would be defined in mapgen as well like vehicles, under the item placement entries.

  12. if a player picks up a faction item while in sight of an NPC, it keeps its faction owner tag and the player gets a "stole from faction" effect somehow linked to the item taken. Nearby NPCs get a snippet, along the lines of "hey, that's our $item_name! Give it back!"
  13. if the player drops the item inside the faction owned map, within view of an NPC, the effect is removed along with snippet (eg "thanks, now leave our stuff alone please). I can handle the rest - if the player talks to faction NPCs after stealing, they'll get irritated and ask for it back.
  14. if a player takes an item while no NPCs are in view, it loses its faction owner flag.

Describe alternatives you've considered
Terrain and furniture ownership is the least necessary of these, but I like the idea of linking it to base repairs.

Item ownership could be made much simpler but also crappier, by making all items on an owned map tile become owned by the faction, and just making guards get mad at you for taking them, but then items dropped by the player would become faction property. This would be a good stopgap though.

Vehicle ownership isn't immediately needed, but if implemented then I'll use it right away to make manned turrets in the center, and maybe put a car in the garage.

<Enhancement / Feature> <Suggestion / Discussion> Items / Item Actions / Item Qualities NPC / Factions

Most helpful comment

If police robots get ownership for everything that doesn't have any other owner, they'll naturally go around arresting/shooting people for stealing stuff.

All 9 comments

Looks pretty reasonable.

Couple of thoughts:
The faction possession tag could also be used for the PC faction to implement PC owernship of stuff and get NPCs to stop stealing stuff.

Players and NPCs shouldn't be prevented from stealing stuff or siphoning fuel from vehicles or whatever. They should get a pop-up that stealing may turn people hostile and choose not to steal, but you should be able to steal from hostiles without them preventing it other than by shooting you. And of course, you can steal from nominal friendlies as long as they can't see you doing it.

Kevin will have to okay it, but I think it's a good solution.

See also #19439 for more on ownership and theft prevention in CDDA.

I agree with most of the outline, entities get labelled as faction owned (a tag on an item or vehicle, a zone for furniture works for this), and then it can trigger repercussions if the player interacts with owned entities while in sight of a faction NPC.

The tricky part IMO is managing feedback in a reasonable way. Making item ownership visible to the player is questionable due to leaking information, but it's also potentially frustrating to be told after the fact that things are faction-owned.

In common areas, in particular outside the structure, warnings that interrupt the action are appropriate. Either, "this may upset , do it anyway?" or ' says, "hands off man!", do it anyway?'.

I think turrets in particular are simpler than you think, turrets would just not be programmed to allow the player to approach, the turret itself would aim at the player if they approached within some distance (triggering a warning), and start firing if the player got within some closer distance. This would be rendered "safe" by e.g. interposing walls to break turret LOS to certain areas.

If police robots get ownership for everything that doesn't have any other owner, they'll naturally go around arresting/shooting people for stealing stuff.

I do like the idea of the "guard" interaction being a pop up dialogue with Y/N. This could apply to everything from dismantling/smashing furniture to stealing stuff, and so could use pretty much the same function call for everything. If the function call could recognize the type of crime so that the NPCs use the right dialogue snippets and maybe add the right crime-punishment effect, so much the better. It's probably simpler than what I've got listed as well, because it doesn't require warnings and timers... As a popup it can be one and done, there's no excuse for missing it.

I love the idea of turrets beeping warnings, but the NPC interaction still needs to exist. For example if I add a vehicle and attendant to the garage of the refugee center, the attendant should be able to stop you from messing with it.

Of course, with crime comes the ability for an NPC to subdue the player, or for the player to surrender and have the faction take compensation (steal items equivalent to bounty?) or I suppose, deal with crime however a given faction would with their individual politics.

tying up/cuffing NPCs and the player when they are at a knocked out state or have high enough pain that they don't have the strength and/or dex to resist is an idea.
A consciousness system would greatly benefit the game in some other situations, ie: if the player is attacked by a moose and is knocked unconscious, the moose will not likely continue attacking, but a predator will, a zombie will, but anything that does not want to eat you will not, perhaps fungus will simply ensure the player has been injected with spores and is subdued, then leave them for dead unless they are close to a base?

I don't think this issue is actually done, Dpwb's PR only addressed the item ownership issue. Furniture/terrain ownership still stands.

I don't think this issue is actually done, Dpwb's PR only addressed the item ownership issue. Furniture/terrain ownership still stands.

I agree. Furniture could be as valuable as items (so as walls).

Personally I'd also like to see furniture and terrain auto-repairing over time as part of it, but that does depend on how far we are from mlangsdorf getting NPCs to perform maintenance. I think that's much closer than we thought.

Was this page helpful?
0 / 5 - 0 ratings