AI Packages and Procedures

Post » Wed Apr 13, 2016 8:00 pm

I am looking for detailed explanations on what they all do. I've googled around a bit and have come up with snippets, but nothing comprehensive.


By "all do", I mean when I use GetCurrentAIPackage, and the result is 10 (FLEE) how is that different from 18 (FLEE_NON_COMBAT)?


My purpose is to try to establish a sense of when someone is most likely to be hyper alert of their surroundings vs. not.


For example, if the package is EAT or DIALOGUE, then they won't be nearly as concentrated on their surroundings vs. COMBAT or ALARM.


If someone is "Alert" (such as a guard on duty, being in combat, etc.) they would get full use of their stealth skill, vs. not alert, where they would get a fraction. And perhaps it's on a sliding scale with different fractions for different packages/procedures.


I also have to decide if the current procedure should override or stack with the current package.


So you see why a detailed breakdown would be helpful, if someone knows of one.
User avatar
Steeeph
 
Posts: 3443
Joined: Wed Apr 04, 2007 8:28 am

Post » Wed Apr 13, 2016 7:01 pm

Can't help you much, besides mentioning that there is a thing called dynamic packages, in case you have not noticed it already.



As far as I can remember, the game creates a dynamic package when it needs the NPC to do something different from his current package. The standard package resumes when the dynamic package finishes. Example: NPC enters dialog or flees during a standard Travel package.



It can be detected by comparing GetCurrentEditorPackage with GetCurrentPackage. If they are different, the NPC is . . probably? actually? . . running an dynamic package.



Dynamic packages always have GetSourceModIndex = 255.






Not sure what you mean. As far as I remember, the procedure is a 'sub-division' of the package, in other words, while a package runs, one or more procedures will run within that package. From the WIKI "For example, while in a Travel package, an actor will do the Travel procedure (when the actor is moving towards its target) and then the Wait procedure (when the actor has arrived at the travel destination)."

User avatar
Madeleine Rose Walsh
 
Posts: 3425
Joined: Wed Oct 04, 2006 2:07 am

Post » Wed Apr 13, 2016 9:55 pm

What I mean is that lets say the current active package is "Combat". Actor gets a bonus to detect. But if the current procedure is "Flee", would the bonus/penalty for Flee be in addition to or in place of the bonus for Combat?


I'm not sure how to really apply your suggestion regarding dynamic packages. Especially since I can't identify what any of them do, the best I can do is get the current AI Package ID and current AI Procedure ID.


I did some research after inital post, and found detailed descriptions of all the ones you can pock from in the AI Package window. But it appears that there are many different types of packages that are either not accessible (so I can't be sure what they do) or are generated elsewhere (like the dialogues?).


What I find weird is that there are no procedures listed in the AI Package window, so I can only assume that procedures are dynamically created based selections made for the package and environmental factors.
User avatar
Olga Xx
 
Posts: 3437
Joined: Tue Jul 11, 2006 8:31 pm

Post » Thu Apr 14, 2016 2:56 am

I just mentioned dynamic packages in case it helped in any way (not a suggestion, actually)



I also assume that procedures are a sort of 'state machine' hardwired within the package.


The Travel package example seems a good example: it has two 'states': 'on my way' (procedure Travel) and 'arrived' (procedure Wait)



When I re-engineered the AI for my mod, I came out with the same concept, although i called them Activity/Action instead of Package/Procedure.

User avatar
Alyna
 
Posts: 3412
Joined: Wed Aug 30, 2006 4:54 am


Return to IV - Oblivion