x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

[Closed] GameplayTask Resources

I'm trying to understand what does these functions do

 template 
 inline void AddRequiredResource()
 {
     AddRequiredResource(T::StaticClass());
 }
 
 template 
 inline void AddClaimedResource()
 {
     AddClaimedResource(T::StaticClass());
 }

Additionally, why does AITask has this function:

 void UAITask::RequestAILogicLocking()
 {
     AddClaimedResource();
 }

This seems to set the controller to null? Finally, is this an attempt to have multiple requesting methods (to move a pawn in this case) that play nice with BehaviorTree?

Thanks, Oscar

Product Version: Not Selected
Tags:
more ▼

asked Jun 18 '16 at 07:13 PM in Using UE4

avatar image

Answers.Archive STAFF
1.9k 208 316 688

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

The question has been closed Jun 18 '16 at 07:14 PM by AndrewHurley for the following reason:

The question is answered, right answer was accepted


1 answer: sort voted first

Hey Oscar,

AITasks (and by extension GameplayTasks) are indeed aimed to be (at some point) where all possible request sources meet to do the actual work. GameplayTasksComponent is responsible for managing tasks of different priorities and different requirements. Resources "required" by a task are the resources we need to have available to trigger the task (like "movement" needs to be available). Claimed resources, are the ones that will get "locked" when a task gets activated (so movement tasks can claim "movement" resource).

I'd love to hear your feedback on this approach. However, I suggest waiting for 4.12 before seriously using AITasks - there have been a lot of improvements done to the system due to one of our AI heavy projects (Fortnite) switching over to AI tasks. Paragon has just started using AI tasks as well.

Cheers,

--mieszko

more ▼

answered Jun 18 '16 at 07:13 PM

avatar image

Answers.Archive STAFF
1.9k 208 316 688

avatar image Answers.Archive STAFF Jun 18 '16 at 07:13 PM +

What does claimed resources mean? I see that when I lock the AI the controller icon becomes a red devil icon. Looking up how the debug draw determine which icon to draw, it shows that the controller is null?

In general I like the idea of having a manager type object that juggles the priorities and limit executions per frame. The only concern I might have is the encouragement of using these nodes in just any Blueprint. This makes it hard to find all the behavior in one place (the behavior tree for example). I'm curious how well it is working when a project have many AITasks and at the same time still uses BehaviorTree.

avatar image Answers.Archive STAFF Jun 18 '16 at 07:13 PM

A claiming a resource means given AI's GameplayTasksComponent takes a note of the fact and the resource is considered unavailable for lower priority tasks.

Locking "logic" resource doesn't clear the controller. Look at AAIController::OnGameplayTaskResourcesClaimed for details.

We allow AITasks usage from BP to support AI scripting. You don't have to do it, but if you want for example level-placed things to be able to tell AI how they'd be used AI tasks would be the way to go.

AITasks work with BTs flawlessly provided you have UE 4.12 and add following to your projects DefaultEngine.ini:

 [/Script/AIModule.AISystem]
 bEnableBTAITasks=True
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question