Jump to content

Black Book: CK-Fu - giving NPCs a realistic daily AI routine


worik

643 views

TLDR; NPCs in mods either just stand around or use a simple Sandboxpackage. But we have easy ways to add more immersive AI behaviour, without spending too much time on it. I show you one concept to it.

 

 

The setting

I have a small settlement, some NPCs with their random virtual lives and as long as no quest is running, they are supposed to simulate a lively village to the player.

That demands for a few idle markers and believable AI packages. But this can be a demanding task to think of every one of the again and again about the same daily chores.

That's where I tried to generalize and come up with an easy-to-maintain concept.

 

A sample daily schedule

My example NPC has a daily schedule.

  • sleep from 23.00 to 05.00
  • bathe or idle from 5.00 to 6.00
  • eat from 6.00 to 7.00
  • work at various locations from 7.00 to 12.00
  • eat from 12.00 to 13.00
  • work at various locations from 13.00 to 18.00
  • eat from 18.00 to 19.00
  • relax from 19.00 to 22.00
  • idle from 22.00 to 23.00

My example NPC has a home to sleep and eat, a shop and yard to work, a brook to wash and a nearby inn to relax.

In fact, all NPCs in my village have that, it's just that they live at different locations, own different houses, etc...

 

The technique

  1. I define keywords for common daily activities, that I think a AI should handle. E.g. a keywod for "sleep"
  2. I define a few AI packages for each of the generally possible activities. But each package will use the location "Near Reference" with my own AI keyword for that activity. And no package will have a specific NPC in mind.
  3. Some AI packages will have variations of their schedules, so that not ALL of my NPC eat at eaxctly the same time their lunch
  4. I add basically the same sequence of packages to my NPCs, just with the above mentioned variations in the schedule
  5. The actual NPC references that I place in the world get each their indivual set of linked references (create new linked references with a keyword)
    • I assign them to a dedicated bed or area with bed with the "mykeyword_AI_sleep" keyword
    • I assign them to a dedicated spot where I want them to eat.
    • I assign them to a dedicated spot where I want them to work.
    • .. etc ... one for each keyword
    • Basically, I decide with these links WHERE this NPC should spend it's day

Overall, they now have the same AI packages / packagelist but every one of them, has their own locations to do that.

 

The keywords

For the purpose of this concept, I just selected a few of the many possible ones to describe the daily activities.

  • mykeyword_AI_bathe
  • mykeyword_AI_eat
  • mykeyword_AI_relax
  • mykeyword_AI_sleep
  • mykeyword_AI_work01 to mykeyword_AI_work04

 

The AI packages

  • myAI_bathe - for now derived from "SandboxAndKeepEyeOn" with the "bathe" keyword
  • myAI_eat - derived from the "eat" template, taking the location from my "eat" keyworded link and variations for different starting times
  • myAI_sleep - derived from the "sleep" template, taking the location from my "sleep" keyworded link and variations for different starting times and durations
  • myAI_study - fow now derived from the "Sandboxworking" template, some specific idles, taking the location from my "eat" keyworded link and variations for different starting times
  • myAI_work - derived from the "SandboxMultiLocationWorking" template, taking the 4 possible locations from my "work" keyworded links and again with variations for different starting times and durations

 

Further idea

I'm still looking for a way of more randomization WHEN they do things, e.g. letting them have a random delay between 0-30 minutes.

Probably I would have to dump the vanilla AI package templates and recreate them with this "random delay" element inserted a key points.

 

References:

0 Comments


Recommended Comments

There are no comments to display.


×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more information, see our Privacy Policy & Terms of Use