Micromanaging npc inventory

And this system where the player tells the NPC what lies ahead is going not only to account for all enemy groups in the game, but to intelligently adapt to any mods items, enemies and locations or changes in the settings? Pull the other one.

Let’s take best weapons, and without even touching mods: under what measure is something decided to be best?
A crossbow, a sniper rifle, a rivtech assault rifle and a large machinegun all have their pros despite using the same skill, and they’re good in wildly different circumstances, and what these circumstances are is not clear cut from a code perspective.
You have a crowd of zombies ahead? Then the BMG should be the best gun, right? Except there’s a mall nearby, and that’ll attract an even bigger crowd. Or the player is melee, and that’d result in friendly fire, or they plan to use a grenade and would rather the NPC not waste ammo, or set the place on fire, or sneak past, or the player intends to run them over with a vehicle and would rather the NPC deal with the stragglers, or the player wants to lure them before running away on a wheelchair and sneak into the building from the other side, or any number of things where using the BMG would be a waste of bullets at best and a deadly mistake at worst.

One of the good things of the game is the amount of options in how to approach obstacles, this, on the other hand, makes it a nightmare to code an AI that will contemplate all those possible approaches and intelligently decide what to use.

The problem, again, is that since the AI cannot contemplate all this, the AI is invariably going to make really stupid choices. Micromanagement allows the player some control over the behavior instead of being frustrated by their seemingly braindead decisions and just never using NPCs at all.

1 Like

You seem to be missing an important detail here.

If you’re right and the only way that NPCs will work is by having the player micromanage them, we’re going to pull NPC companions.

If you want NPC companions to continue to be supported, I suggest you focus how they can figure things out for themselves instead of repeating that it’s impossible.

I think we need to decide whether NPCs are going to remain spineless robotic followers that just do as they’re told regardless of what happens, or whether we’re going to try to push in the direction of actually realistic behavior from them because we can’t do both. Frankly, I wouldn’t expect anyone in an apocalypse to let someone they just met pick all their weapons and armor for them, they’re probably just going to use whatever they want and say “Fuck off, leave my socks alone!” if they try.

Personally, I’m of the mind that NPCs should be self contained as much as possible. Let them generate personal resources like I outlined earlier, and they can be actual followers instead of mannequins that we dress up and let hit things here and there. Even if we have to put together a worst to best list for different armor pieces and weapons.

I think the argument about changing gear to match situations is stupid. You don’t need different armor whether you’re fighting triffids or zombies. You MIGHT be willing to let your NPC carry a flamethrower (I wouldn’t) to help out with, but that’s on you if you do. The only reasonable time I see an NPC letting you swap their gear out is if you have something miles better (say a broadsword to a steak knife) or if they run out of ammo for their gun and you have a crossbow and bolts for them. If you want real control over them establish a base and make it so you can choose loadouts for your NPCs like sniper, brawler, shotgunner, etc.

2 Likes

Sorry to jump in like this. But i think the thread already got derailed and we are speaking of NPC commands in general here.

I think some amount of micromanaging would be great to have. Some coordination beyond “attack condition” within a team is not only useful, but would enhance the feeling of being part of an actual group in a roleplaying sense.

I played around with the npc code as the thread was going on and could make a npc heal me or move to my position via a chat option. So i think slapping on in some commands like “drop your guns before you kill us all”,“run for your lives”,“kill this guy”,“pretty please wear this item” would be plausible.

I do think using these options should come at a cost. I would imagine something like decreasing the loyality for making the npc do stuff or taking stuff from them. Also i think npcs should be able to flat out refuse commands given. Noise would be an option, too.

Would it be ok to detach this discussion and see what the actual requirements+limitations are and how far the others got in their pull requests?

There is some code that is basically not used right now, that hints at the npcs having short term actions and a secondary layer with long term actions thats basically makes the npcs do missions.

edit:
To clarify my last sentence: I think this layer could be used for having npc personality or meta knowledge about things like “lets go looting” or “let raid a triffid grove”.

1 Like

I’ve actually made an AEP suit for an NPC, because I intended to go on a toxic waste dump raid and I didn’t want the NPC to be heavily irradiated. Aside from the radiation protection, the AEP suit was worse armor than what the NPC had been wearing.

So I definitely think there are situations when different armor is appropriate - going to radiation zones or fighting fungals or triffids (“I intend to use a lot of fire here, you probably want to wear this survivor firesuit instead of your otherwise invulnerable plate armor”).

I’m not against getting rid of the micromanagement. But I want the NPCs to be more functional without micromanagement before we turn off micromanagement.

