How do I make a basic AI?

Hi

I have been trying to make an AI that works good when there are like 30 units in the scene at the same time. So I read through the get started part in the enumeration but when I am clueless when it comes to implementing turning and stopping at the LAST point. Not the next to last. So I then looked through the AIPath script but I can’t get anything out of it. It is so messy. So I took the cheap route and copied the AIPath in to my own script and did some changes. I later discovered that if I have like 10 units in the scene they lag behind. Like when they tried to follow the player, they took some time to realize the player had moved. So after that unnecessary story, how do I make a simple AI that moves, turns and stops at the last point and has some acceleration? That is all I need. I can’t for the love of god figure out how to do it.

Hi

Try to adjust the repath rate and the other settings on the AI. If you are using a recast graph you can try the RichAI which can usually stop more accurately.

Hi
(Sorry for the late respond)
I am using a grid graph to make the AI navigate through my map since that works the best for what I am doing. So I did follow your advise and try to change the repath rate and that didn’t do much. The more AI units I have the more time it takes them to realize that the target has moved. Example:
1 unit: Works good. Instantly knows if the target has moved.
2 units: Same result as before.
5 units: A little bit of a slow down.
10 units: Takes them around 1 second to realize that the target has moved.
40 units (how many I currently have): They move to the position the target was at and after around 5 seconds they realize the target has moved.

So I need to create a better AI that isn’t so slow in thinking. But I can not figure out how I make one. I followed the “Get Started” tutorial but that AI is missing some stuff I really need. Like rotating in the direction it is going and smoothly going to the last point. Could you please just help me get the things I mentioned in the original post going and I’ll be on my merry way?

That sounds like the pathfinding is limiting throughput.
Try to enable multithreading (A* Inspector -> Settings), that will likely make it more responsive (alternatively increase the maximum amount of time it can use per frame (“Max Frame Time”), but that might have consequences for your FPS).