The Month of the NPC - Roadplan in OP, creature-rewrite branch in repo

Says who? <<
The code is even worse than you think though, the hunger/thirst/fatigue clocks aren’t even implemented in the player class, they’re in the main game loop >
<
So NPCs have those stats, but they don’t decriment.
That is an example of something we’d want seperate for players vs NPCs, we might want NPCs to eat, drink, and sleep, but the system probably needs to be different from the one for players.

For now I’d say we wouldn’t want them to do it at all.

We should decide what the bare basic requirements are going to be the NPCs, actually.

I have down:
Have names
Have inventory (and a way to spawn them with something held and in their “pack”)
Have mutations and bionics
Are able to decide to attack/ignore/flee from other mobs depending on circumstance. (probably pretty simple)
Able to fire weapons/use ranged bionics to attack enemies.
Able to equip appropriate equipment.
Player can initiate communication with them
Able to hand out quest hooks and reward player for quest hooks

Right now I think this is the core of what we need from the in-game NPCs - I’d be interested in seeing what else you think we need from them. We know the current code is buggy for them, so I’d prefer to chop out as much of the cruft as possible. For this initial implementation I won’t worry about their weight limit or volume limit and will probably have basic rules for behaviour and equipment management. There won’t be any handing off of items or buying or selling or tracking of gratitude except as a reward for quest hooks, which will probably be pretty simplified.
But I might be missing something else we need - this is mostly to obtain “functional NPCs that meet Kickstarter requirements”.

Well, i think that is very basic. We should point higher.

What about having a “Goal” thing for them.

I mean, what they need. They are hungry? Goal, FOOD|FIND_MEAT, MAKE_FIRE (magical fires that don’t need something to be lighted, and they try to avoid making them near things), GENERATE_COOKED_MEAT. Thirsty? Goal, BOTTLE, WATER, MAKE_FIRE (magical fires that don’t need something to be lighted, and they try to avoid making them near things), GENERATE_CLEAN_BOTTLED_WATER. Cold? Goal, CLOTHES (those are added to them magically). Hot? REMOVE_CLOTHES. Tired? Goal, FIND_SAFE_ZONE (place with no bad creatures nearby and sleep) Wounded? Goal, FIRST_AID|BANDAGES.

If they trade and need desperately one of those items, then they will pay more.

I get where you’re coming from, but that falls squarely into “AI”, which really doesn’t matter for what we’re concerned with right now, which is just making them work at all. If the game interactions work, it’s a matter of implementation on the AI side of things to get goal-oriented behavior.
In other words, implementation at the level we’re considering shouldn’t limit how AI works, so it doesn’t matter at the moment.
There will be a ton of NPC-specific code to evaluate various things, like compare food types to each other.

As for the list, I’d add Navigate/move, which is actually kind of hard, I guess we can have them just wander at random or not move by default, the second has the benefit of being less likely to get them killed.
Probably want to explicitly exclude activating items for now, that’s the source of a lot of NPC crashes at the moment.
Might be implied already, but they should be able to deliver any backer-supplied conversation.
Do we want to worry about roles at the moment? I’m guessing no, and just ditch all the doctor/trader/ninja crap that’s in there right now, they’re all just trying to survive.
Take damage, be affected by fields, or is that implied as shared by all creatures?
Die. diediediedidiediedie
I’m guessing we’re going to say no to becoming a player follower at first, which is a bummer since it’s a regression, but making that work right is also potentially very difficult.

How about this, at what point are we going to wreck the existing NPCs? In other words how long can we limp along with both new and old NPCs so we don’t have to have NPC features regress?

StopSignal, I… don’t think you understand the point of “basic requirements”. >_>

I think they will not move in most situations, and only in response to “threats” - either to flee or attack. There will obviously need to be some sort of navigation at work there though.

Agreed. This reminds me that they WILL need to be able to reload, though.

I don’t think I’m going to worry about that for the first go. As long as they can converse at all I’m happy, which will be needed for quests.
Do we want to worry about roles at the moment? I’m guessing no, and just ditch all the doctor/trader/ninja crap that’s in there right now, they’re all just trying to survive. And there aren’t actually any conversation-related kickstarter rewards.

[quote=“Kevin Granade, post:24, topic:3188”]Take damage, be affected by fields, or is that implied as shared by all creatures?
Die. diediediedidiediedie[/quote]
This should be true of ComplexCreatures in general, since NPCs will have the same body plan and damage calculations players do. But it should go on the list, yes.

Yeah, that’s right out for now. Want to get a stable bug free foundation fully realized before even considering it.

