Jump to content

AI Package Tutorial


sumoftwosins

Recommended Posts

There have been a few people asking about AI Packages. It isn't that difficult, but it can get overwhelming. I don't really want to call this a tutorial, because I don't presume to know everything about AI Packages. Instead, I am going to share what I've done for my mod and so forth. Hopefully it will help some of you on implementing and streamlining AI Package.

 

The important things are always simple. The simple things are always hard.

----------------------

Planning

 

If you have Excel or another type of spread sheet software, break it out. If you don't get paper. You first want to decide the roles people will play. This project we will have:

 

4 Patrolling NPCs - security patrols.

3 Guarding NPCs - stationary security.

2 Reception NPCs - Like the walmart greeters.

4 Working NPCs - People doing things in specific areas.

 

Now that we know who we have and some idea of what they will be doing, we can move on to the schedule. There are several AI Package objects that can help you on determining when someone does something. The most direct way is setting up the actual schedule - Begin Time 22:00, Duration 8. This method seems to be the best at making things specific. You need it to be specific in the event you have a limited number of beds. However, setting out to plan every hour of an NPC's day can get complicated. There is an easy alternative for less specific packages like wandering. This method used Flags instead of a schedule.

 

I on the other hand want most everything my NPCs do to be specific. This is where the spread sheet comes in. Here is the one I made for my mod:

MERC Shift / AI Outline

 

To explain the short hand: R1S1 = Route 1 Shift 1, R1S2 = Route 1 Shift 2, W-LOBY = Wander Lobby, and so forth. At the bottom of each schedule page are the AI Packages I will need to create to manage everyone on multiple shifts. Being this detailed will allow me to have people performing duties and have people wandering through areas.

----------------------

AI Packages

With our shifts lined out we can start creating our AI Packages. For sleeping during a specified shift with male and female quarters we need:

 

MercSleepNightMale / 10PM to 6AM

MercSleepNightFemale / 10PM to 6AM

MercSleepMorningMale / 4AM to 12PM

MercSleepMorningFemale / 4AM to 12PM

MercSleepDayMale / 1PM to 8PM

MercSleepDayFemale / 1PM to 8PM

 

So lets create the first AI package:

 

Pict 1 - Sleep AI

Pict 2 - Sleep Step 2

 

The upper right hand specifies the type of package. There are several ways to do sleeping. If you want to make sure they go to sleep, select the sleeping type. The other way is using wander and allow them to sleep if they want to.

 

Sleep location can be specific or a random bed in a specified area. If the 1st picture, we selected "Near Reference" and selected the X Maker in the barrack to the right. You will need to set the radius for any "NEAR" options. The 2nd picture just shows the schedule to match the spread sheet.

 

 

Sleeping is easy, so lets do some Wandering AI packages, specifically lunch:

 

MercLunch1

MercLunch2

 

Pict 3 - Wander Step 1

Pict 4 - Wander Step 2

Pict 5 - Wander Step 3

 

In the first step you can pick the location based on reference just like sleeping, but we have some extra options. The allowed behavior is as it sounds. This is your alternative way to have people sleep as well. If you already have them on a sleep package, make sure to un-check this option.

 

We really don't need any flags set, but this is the fast and easy method of scheduling. If you want to create a generic package that all NPCs will use regardless of their shift, you can select "Once Per Day". So basically whenever the NPC is not performing a different AI Package they will perform the random "Once Per Day" routine. This is a good option if you set the wander location to an entire section.

 

In the next step shown, we're looking at Specific Idles. You can list them here or setup idle markers in you map. Some Idles require the person to have a weapon as they are shown holding it. So my suggestion is to add these type of Idles to the AI Package specifically and use Idle Markers for generic Idles that everyone can perform.

----------------------

Implementing

If you are like me, you probably will end up with a ton of AI Packages and it will take a long time to add them to each NPC accordingly. There is a different method that will speed up the process - NPC Templates.

 

Pict 6 - NPC Template Step 1

Pict 7 - NPC Template Step 2

Pict 8 - NPC Template Step 3

 

In the first step, I created "MercTempShift1" and will eventually create a Temps for each Shift accordingly.

 

Next you select all the AI Packages that will apply to NPCs that will use this Shift.

 

Finally after you have your template NPC, you can create the actual NPC. Now all you will have to do is select the Template Data / Actor Base. Select your template and select all the options you want to inherit from the Temp NPC. So in short, you don't have to add a bunch of AI Packages over and over. As you can see, you can use a Template NPC for inventory and pretty much everything else. It really helps when you are creating several NPCs that are similar.

 

----------------------

----------------------

That sums it up. It is pretty straight forward, but planning can get crazy... so I hope this helps. I haven't messed with all of the types, like Travel, so if anyone else wants to comment or correct me - be more than welcome to. I might just make it more complicated than it should be, but Bethesta gave me a unlimited universe to mod in, so...

Link to comment
Share on other sites

Fixed the links. Sorry about that.

 

As far as the radius... I am not positive. I assume that radius units are the same has the editor units. Most wall sections are around 256 units wide (X axis). So in theory, if you had a radius of 300 that would be the equivalent of single section. I could be wrong and one radius unit could be equal to one section, but looking at other AI Packages (Tenpenny security) they wander 250 - 400... with that said, I'd assume the first theory.

Link to comment
Share on other sites

  • 2 weeks later...

Well there were several things I was wrong about.

 

I've spent a lot of time on packages. Jumping in to test them and seeing them not work. I was about ready to say the hell with it, but I tried one last thing - time.

 

I loaded up the mod and just started playing the game. Doing other stuff and coming back to the base to see what is going on. Sure enough after a few trips and several in-game days, the NPC's finally seems to start doing the stuff I wanted them to do. There are still a few minor problems, but they are finally eating, working, and sleeping. So that is my last tip - time.

Link to comment
Share on other sites

Templating, yes -- I wish more things could make use of 'inheritance', like objects, scripts, even skills, both base and reference items.

 

I came across AIProcedures while browsing the G.E.C.K. documentation, and it looks like some of these contain behaviors that Packages don't make reference to. Is there any way to set their liklihood in a Package, or do they have to be specifically invoked in script? eg, I have an NPC traveling overland to a set destination, but I want him to stop to cannibalize any fresh corpses he may come across, whether the PC is there or not.

Link to comment
Share on other sites

Templating, yes -- I wish more things could make use of 'inheritance', like objects, scripts, even skills, both base and reference items.

 

I came across AIProcedures while browsing the G.E.C.K. documentation, and it looks like some of these contain behaviors that Packages don't make reference to. Is there any way to set their liklihood in a Package, or do they have to be specifically invoked in script? eg, I have an NPC traveling overland to a set destination, but I want him to stop to cannibalize any fresh corpses he may come across, whether the PC is there or not.

 

Well for skills and SPECIAL, you can create a new class. I did this because I had some soldiers who I wanted to have different tagged skills than others.

 

As for what you are wanting to do... having an npc perform a task while performing another, not exactly sure. The only thing I can think of is changing the travel parameters or create a new package type. How? I have no clue.

Link to comment
Share on other sites

did one of you guys get the "useweapon" pack to work?

i get em to go to their position, grab the weapon and then stand in front of the target looking agry... yet they dont attack...

 

jaysus, did you associate a target with the package? If you look at the citadel exterior, one their dummy targets they have XMarkers on them. Then if you look at the package CitInitiatePracticeHandgunB0x24, you will see that the ref's for those markers are set as the target.

Link to comment
Share on other sites

  • Recently Browsing   0 members

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