I’d contribute more code to address this issue, but NPC AI code is complex. Right now, I’m hoping to add a function that has them alert the PC before they go to sleep, because that would sure be useful.

Gas masks and prioritizing fire protection over armor, prioritizing a ranged weapon even if they’re bad at it as to keep them out of the line of fire of the flamethrower the player is wielding, and that’s the bare minimum. If they cannot intelligently decide that, and they cannot be managed to do that, they might as well be called walking morale penalties that drop loot.

Water gear for such exploration, light gear to move fast, sneaky and run away, heavy gear to tank blows when hauling cargo since encumbrance is going to kill their dodge anyways, stuff from mods that’s not contemplated by the AI code, making them wear some uniform or outfit for roleplay reasons or just plain amusement.
Silent weapons, lighter weapons so they have more free weight to haul stuff, taking their weapon in order to craft a better one out of it, guns you have more ammo of, guns you can craft ammo for, taking away the weapon they can’t hit the broad side of a barn with so they don’t riddle you with bullets due friendly fire, trying to train them on a different weapon group because guns and ammo of their best skill is scarce on the ground, weapons with worse damage but better armor penetration, weapons with worse stats but that don’t conduct electricity, I could go on.

1 Like

I respectfully disagree. This is just one possibility that can occur (fairly rarely as noted above) when the current NPC interaction/recruitment system resolves on a ‘simple’ speech check which, if passed, gives total control of the NPC to the player. Where is the line drawn? Why is It OK for me to be able to immediately order him to stand his ground and die against the on-coming zombie horde while i run out the back door but it’s a bug/exploit if i take a kevlar vest from him? Giving the player the immediate ability to tell an NPC to commit suicide is a much bigger bug/exploit effect of this system than sometimes getting items from the NPC. Labeling the one possibility a bug/exploit while ignoring the other silly things the current system allows just seems arbitrary to me. I know much of this comes down to what is possible in the game engine/code as well as the classic realism vs game-play conundrum but that’s my opinion.

I agree that the situation this allows is not ‘realistic’. i just think any real fix for the issue goes much deeper into the NPC interaction system than is immediately obvious and would require much greater changes than are warranted by the few times this possibility actually makes any difference.

NPC’s do add fun/flavor/choices to the game and i would love for them to get more attention/development. I just think this is a fringe issue that would be better left to player preference barring some major infrastructure changes to the NPC systems.

3 Likes

Yeah, I thought of that not long after I wrote my comment. Radiation and fire are probably the two main things that you might expect to need to reequip for, but I think it’s reasonably rare that you actually end up doing something like that. It’s still probably worth giving an option though. Perhaps a list of top-tier armor types that NPCs are always willing to wear regardless of what they currently have on? Have turnout gear, all the survivor gear, ANBC suits, etc.

It shouldn’t be too difficult to have NPCs automatically equip gas masks when there’s gas nearby. I think most NPCs would want to have a ranged weapon and a melee weapon, then intelligently decide which they would rather use, or a have a command that makes NPCs switch between the two if possible.

I could see the water exploration or light/heavy gear, but again I think the best bet would be to just have a list of endgame armors that they’re always willing to swap to, probably even just anything with “survivor” in the name, or even just a JSON tag, that way mods can add whatever they want and it will still work.
Guns would be a bit more complicated. It might be necessary to have them treat all guns as equal, and possibly the same with high-end melee weapons. That said, I don’t think stealth with NPCs is ever going to be a particularly good choice.

I’m certainly not saying “Take away NPC inventory management so that NPCs are useless,” I’m saying “make NPCs a bit smarter so that they’re not useless, then take away direct NPC inventory management because it’s unrealistic and irritating.”

In this thread we’re discussing micromanaging NPC inventory and how it can be improved. The fact that you can outright murder your followers is bad too and should be addressed, just perhaps not in this thread.

1 Like

There’s a lot of game before the end-game. If I can only freely swap between end-game equipment and otherwise have to give them strict upgrades, that’s not an improvement. There are a lot of valid reasons to downgrade equipment before then. Things like “yes, this bullet crossbow firing pebbles is strictly worse than your crossbow firing steel bolts, but those 20 steel bolts were a lucky find, I can’t make any more, and there’s only 2 left. And I want to swap out the combat knife and rail laser sight now, instead of letting you firing 2 bolts and then switch to a completely worse weapon at an inopportune time.”

Some of this stuff may sound contrived, but almost of these issues are things I’ve come up against in recent playthroughs.

But again, I’m all for taking away direct inventory management, but only after making NPCs smarter, so I think we’re in agreement there.

1 Like

