Making Advanced AI/Bots

Hello all,

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.

You really found nothing about making an AI that attacks targets?

2 Likes

Well, I’m pretty sure on how to make the bots attack a target, WHEN it has one. I’m just not sure on how to make it find ones and for it to wander.

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?

Well, I want the bots to go to certain “Checkpoints” that they have to defend/attack. They will probably spawn at the opposite sides of the map, too.

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.

2 Likes

Probably an actor as I’m not that good with Ai and stuff.

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.

1 Like

Go read the book “AI for games” by Ian Millington and John Funge, chapters 5 and 6 if you don’t wanna read the whole thing.

1 Like