View Full Version : NPCs

05-03-2012, 02:09 PM
Shadow, could you explain how HappyActivityChance works?

My guess is that it's just what it says (ie. the chance for activities that are happiness related?) but why does the chance increase rather than decrease for very low level happiness?

05-03-2012, 03:49 PM
HappyActivityChance works with the corresponding MinHappyLevel value. Basically if the NPC's happiness is above the MinHappyLevel (uses the first one that this is true for), the NPC has that chance to do an activity.

Here's how it ends up working: happy people do lots of positive activities (solve quests, conversation, etc), whereas unhappy people do lots of negative activities (drinking, arguments, etc).

05-03-2012, 03:57 PM
Aaah ok. So an NPC has a chance of doing no activity, and this influences what the chance of activity in general is?

Also, is each activity round 10 seconds? (It seems like it from the base) I'd like to take a stab at implementing a simple version of the idea of having status effects for activities that affect happiness. I can't do anything about the stuff that's in systems2.gdb like showing that mourning took place or that a family member left town, but I can do it for some of the stuff in activities.gdb.

BTW is NPC reputation tracked per NPC->NPC pair or globally? When an activity changes reputation of a target, is that the reputation of the target in the NPC's eyes, or is reputation just a single global value per NPC?

05-03-2012, 06:53 PM

The activity time depends. Minimum time between checks for an activity is 17.5 seconds. This is defined by ActivityTime in BehaviorData2.gdb. This timer starts right away if no activity is chosen or starts after the current activity is finished.

The time the activity actually takes is defined by ContinueTime in activities.gdb (not counting walking time).

Reputation for NPCs is between each NPC/NPC pairing. Things like getting kicked out of town happens when a certain percentage of the town doesn't like the NPC.

05-03-2012, 08:15 PM
Sweet. Thanks.

05-06-2012, 02:29 PM
OK I've started implementing status effects for NPCs and I think it's really good. It really gives you a better sense of what the NPCs are up to. What I'm doing is simply making empty status effects that last 5 minutes, and serve as records of what NPCs were up to. Here's what I'd need to really get these effects to be perfect (and I definitely think it should be implemented in the regular game as well):

1. The ability to show which target NPC and which third NPC were affected by an activity. For example, a "Gossiped" status effect would be able to say who the NPC gossiped with and who they gossiped about.
2. The ability to add status effects for the things mentioned only in systems2.gdb, like a family member leaving town, or mourning for a friend.
3. Right now you can only create a status effect for the affected person, but not for the target NPC. StatusEffectNameForTarget and StatusEffectNameFor3rdPerson would really help here, to show that both people were in a conversation for example.
4. It would be nice (but not critical) to be able to make different status effects for the cases that an NPC managed to solve a quest and didn't manage to do so.

Somewhat related is this request:
5. I tried to add a status effect to QuestStarving (a starving NPC quest), but it doesn't seem to work. Would it be possible to enable this?