Weapons might have to remain freely swappable, possibly with a cutoff for what counts as a weapon so you can’t take their katana and swap it with a butter knife. The straight upgrade thing is just to prevent taking all their stuff, so you have to give them something of equal or better protection to swap. Might also have to allow repairing the worn items of NPCs.

And what if you want to take that katana in order to diamond coat it? Or turn it into a fire katana? Why after braving the entire labs or whatever, should the player need to produce some other superior melee weapon to trade them for a moment in order to improve it?

It is reasonable and realistic for a wasteland character to convince another to do these things, but once again, they are too many. It’s better to abstract out and handle it with inventory management than try to hard-code every one out of hundreds of possible things you could convince another human being to do.

if you’re all that hard set on negating the one unrealistic option of stripping an NPC after meeting them, which any player that doesn’t want to do that in their single player game can decide not to, you might be able to do it with a credit system.

Actions beget trust, trust you can expend on taking items away and giving commands they don’t want to follow, and give back by giving items, feeding them, protecting them, providing shelter, doing quests, etc.

A starting relationship might only be enough to convince them to use another weapon or armor without taking what they have away, might convince them to hold their ground, but once the going gets too hot they’ll flee.

One much further in could afford to take away their shiny weapon and replace it, or order much more dangerous commands. Presumably, if you’ve invested that much time on the NPC, then you want to keep them around, and the orders and items you’re giving them or taking away are truly for their own good.

2 Likes

I’m kind of dubious of the idea of weapon upgrades. A lot of weapons have different trade-offs.

What’s the best weapon: a Remington 700 rifle with a silencer; a crossbow with a combat knife bayonet, rail mount laser spot, and metal crossbow bolts; a bullet crossbow with an underbarrel laser spot loaded with marbles; a pneumatic assault rifle loaded with pebbles; a coilgun loaded with nails and a fully charged UPS; or a pneumatic bolt driver loaded with metal bolts? How does that assessment change if you’re allowed to carry two of them?

I’m pretty happy with giving my NPC a pimped out crossbow and a bullet crossbow and letting them make the decision whether to switch to the bullet crossbow after firing the primary crossbow or stick with the primary and go to melee.

But as a PC, I’ve used all of those weapons (on the same character, even!) at different times, depending on what my goals where at the moment. I’d be annoyed if the game decided that having given the NPC the Remington because I know we’re going after a zombie monster in an isolated office tower and don’t care about noise, I can’t swap it for a pair of crossbows when we go back to looting doctor’s offices in the middle of town for anesthesia kits.

Some kind of trust system would be great, and the game already tracks the NPC’s opinion of the player. But there are still times when trust is low and the PC might want to make a trade that by some kind of hardcoded standard looks suboptimal but makes sense for what the player intends to do.

A ‘(don’t) use this specific armor/weapon’ (or at least until they run out of ammo) would solve many of these. You wouldn’t be able to take the rifle away, but you’d be able to make it use the crossbows.
That, and giving them the crossbows would earn some credit, plus a little traveling and fighting monsters together, might be enough to use that credit to trade back for the rifle.

1 Like

This has already been decided, it’s the second. The current ability to freely give orders and adjust NPC inventory is a band-aid over the missing ability for NPCs to make decisions for themselves.

It should be obvious that tha’s also an exploit :confused:

I don’t know what the fix for it is offhand, but it does need a fix.

If it’s such a fringe issue, it doesn’t matter what we do, so we can close the exploit.

Again, part of the problem is that there is no distinction between just having met each other, and having braved countless fights together. We can certainly have something nicer than having to trade out equivalent weapons, but having thigs the way they are now prevents any of this from becoming an issue, which means no progress is made.

Yes, we definitely need to track how much the NPC trusts the player and only allow things based on the trust level. That is what I’ve been saying. The issue is the immediate and total trust, not the details of the interface used.

I’m all for fixing it. I just prefer it to be done through larger improvements to the game systems which would render it obsolete/impossible anyway. It sounds like that’s already where things are headed long term so i am more than happy. If there is a simple low-impact way to remove the option until those changes arrive then i’m all for it. Until i know just how this will be done i can’t really offer an opinion. I just don’t want some complicated Frankenstein system welded onto an already rickety frame just due to this small issue.

1 Like

The idea of a trust/points system sounds reasonable.

I guess we have two options. A point cost per request, or a point cap on request types.

So either we do a simple draft of “Go here/follow me/guard = -10 points” then “give food/weapon = +10 points” (numbers not accurate)

Or we go “go here/follow me/guard needs trust => 10 points” and “give food/weapon = trust + 10 points for 1 day”.

So we could add a natural increase of points over time, or a natural decrease, depending on player actions playing (getting loot, killing zeds, protecting over time). Then additional gain or loss depending on specific NPC interactions (missions, giving loot/food, healing wounds, killing zeds grappling NPC).

