NPC overhaul

Finally got around to merging the old NPCs & Vehicles mod I wrote for cataclysm. I’ve also managed to fix the fun leap of death bugs the npc seemed to enjoy taking.

Currently NPCs that are following you will also board a vehicle when you do, although you might need to skip a few turns as they clamber over vehicle parts. Once they hit a seat they are probably in. (You’ll quickly notice if they aren’t)

While in a vehicle NPCs will pretty much take any action that doesn’t involve moving, this includes healing the player if you are adjacent or melee attacks against adjacent targets.

If they see an item they want they will let you know but won’t try to pick it up until you leave the vehicle.

Here we see my, fairly bloodied, car with two NPCs helping me out. As you can see one is only armed with melee weapons so rarely gets to attack. It took a while to get a screen shot where he did and even then the car door did considerably more damage.

Things to do when I get the chance:

  • Make them actively switch to ranged weapons even while ‘in danger’.
  • Allow them to depart from or rejoin stopped (slow?) vehicles.
  • Avoid throwing grenades in direction of travel.
  • Better path-finding for climbing into vehicle.
  • Complain at the player when there aren’t enough free seats.

Whatever I’m currently working on (which could be broken at any given time) is on github under feature/npc
A “stable” build will found merged into develop but will probably be missing the last few additions.

Currently built against 27 Feb update. (3452ad54aa)
Features added to “stable”:

  • NPCs will follow you into vehicles and provide fire support.
  • Combat option to allow only silent / silenced weapons.
  • NPCs (poorly) attempt to avoid being squished by your vehicle
  • Leave NPCs at a base camp.

Hmm, Darkling! More shut to merge!

You mean to say they don’t shoot “through” you every chance they get? :o

If the code hits the bit that would normally manoeuvre to avoid hitting the player then instead they just hold fire. I might change that to check reloading first.

I’m not going to guaranty they won’t ever shoot you though :slight_smile:
Just try to avoid annoying them while they help you out.

There might also be some balance issues here as a truck full of NPCs makes things pretty easy.

Could always make it so only so many NPCS can follow you at one time. Also, what about NPCs having tasks when left at your base? Guard/Patrol? Fix the other car. Hunt for food. Clean this place up! (organize stuff) Scavenge for supplies. But let’s not forget. If you got a truck load of NPCs all firing, you have to provide ammo for them.

“NPCs back at base” would require a from-scratch system for things occurring without your presence. Currently the world revolves around the player, and almost nothing happens without his presence. Having said that, it’s doable, just difficult.

The method I was considering was using the last update for that map section to work out how much activity should have gone on and simulating it quickly, although not accurately.

However I’ve been sidetracked recently with a different game so haven’t had a chance to do anything interesting here yet.

The thing that worries me about that kind of thing is whether the amount of work it does is bounded. What if you’re gone for several days, you get back in range and when the tiles with the NPCs on them load the game halts for a minute figuring out what happened.

OTOH if it’s simply a matter of “build this stuff while I’m gone” it’d be totally trivial, so there are possibilities there.

Hell yeah! Once you can tell NPCs to hole up in a safe place, I’ll be satisfied with this game.

Theoretical conversation with NPC:
me: Yo, NPC Dude! While I’m off scavenging stuff you prepare this stack points to wall lined with logs and heavy ssticks into 2x4s and spears! I’m gonna go get you a better weapon and some foodstuffs to last us a few days, maybe a car to tinker with to make moving easier once we get bored here.

NPC: Sure thing!

me runs off to do stuff

NPC works for an hour or so, then pulls out his lighter and smokes my stash of cannabis before eating all my junk food and drinkin all my sodas

me returns with nothing but a shotgun as pickins were slim, notices none of the work done and wrappers all over the place next to a sprawled out and sleeping NPC
me kicks the NPC to wake him up, yells at him, marches him into the forest before forcing him to dig his own grave at shotgunpoint

actually, I kinda want this to get implemented. Something like a work-ethic parameter or something modified by how loyal the NPC is to you maybe…

Honestly, I just want one or two people to populate my fort and help keep it secured. That and them being able to teach me their skills would be useful enough. And once that’s in, their demands for food/morale boosting items could keep me busy.

Having npc’s defend the fort in exchange for food/water/morale would actually be a really, really good game mechanic (and could easily be expanded on to make it quite deep/challenging). Having them possibly craft things for you if their morale was high enough would be a nice touch too.

It’d just add another big level of gameplay to not just be looking after yourself

A few thoughts on NPCs and NPC crafting.

