Prev Previous Post   Next Post Next
Lt. Commander
Join Date: Dec 2007
Posts: 120
There has been some confusion about the meaning and use of the variables in the "Ambient with Combat" Behavior, so here is an explanation!

The first one is fairly simple:
Combat Entry Text: This text is what the NPC says upon entering combat.

The others form the basis of our ambient/default behaviors. It is a state driven AI that bounces between a "Chat", "Jobs", "Wander", and "Idle". "Idle" is always active, and the others have their own enabler variable (Enable Chat, Enable Wander, and Enable Jobs).

The way the Behavior works is that every state lasts for a specified duration (Wander Duration, Idle Duration, Chat Duration, and Jobs Duration). Once that state is completed, the code randomly selects another state, using the weights provided by the user (Wander Weight, Idle Weight, Chat Weight and Jobs Weight). If a state is disabled, its weight is effectively 0 since it cannot be chosen. Likewise, if a state's weight is 0, it will not be chosen. Otherwise, a weighted random choice is selected and the AI does that state's behavior.

The "Idle" state is fairly simple and always enabled. For Idle Duration seconds, the Idle Animation is played.

The "Chat" state allows the NPC to say something. The NPC will pop up a chat bubble with the Chat Text in it, play the Chat Animation, and wait Chat Duration seconds.

The "Wander" state lets the NPC move around a bit. It does the random wandering that many of the NPCs in the game already do (in fact, they use the same code). The "Wander" state creates a random path for the NPC to walk, after which the NPC idles, after which the NPC creates a new path to walk, and so on. Wander Idle Time defines how long the NPC waits between creating paths. Wander Path Nodes determines how many path nodes are in the path - generally speaking, a larger number of path nodes creates a longer path. You can use this to strike the balance you want between "moving" and "stationary". Wander Distance is probably the least intuitive - it is NOT the distance of the random path created. It is the maximum distance from the NPC's spawn point that he will wander. So if you want a guy to stick close to his spawn position, keep wander distance low. Wander Speed is another fine tuning factor: it specifies the speed with which the NPC moves during the "Wander" state.

The final state, "Jobs", is more of an automated state than the others. For Jobs Duration seconds, the NPC will interact with nearby objects that have been set up to allow such automated interaction. This is wholly dependent on there being Cryptic designated ambient-interactable objects nearby, as opposed to UGC designated objects. Many of the objects have these designations enabled.

WARNING
"Wander" is limited in functionality until your map's first publish. After that, the navigation information will be generally up-to-date, with each publish updating it. Previewing (aka "Play Map" button) BEFORE the first publish will result in Wander doing nothing. New maps will need to go through the publish phase as well before they are wander-enabled. And if you drastically change your map (say, by adding 200 buildings to it), NPC movement will get a bit confused till the next publish.

Enjoy!
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


All times are GMT -7. The time now is 05:26 AM.