# No Documentation of Services and Tasks Whatsoever for AI In C++!

**URL:** <https://forums.unrealengine.com/t/no-documentation-of-services-and-tasks-whatsoever-for-ai-in-c/348428>\
**Category:** AI\
**Tags:** Behavior-Tree, unreal-engine, UE4, CPP, question\
**Created:** [February 23, 2016, 8:09pm UTC](https://forums.unrealengine.com/t/no-documentation-of-services-and-tasks-whatsoever-for-ai-in-c/348428 "2016-02-23T20:09:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![LuLima](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@LuLima](https://forums.unrealengine.com/u/LuLima)\
**Post date:** [February 23, 2016, 8:09pm UTC](https://forums.unrealengine.com/t/no-documentation-of-services-and-tasks-whatsoever-for-ai-in-c/348428/1 "2016-02-23T20:09:21Z")

</div>

Guys, I’ve been scrounging for days now trying to find Information on programming AI into C++. I heard over and over @MieszkoZ saying “If you desire performance, do your AI in C++”. But you don’t teach us how, or have up to date Documentation on it!!!

Are you serious???

For Tasks i finally found this.

> **[A new, community-hosted Unreal Engine Wiki](https://forums.unrealengine.com/t/a-new-community-hosted-unreal-engine-wiki/141494)**
>
> After over a year in maintenance mode, the official Unreal Engine Wiki is now permanently offline. These resources now live on a new community-run Unreal Engine Community Wiki — ue4community.wiki! You will be able to find content from the official...

Okay i can handle it for now.

But there is NOTHING regarding services in C++!!! I found Exi post asking around.

> **[Behavior Tree Service in C++](https://forums.unrealengine.com/questions/200312/behavior-tree-service-in-c.html)**
>
> Hey there, i’m currently creating some VERY basic AI in C++. I only want to use the Behavior Tree, but create the rest in C++. I got everything working except the service. In the service, i’m calling the “SearchEnemy()” function that searches and...

However, the method that he overrides doens’t EXIST!!! “virtual void ReceiveTick(AActor\* OwnerActor, float DeltaSeconds) override;”

Please in the name of what most holy can you make our lives easier trying to use your Game Engine? Is it that hard?

---

<div class="post-metadata">

**Author:** ![phil\_me\_up](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@phil\_me\_up](https://forums.unrealengine.com/u/phil_me_up)\
**Post date:** [February 23, 2016, 9:38pm UTC](https://forums.unrealengine.com/t/no-documentation-of-services-and-tasks-whatsoever-for-ai-in-c/348428/2 "2016-02-23T21:38:08Z")

</div>

In all cases where you can’t find documentation, take a look at the engine code: [https://github.com/EpicGames/UnrealEngine/tree/release/Engine/Source/Runtime/AIModule/Private/BehaviorTree](https://github.com/EpicGames/UnrealEngine/tree/release/Engine/Source/Runtime/AIModule/Private/BehaviorTree)

There isn’t a lot in the way of examples for services (but should be enough to get going). There are however quite a few examples for tasks which you can use.

It’s a little more effort than reading documentation, but it’s certainly possible to use what’s provided to build your own tasks and services.

---

<div class="post-metadata">

**Author:** ![Demeese](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Demeese](https://forums.unrealengine.com/u/Demeese)\
**Post date:** [March 15, 2017, 6:54am UTC](https://forums.unrealengine.com/t/no-documentation-of-services-and-tasks-whatsoever-for-ai-in-c/348428/3 "2017-03-15T06:54:49Z")

</div>

You just need this in your header:

```
public:

	virtual void TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds) override;

```

Then in your CPP

```
void UCheckDistanceToWaypoint::TickNode(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory, float DeltaSeconds)
{
	ScheduleNextTick(NodeMemory);

}

```

Of course replace UCheckDistanceToWaypoint with your own class name.

Scheduling the next tick will allow the TickNode function to abide by it’s interval settings that you assign in the behavior tree.

Now… just create all your C++ functionality there!