How about this, at what point are we going to wreck the existing NPCs? In other words how long can we limp along with both new and old NPCs so we don't have to have NPC features regress?
NPCs aren't included in core right now, and the regression is something I think most players would accept in exchange for it being bugfree and mainlined. There will certainly be some whining, but I think we want to avoid having both systems in place at the same time, and I'd rather hae "on-by-default" NPCs for .9 than insure our NPCs are as "feature rich" as the ones we currently have.

On the other hand, I think becoming a follower would be a pretty natural expansion of the work I’ll be doing here that won’t take long to get implemented once this goes in - I strongly suspect it won’t be a problem, and I suspect that this is the only major regression issue people are likely to care about.

I did think of one more requirement: Spawn Rules. We need to figure out where and how they’ll be spawned, keeping in mind we don’t need to use the system that exists right now there might be better ways to do that. For basic requirements, I’m probably just going to spawn them statically on squares in some buildings, like shelters.

You mean I can’t have bugged out entities handing me lit sticks of dynamite as quest rewards anymore?

DARN.

At least short term I’ll probably make rewards hardcoded from a quest reward list.

No, they’ll do it INTENTIONALLY now :wink:

Re: Navigation, one area it’d be easy to improve on the existing behavior is to have them “want” to stay in their assigned place. So if they spawn in the shelter, they might run out and attack something, but then once the threat is past they’ll wander back inside.

Unlike the existing shelter NPC, who will steadily migrate further and further away from the shelter once they leave.

that’s a good idea - if they do move to fight something, some sort of “return to initial position” logic would be a very, very good addition.

Worst case, have them drop virtual breadcrumbs <_<
But really, we have a generic method to do a A* path search, as long as you aren’t calling it all the time that’s all you need.

No, they’ll do it INTENTIONALLY now ;)[/quote]
No they will fallout style pick pocket you and place it in your inventory lit!

anywho i definatly dont mind if the npc code as is gets removed completely to be replaced with the new, even if they lose a few things overall its much better that way and once the base has been built and stabalised its all shiney extras from there, assuming that theres no other pressing feature to move on to after the base is finished.

Also old NPC’s “when they moved” if you turned in a quest to them would be all, sure ill teach ya something, lets just get somewhere safe first! and then proceed to walk directly into a bee hive . . . ., or get distracted by enemys/hunting and be unable to go back to teach, silly NPCs XD

You could also abuse bugs in trading with them to get rich and have them teach you everything they know.

I don’t know why anyone would be attached to NPC’s aside from using that glitch to cheat.

Would it be possible to bounce dialogue trees to xml files? I’m not much of a coder but xml files are super easy to edit (and there are tools to format dialogue trees into xml files) and it would allow some fancy quest stuff by changing variables and stuff. Stuff being a technical term. So currently the code picks which kind of quest they give, but with this it could pick it from an xml file and you can create your own quests and whatnot. Yay modding.

Functionality is obviously a priority but I would love to be able to give NPCs a less… uncuth manner of speech :smiley:

People have complained about the rowdy nature of NPC speech in the past. Personally I enjoy it, and it IS a crazy messed post-nuclear hellhole, but I can understand how some people don’t like it.

Having someone chase you and wave you down just to tell you to fucking fuck off mother fucker and then run away is textbook Cataclysm NPC.

  1. xml: NO (we’re using JSON everywhere for this kind of thing)
  2. profanity: I’m fine with it being cleaned up as a (default off) option, but I’m not interested in doing the work to make it happen.
  3. Again, we’re talking about getting very basic functionality going here, dialog and quest trees will be built on top of this, but we’re not concerned with that level of functionality right now.

Well, NPCs must be responsive to the player class functions since we need advancement in the whole “party” department. Sure, AI can deprave us of the right to tell 'em to do whatever we don’t want to, but dividing rations, organizing equipment and such should be a wholeset of player’s decision making / discretion.
What gangs (“mobs”) could do is have a set of scripted actions (since factions are animal lovers, assassins, tree-huggers and tech-phr3aks) so they look like they “listen” to a certain leader’s call. Luring a throng of Zs onto this gang’s porch to see them all eaten is well, just priceless. :slight_smile:

Is there a work-in-progress NPC branch somewhere? Seems like a good way to coordinate effort.

Is it too late or can I still join this party?

I am a professional C++ developer with over a decade of experience. I’ve done AI before (though not this kind of AI) and I hope I can be of help.

So are you guys still in the planning stage, or are you breaking things down into tasks or what?

I came up with a plan but it fell apart because I’m a shit coder and NPCs are hard and I was basically the only one working on it. :stuck_out_tongue:

I will be trying again starting this weekend though, and hoping to get something out by Christmas, so any assistance would be appreciated.

Can you share the outline of this plan for discussion? or is this something that’s completely out of your thought process until the weekend?