# Simple AI C++ behavior trees

**URL:** <https://forums.unrealengine.com/t/simple-ai-c-behavior-trees/293526>\
**Category:** AI\
**Tags:** Behavior-Tree, unreal-engine, Code, CPP, question\
**Created:** [September 12, 2014, 1:28pm UTC](https://forums.unrealengine.com/t/simple-ai-c-behavior-trees/293526 "2014-09-12T13:28:59Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RemiDM\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RemiDM\_1](https://forums.unrealengine.com/u/RemiDM_1)\
**Post date:** [September 12, 2014, 1:28pm UTC](https://forums.unrealengine.com/t/simple-ai-c-behavior-trees/293526/1 "2014-09-12T13:28:59Z")

</div>

Good day guys,

Right now I am kind of lost because I haven’t been able to do the AI for a project I am working on. I have tried to look at the Shooter game and work around this code but nothing worked. Could you help me guys!

What I basically want is an AI that when the enemy(The player) crosses his line of vision will chase him for a few seconds and come back if the attacks were not successful. Also when the player is not around I want the AI to wander aimlessly. I tried to do this with the behavior trees

I have tried so many times to find a way to get this to work but right now I just can’t do it ! Could you point me to the right direction or help me start this !

---

<div class="post-metadata">

**Author:** ![Duncan\_Dam](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Duncan\_Dam](https://forums.unrealengine.com/u/Duncan_Dam)\
**Post date:** [September 12, 2014, 2:35pm UTC](https://forums.unrealengine.com/t/simple-ai-c-behavior-trees/293526/2 "2014-09-12T14:35:00Z")

</div>

You could start with some simple tutorial first, it could be a lot out there.

This one u can start first.

> **[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...

Then this one if u want more.

> **[Behavior Tree Tutorial](https://forums.unrealengine.com/showthread.php?130-Behavior-Tree-Tutorial)**
>
> Disclaimer right up front. This isn’t complete, I’ll edit it to fill it out. Also, I’m on a slightly older build of UE4 and I’m not sure what’s changed with today’s version. Edit: In the tread that follows, Epic devs share many things about the UE4...

---

<div class="post-metadata">

**Author:** ![RemiDM\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@RemiDM\_1](https://forums.unrealengine.com/u/RemiDM_1)\
**Post date:** [September 13, 2014, 2:49pm UTC](https://forums.unrealengine.com/t/simple-ai-c-behavior-trees/293526/3 "2014-09-13T14:49:55Z")

</div>

Do you have anything more than this ? Maybe more related to moving AI?

---

<div class="post-metadata">

**Author:** ![MieszkoZ](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@MieszkoZ](https://forums.unrealengine.com/u/MieszkoZ)\
**Post date:** [September 15, 2014, 2:02pm UTC](https://forums.unrealengine.com/t/simple-ai-c-behavior-trees/293526/4 "2014-09-15T14:02:25Z")

</div>

There are bits of what you need in [my spare-time AI tutorials](http://miechu.nazwa.pl/aitutorial_joomla/)

–mieszko

---

<div class="post-metadata">

**Author:** ![Bob\_Ironthighs](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Bob\_Ironthighs](https://forums.unrealengine.com/u/Bob_Ironthighs)\
**Post date:** [February 23, 2016, 5:11am UTC](https://forums.unrealengine.com/t/simple-ai-c-behavior-trees/293526/5 "2016-02-23T05:11:33Z")

</div>

Please delete this link. It points to a suspicious site. Thanks.

---

<div class="post-metadata">

**Author:** ![Nevermore](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Nevermore](https://forums.unrealengine.com/u/Nevermore)\
**Post date:** [December 21, 2016, 1:15pm UTC](https://forums.unrealengine.com/t/simple-ai-c-behavior-trees/293526/6 "2016-12-21T13:15:26Z")

</div>

still pointing to phishing site