Okay, while it’d be nice to tell an NPC “Make this shit for me while I’m gone”, that’d be a lot of work to implement, and I’ve really found most crafting that you wouldn’t want to do yourself goes by pretty quickly, anyway…However, here’s an idea:

Using the quest system.

When an NPC joins your group, whether or not it’s a part of your active party, there’s a chance they’ll give you quests to retrieve X item. After you do that, they give you another quest to return in a few days and pick up the reward they made you. This would give roughly the same feel as assigning them tasks in terms of the shit it’d make you go do after you’re done interacting with them (going out on a supply run so you can have bulk crafted goods waiting for you, having a wider “shopping list” of useful shit to grab, saving you time in game), but it’d use an existing system. That you’d be at the mercy of the system would be made up for by having to get a few items less/slightly better loot than doing it the manual way.


“Man, the amount of dead batteries lying around is getting a bit ridiculous… Get me some scrap metal, a foot crank, and some copper wire, and I’ll use what I have to whip up a generator and recharge some for you.” (Bigass stack of batteries, maybe a UPS. Alternately, they make a generator item for you.)

“We need medical supplies. Bring me a couple of curtains, a bottle of vodka, and a bottle of superglue. It won’t be pretty, but it’ll work.” (Provides first aid kits and bandages.)

“I know how to make liquor. Bring me a metal tank for a still and some fruit, and I’ll make all the hooch you want.”

“I have a broken bionics installer. Bring me a bottle of triple sec so I can get drunk, and a UPS and some copper wire so I can fix it one night, and I’ll give it to you when I’m done.” (Provides a jury rigged bionics installer with a higher chance to fail.)

“Hey, I found a couple of wheels when I was scouting earlier… Get me a metal frame and a foot crank and I’ll make us a bicycle. You can use it when I’m not!” (Protip: They don’t use it.)

“We need water. Clean water. I’m sick of getting the shits like this, it just ain’t right. Bring me a pot and some water, I’ll get the wood to boil it.”

“It’s getting bad out there. We need guns. Can you help us out?” (Morale up, offers a skill to train.)

“Help me help you. I found a cache of primer. Bring me a hundred casings and I’ll give you a stack of bullets.” (Probably need to tweak that one for balance. Also, stack of random bullets.)

“I found a crate of military supplies out in the woods, but it’s got a massive lock on it, and zombies chased me away before I could get into it. Haul it over here and I’ll crack it open; we’ll split what’s inside.”

And so on. There’s a ton of ideas like that you could use. Do enough of 'em and you’ve got a base that feels alive with a minimal amount of work. It also allows specialist survivors to build shit you simply can’t, later on.

Furthermore, you could tie this to a food/water/morale system-- They’re more likely to offer to do useful shit for you if their needs are being met. This would also help balance out how nice having a truck full of NPCs is-- It’s great, yeah, but kind of unsustainable, especially in regards to supplies. (NPCs in your active party might use more food/water?)

Updated feature/npc to the changes as of 26th Feb (c618b1a353) mostly so I can get back onto doing something useful. All the follow changes are only on this branch and so should be considered works in progress.

NPCs will now try to avoid being run over by player, this is pretty much a massive hack but the way I initially intended to do it was proving overly complex. Also it doesn’t always* work, but I’ll go back to that another time when my brain starts working again.

You can now construct the bulletin board object, which didn’t appear to do much before so I thought I’d use it. This board can now be used to create a base camp location. Currently all base camps are called ‘Home’ but that is only because I haven’t added the option to enter a name yet.

Once you have a home base any npc following you can be assigned to it, this placed them on a new mission where they currently just idle unless there are hostiles around (or things to pick up), currently those idling look and act like any neutral npc although as they are on a mission some of the options get a little confused.

*[sub]By ‘doesn’t always’ I mean almost never because they run away from you and you go faster.[/sub]

Changes sound pretty promising!

If you’re looking for something short term to work on, there’s this weird bug to work on. A bunch of people have been talking about it lately.

Changes sound great! However, I do wonder if the calling it a ‘bulletin board’ might be a little bit unintuitive and confusing. Could it just be called ‘set up home base’ or ‘establish base’ or something??

Happy to change it to whatever people think makes sense. Currently the option on the bulletin board is create basecamp I think, but actually having to construct a board first is a bit strange. Mostly I was just being lazy and reusing an existing unused item.

That’s a strange sounding one. I’ll see if I can reproduce it this evening and try and track it down.

It’s been around for ages, but now that we can have wider viewports it’s much more noticeable.

Shades, I want to have your dirty manchildren. Thank you so much. :slight_smile:

Can NPC’s use turrets with this?