I’m looking to make advanced bots for my game. Usually, I would just make it pretty basic by making it wander, if it sees the player then chase after it. However, in my game, I have 2 teams with bots. I need one of the teams to attack the other, and I have 0 ideas on how to implement that. Do any of you have any ideas? I’ve looked all over the place and have found little to nothing related to this topic.
Under what conditions do you want your AI to target enemes? I would suggest thinking a bit more about how you want your AI to behave. What sounds fun to you?
A proper answer to your question depends entirely on your definition of “advanced”. Are you making an actor, or decision maker.
An acting AI has a fixed set conditions for what actions it will take. It merely acts like a decision maker. This works well when there are fixed conditions and actions. What looks advanced in an actor is most likely a very long state machine rather than actual advanced decision making.
A decision making AI needs foresight, and the only way to have foresight is for the AI to be able to simulate events by itself on what they and others can do, running many, many simulations to find what action to take. The more simulation cycles are run the smarter the decision maker will be. Writing a decision maker requires good abstraction of information, since it is impractical to run multiple full simulations of the game in the background.
In a large majority of cases, an actor will suffice, which is why @bobisgod234 has hinted at finding your conditions. If you know the conditions to trigger your desired behavior, you can write the state machine for it.
Then you will need to find/define the conditions for when you want an action to take place. This is something only you will be able to do since it is your game. The most anyone answering can do is look at each individual scenario you intend to have happen, advise on what makes up the condition, and see if your conditions can properly trigger the action.