AI Memory Point

Would love feedback if this is a good way to deal with AI memory points. On my character tick I spawn a sphere as soon as the character disappears from the AI’s sight. I tell this to my character using the AI tick, setting “hidden” to true as soon as I stop seeing the character. Then I get all actors of class (memory markers) and move the ai to the marker. I will destroy the marker on collision with the AI.

I have a couple problems I know.
1 - The AI move to isn’t set up correctly. I haven’t played with it much but any suggestions would be awesome.
2 - If I have multiple AI seeing the character, then I’m gonna need a better way that just getting all actors of class. I’m guessing sorting them into an array and somehow getting the correct one for the correct AI? Its a little beyond me at this point.

Thanks for the feedback guys and gals!

You doing pure BP AI, no behavior trees or EQS?
If so you should dig int those 2, behavior trees are not that great. Same functionality may be done with about same time investment compared to BPS, that if you count time needed for learning trees and coding it.

But huge benefit of behavioral trees is EQS. For your code here, you could run EQS query, that finds best spot to run to that was near last seen location, store this in btree key as vector.
That stuff is instanced per aicontroller, so no problems about which bot should remember which spot.

Downside of it is that atm EQS is a bit wonky, but i think they will patch it soon enough.

For memory (in pure blueprint solution), you should store vector of last location.
Or even better create struct, that stores vector, forward vector of enemy when last seen (to remember where it ran), and maybe some other stuff that you possibly want to add later (that s major reason for struct here, you can expand it later without big changes to code).
Store that struct in your player controller of that bot. Better even make array out of it, tore all those points, then make some filtering rule and pick best (again EQS is very powerfull for this).

For bots to behave like bots you need to thing like that animal or bot would think, and code in similar way to their decision process, this way bots will behave in more “natural” way. So storing last seen location in local bot memory is more natural than some global invisible actor.

Ps. you could also add expiration data for last seen location. So bots lose interest after some time, but that was very weird in SKYRIM for eg. After you stealthy kill somebody his buddy who was chatting with dead now since forever, say “Oh probably that was nothing”, 10 seconds later “oh no where is that body from!” about guy they were chatting all the time since beginning of game. I find it creepy.

Right sorry! I am running a behavior tree and I would say I have a solid basic understanding of them. However I have never heard of EQS. Which of course I googled and am now going to try and learn more. It sounds like it could be really helpful. Haha and yea the skyrim guys are creepy. You’d think it would have been pretty easy to tell their AI “if you’ve seen a dead AI don’t return to idle so quickly”. Thanks a ton for the help! This gives me a lot to learn and research.

Be careful with EQS or i rather should write mind that they have some bug.
They use those custom made provision function (that are part of EnvQueryContext blueprints).
If you create one compile then place in EQS it will work, but if you change anything in that function and recompile it causes some hidden crash in engine.
Function will appear as not working. You need to restart editor, it will solve crash.

For now (because of crash) I made all logic elsewhere, and use those functions purely to get variable and deliver to EQS. Hopefully we get fix for that soon.

So while learning all this keep in mind that not working EQS may be not because your error but because that hidden crash.