Jump to content

NPC AI Package Help. Will trade 3d meshes for good help!


Dreyvor

Recommended Posts

I want to make NPCs do some cool stuff. I have a lot of ideas, however all of the AI Package tutorials I have found seem to not really explain how AI Packages work, but rather "Here if you do this with packages, you can make a follower/merchant etc..." I have done a lot of searching for them, but does anyone know of a site that explains which AI Packages do what? Or any good tutorials on general use of AI Packages?

 

I am a 3d modeler, and will do custom meshes for people who give me useful advice that helps me on my quest!

Link to comment
Share on other sites

Well, you should start off by reading these two articles on the CK wiki:

 

-Category:Packages (a quick breakdown of the different elements of packages)

-Package Stack (an explanation of how multiple packages come together to form an actor's AI)

 

The second one is especially important.

 

Essentially, an AI package is a single task that an actor performs, though a package can have multiple steps. This is probably more easily understood through an example. My custom companion, Atvir, has a "Follow while riding" package. It is a single task: Atvir is to follow the player on horseback. However, in order to do that properly, he needs to be on a horse. Therefore, the package has two steps: a "locate horse" step, and a "follow" step, that occur in sequence (ie. Atvir must try to find a horse before he tries to follow).

 

That package is one of a dozen or so that form his AI - referred to in CK jargon as his "Package stack". It's given this name because the AI can be pictured as a stack of packages of diminishing priority - the one on the top will be run first, if its conditions are met, and if not, the next one on the list tries to run (and so on and so forth).

 

Note that in addition to being controlled through conditions, packages can also be set to only run at certain times, and for certain lengths of time. This makes it extremely easy to set up a complex living schedule for an NPC, once you understand how packages work together.

 

Good for you for taking on a new challenge like this! I hope some of this info helped!

Link to comment
Share on other sites

Thanks for your help Janus.

What I want to do first is make an NPC that travels from town to town staying for about a day, then traveling to the next town. I'm having trouble setting up the AI for that. Any ideas? I get sort of how the packages work. I think I just need to find a good tutorial on creating custom ones, so that I can get the hang of it.

Link to comment
Share on other sites

Well, it might be as simple as setting up Sandbox packages to run on each day of the week, for a duration of 24 hours. The stack might get wonky, but I would try first to stack it with the end of the week being on the top. Then what you will need is an Xmarker for each package to reference, place them in an inn or wherever you want them to mill around.

 

To link the package to the Xmarker under the Package tab where it says Location, click on the box that says "near editor location, radius 0" then check the circle next to "Near Reference" (you'll need your Xmarker visible in the Render Window) then hit Select Reference and it should give you a crosshair that you'll click on the Xmarker and it will link to that location. They should automatically interact with their environment to a degree, give them a decent radius such as 2000 or so for starters.

 

Now if you set up each package to an Xmarker in each city, the NPC ought to travel there to perform the package task for the duration on the specified day. It may or may not work how I expect it to, they may walk to each city thereby wasting a lot of time in their day...but it might be somewhere to start testing it out.

Edited by TheGreenLion
Link to comment
Share on other sites

Well as GreenLion just said, you just need a Sandbox package.

 

Let's say you want your NPC to go to Whiterun and stay there for a week.

 

You'll put a xmarker in the middle of the city, set a package with let's say 40000-50000 radius (covering the enrtire city) and give it a shedule like "month n. 4".

 

So when the right month comes, the NPC will travel to Whiterun and stay there until the month changes.

 

If you want to cover the whole year, the stack would be a bit complex, but once you catch the mechanics it shouldn't be hard.

Link to comment
Share on other sites

Thanks for your guys' help. I think that should get me started, and I'll post my results when I get a chance to implement your advice.
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...