Then an NPC could get to complete trust, but would have had to be protected, trained, working as a bodyguard/soldier/camp manager or something. Cause a lot of trouble for them, and they’d run away. :stuck_out_tongue:

1 Like

This thread is comical. I don’t even see dumb NPCs. I only see them sitting still while being eaten alive and I wait to grab their gear.

The ones randomly spawning and running around run head first at me or mobs and die. I almost feel they should be removed. But that would make the game feel like flat soda pop.

1 Like

–I feel like trust points are probably one of the most needed things to add for what we are talking about.
–Kevin, I have no clue what you’re talking about when you say this isn’t a ‘tactics’ game. Without ‘tactics,’ I’m pretty sure it would be impossible to survive for even a few days. People have already mentioned tactics that they either already do or want to do. A tactics I often do is have those pesky eyebots get attacked by a horde so that they don’t send down those stupid riot/police bots. You always need to account for the range of turrets in various cases, and sometimes you can stand just outside it’s range and let it waste ammo. Which, for the record, I wouldn’t consider an exploit, but a tactic. CDDA isn’t a full on strategy game, but it is indeed a tactics game.
–The food thing should only work when you have NPC needs enabled. Otherwise that’d just be stupid.
–I feel like there should be a cap as to how much trust you can gain. This decreases the chance that a player will somehow exploit the system, one way or another. For example, you can’t gain stupidly large amounts of trust by giving them a weapon that they think is good but you’d never use.
–Healing NPCs would probably be a really good way to gain trust. It makes sense to me. “Hey, I almost just died and you saved me! Thanks for that. My arm’s still broken and it will probably never get fixed fully because I’m an idiot, but that’s fine!” There is the potential for exploiting this system, but that’d only realistically possible when you have lots of healing items, since it would be very taxing on resources. I feel like it balances out.
–It makes sense that certain commands would decrease trust. “So, you’re just gonna leave me here? Like, doing nothing? At all?”
–You should also be able to tell NPCs to read books on the side while you do other stuff. They should also have the chance of having a trait that makes them enjoy reading books. With said trait, they gain trust, without it, they lose trust. Because they feel like they have more important things to do than read a book.
–I feel like there should be some sort of conversation/trust system when you have multiple NPC followers. Someone with high trust might say something like: “Hey, this guy is really nice. He gives you candy all day which makes me love him! You should to, since he’ll also give you candy!” Then someone with low trust would say: “Be careful around this guy. You never know when he might leave you.”
–Along with the candy mention, I feel like some items shouldn’t give them any trust. “Um, thanks for that rag. I guess. Not sure what I’ll do with this. Oh, a curtain. Well that’s very, um, nice of you.” Giving them constantly the same thing should also start giving less and less trust. “Well, thanks for this. There’s not much point now, since you’ve just given me a lot of this. But I guess it is free, so I might as well take it.”

1 Like

I’m not too hot on your particular example, since there’s plenty legitimate reasons for that scenario where the NPC should value the item, but in general I think the trust currency should only value some items, and the rest would either have little value or none at all.

An NPC shouldn’t give two shits that you’re giving them 1000 two-by-fours, for example.

Weapons are one of the things they would value, same for ammo, armor, food, drinkables and medicine.

Balancing flooding their inventory with those is trickier. Even if they have something they think it’s better, there are legitimate reasons to trade down as I’ve been saying through the thread.
Perhaps duplicates don’t count unless it’s things they legitimately would want more of like ammo or consumables.
Perhaps giving them something ‘worse’ doesn’t give trust, but taking away their ‘best’ only costs the difference between this best and the next best thing in their inventory, rather than the full cost, Making trading down cheaper than leaving them buck naked.

I am quite against this particular command causing trust loss. Because often you’re leaving the NPC safe and sound in your comfy home or your heavily armored deathmobile while you go out and risk life and limb, or you go ahead to scout a little, or to deal with a tricky foe like dancing at the edge of a turret’s range, once again putting your character at risk while the NPC is safe.

Now, leaving them for days with no supplies? Ok, maybe. But there might be legitimate reasons for that, reasons which, roleplay-wise, the character would have explained to the NPC before leaving.

–Well, those were just the only examples I could come up with on the top of my head. I acknowledge they aren’t the best, but I couldn’t think of any better ones at the time.
–Yes, they should care that you are giving them a load of crap they have no use for. They possibly might start thinking that you’re just treating them as a pack mule, since it’s just a bunch of random trash to them that they have no reason to carry around.
–Things like ammo would be a good exception to giving them lots of the same thing. Other things like that would also make sense.