After checking out some of the Unity concepts just recently, Unity seems to be all about constructing a game from small autonomous “game objects”. This is a perfect match for shooters and other games where you essentially encounter individual enemies.
Now in a realtime strategy or tower defense game, for example, individual units have very simplistic behavior while there’s a commander AI that controls them.
Where exactly would this commander AI be placed in Unity?
Would I create a game object for that as well, driving all of the decision making logic from its Update() function or does Unity provide provide a special place for game controlling AI like this?
I find, the problem with questions about AI, is that its all situational or personal preference.
I imagine, in most general TD games, there’s the path-finding, creep picking and creep spawning. Then the towers AI (range,speed,creep detection etc). It makes sense for the towers AI to be attached to the tower, but the creeps AI to be attached to an empty gameobject.
Personally, the way I am doing it, is have a gameobject that is the “AIManager” that has the overall AI, then, i attach each enemies AI to the enemies gameobject.
That’s just the way I see it, I’m sure other people would do it differently, and I’m sure at some point so will I.
In an attempt to directly answer your question… no, there isn’t anything in unity that is designed specifically to hold AI functions.
Thanks. I agree, handling low-level behavior anywhere but in the game objects it applies to would be awkward. I was just wondering if there was some kind of game controller or conductor API that I could use or whether I would have to put it all in a game object (like your AIManager). Thanks for clearing it up!
Thanks. I agree, handling low-level behavior anywhere but in the game objects it applies to would be awkward. I was just wondering if there was some kind of game controller or conductor API that I could use or whether I would have to put it all in a game object (like your AIManager). Thanks for clearing it up!
– anon62524171