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!
Lt. Commander
Join Date: Dec 2007
Posts: 120
# 2
12-03-2010, 04:33 PM
Oh! That makes sense! Thanks
Lt. Commander
Join Date: Dec 2007
Posts: 120
# 3
12-03-2010, 04:40 PM
A lot of useful info that I barely understand here.
Lt. Commander
Join Date: Dec 2007
Posts: 120
# 4
12-04-2010, 06:59 AM
Awesome, that all makes sense, though none of it solves my particular issue (making friendly and hostile NPCs fight each other). :p

Any chance we can get some kind of list or general idea of what Cryptic-designated objects get interacted with during a Jobs cycle?
Lt. Commander
Join Date: Dec 2007
Posts: 120
# 5
12-04-2010, 05:55 PM
I can't seem to get this feature to work, at least not when I test a map. The NPCs with "enable wander = true" just stand there...even after I wait quite a while.
Lt. Commander
Join Date: Dec 2007
Posts: 120
# 6
12-04-2010, 08:16 PM
I cranked all the variables up (weight and duration to max), but it still only happened very sparingly. I have a sneaking suspicion it's tied into the current issue that NPC pathing is atrocious at best, and the "wander" command comes back with being unable to establish a path to wander along or something.
Lt. Commander
Join Date: Dec 2007
Posts: 120
# 7
12-04-2010, 09:23 PM
Can some explain this in plain English? What is this used for?
Lt. Commander
Join Date: Dec 2007
Posts: 120
# 8
12-05-2010, 05:33 AM
Quote:
Originally Posted by Kirkfat View Post
Can some explain this in plain English? What is this used for?
It's about doing stuff.

Some stuff can be more important than other stuff.

If you want your NPC group to be hard working Dozers, you enable Jobs, and give the Job Weight a high number. And they'll go scurrying between nearby consoles happily tapping away.

If you'd rather they be Fraggles, you disable Jobs, and set the Idle Weight really high. You may optionally give them an idle animation to Dance their cares away.

Say you've got a weight of 15 for Idle and 5 for Jobs. That's a total of 20 with a 75%/25% ratio.

The AI picks a random activity, that is three times more likely to be Idle than Jobs. The chosen activity plays for the set duration time, and then a different activity is chosen. Again, with the same 75%/25% ratio.
Lt. Commander
Join Date: Dec 2007
Posts: 120
# 9
12-05-2010, 05:38 AM
Alright, I'll try to break it down a little more, as I understand it (I could be off as well).

Quote:
The first one is fairly simple:
Combat Entry Text: This text is what the NPC says upon entering combat.
Straightforward, this is what they'll say when they start fighting something.


Quote:
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.
NPCs are programmed to randomly select from a list of actions they can perform at certain intervals. Let's say you've got Wander and Idle set on an NPC. They're standing at Idle, and the Duration you've set determines how long they're just going to stand around (I'm not sure what the unit of measurement is, but I'd guess seconds). Once that Duration runs out, the NPC goes back to the list of available actions and randomly chooses another one. So if they choose Wander this time, they'll move around.

In terms of Weight, you're essentially setting the priority of that given action, and increasing the odds it'll be selected each time. So an NPC with a Wander Weight of 20 and an Idle Weight of 1 means they're almost always going to choose to Wander, and once in a while they'll stand around. If the Weight values for all actions are the same, then it's an even chance any of them will be picked.


Quote:
The "Idle" state is fairly simple and always enabled. For Idle Duration seconds, the Idle Animation is played.
Also straightforward. The Idle animation can be almost anything you want, so that gives you a good variety of actions and traits you can display (and make it extremely handy for Demo Recordings ).


Quote:
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 NPC, if they choose the Chat action from the list of possible actions, will say something you designate. If you have them set to basically only Chat, then they'll say the phrase pretty much constantly. If you want an NPC to just stand around and occasionally say something, then set the Idle Weight for a higher value than Chat (obviously, the higher you set it, the less frequently they'll say the phrase).


Quote:
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.
Essentially, every time the Wander option gets chosen, the NPC creates a random path for itself to walk along. Again, Weight affects how often this happens. When they reach each path node, they'll pause for a moment (how long they wait can be changed with Wander Idle). If they've reached the end of the path they've created, they'll go back to the list of actions. Otherwise, they'll go to the next node (so the more nodes, the longer and farther they'll wander around). Wander Distance, you can pretty much think of like an electric collar. The spawn point is the grey circle the NPCs are arranged around when you first create their groups, so the Wander Distance is a radius around that which determines how far away from that point they can wander.


Quote:
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.
If my assumption is correct, this is mostly an ambiance thing. Basically it allows NPCs to walk around and interact with various objects (such as a Starfleet officer walking up to a console and pushing buttons for a moment). However, since it only works with Cryptic-designated objects, and there's as yet no list of what these objects are, it's a bit hard to figure out what'll make it work. :p
Lt. Commander
Join Date: Dec 2007
Posts: 120
# 10
12-05-2010, 05:39 AM
Quote:
Originally Posted by HeathenStorm View Post
It's about doing stuff.

Some stuff can be more important than other stuff.

If you want your NPC group to be hard working Dozers, you enable Jobs, and give the Job Weight a high number. And they'll go scurrying between nearby consoles happily tapping away.

If you'd rather they be Fraggles, you disable Jobs, and set the Idle Weight really high. You may optionally give them an idle animation to Dance their cares away.

Say you've got a weight of 15 for Idle and 5 for Jobs. That's a total of 20 with a 75%/25% ratio.

The AI picks a random activity, that is three times more likely to be Idle than Jobs. The chosen activity plays for the set duration time, and then a different activity is chosen. Again, with the same 75%/25% ratio.
Thanks. What is a good map to test this on? I need one with a heavy amount of Cryptic-made interactable objects that the npcs will have jobs to do.

Also, is there a good npc group to use to test?
Reply

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 01:00 PM.