Issues with AI


Author: Adam Toly

Our game being an RTS means all characters in the game are controlled by AI systems. I was in charge of setting up the basic AI that all the units would have access to. Initially, this was fine; I got the basic variables and functions set up easily. It was when I started setting up the child classes that I had issues. It started with a linker error, which took close to an hour to solve. Then, there was no way to properly differentiate between ranged and melee units. Finally, making the ranged units attempt to stand at their max range rather than point-blank.

I did, eventually, manage to fix most of these issues. The linker error was because the Build.cs didn't give access to the proper navigation library I was using. I added a bool that the AI controller class has access to to determine whether a unit is ranged or not. The last issue I was unable to properly fix, though they do stand at their max range as is. You cannot change the Move To node's acceptable range in the Behavior Tree for Unreal 5.4.4, meaning I had to manually input the range, which is fine if there's only one unit. We will not have only one ranged unit, though, so though solution I've come up with is I'll make a child class of the Move To task node that will let me change the acceptable range to a variable. I have yet to attempt this solution, but I hope in my next post I can talk about how it worked.

Get Real-Time Skeletons

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.