Tutorial for AI Agents?

MikeW

New member
Is there a tutorial for creating AI Agents? I've read the UCC artificial intelligence page, but it doesn't cover how an agent would use actions that inherit from DetectObjectAbilityBase (for example). I'm not ready to get Behavior Designer yet. For now, I'd like to have agents do simple actions like sitting in a chair (via the Drive ability and a custom IDriveSource), looking at an object, or making simple point-to-point movements.

Unfortunately, searching for "AI" in the forum isn't too effective because of the search restrictions.
 
For DetectObjectAbilityBase, I'd like to have my agent use the Drive ability. But to do that, I think I need to set DetectedObject in a script. Unfortunately, the setter is protected. Do I need to use a ObjectDetectionMode.Customcast with custom "look" logic for AI agents? Or is there a better approach?
 
Designing AI behaviour is beyond the scope of UCC. Behaviour Designer is designed for this exact purpose, but it's not simple. There are always simpler or more complex solutions depending on how sophisticated you want to get - I'm sure there are tutorials around the web for basic AI behaviour.

DetectedObject is supposed to only be used internally by DetectObjectAbilityBase. So you'll need to either use one of the built-in detection modes (what specific detection logic do you need and why don't any of the modes suit it?) or Customcast as you said.
 
I'm not asking for a tutorial on writing AI. I'm just looking for help integrating it with UCC. The documentation gives some helpful pointers (e.g. agents don't need a Ultimate Character Locomotion Handler or input components), but it has significant gaps. Like what to use as a camera surrogate. Or whether all the built-in abilities are suitable for agents, or if we need to roll our own versions.

For the Drive ability and others that use DetectObjectAbilityBase: I assume an AI agent wouldn't have a camera, so using a raycast from their look direction is not an option. I expect Trigger or Customcast would be the two reasonable options, right? Or do folks tend to use custom ILookSource implementations to determine which direction the agent is "looking"?
 
Like what to use as a camera surrogate.
The AI agents don't need a camera as the Local Look Source component is added and implements the ILookSource interface.

Or whether all the built-in abilities are suitable for agents, or if we need to roll our own versions.
All of the built in abilities should work with AI agents. You'll likely need to use different start settings but that's it.

For the Drive ability and others that use DetectObjectAbilityBase: I assume an AI agent wouldn't have a camera, so using a raycast from their look direction is not an option.
For this situation I would not have the ability use the look source but rather use the character's position/rotation.
 
Top