The story is about 2D games from a third person (top view). These are mostly shooters, but the strategy will also be affected. For ease of comparison and understanding, we take our favorite kittens. Yes, yes, it is cats that will help us with this.

')
So, how do we see the usual behavior of bots in games? For clarity, we will consider a couple of examples (Fig. 1).

Fig. 1 Left -
SAS Zombie Assault 3 and right
Ninjago .
Advantages and disadvantages
Pros:1. For a couple of rounds, the trajectory of bots becomes predictable. Winning becomes easy.
2. You can "turn" bots and always remain unscathed. Gamers even have such a thing as “Waltz circling”.
Minuses:1. For a couple of rounds, it is not interesting to play with bots. You continue to play for points and rewards, the bot ceases to be an opponent.
I will not begin to grind up all the advantages or disadvantages, I think everyone understands that such a bot is not an adversary. Yes, you can complicate the level by adding 1000 such bots and reduce cartridges. Or put in an enclosed space, where you especially do not run. But the essence does not change. Developers complicate the conditions, but not as an adversary. From a development point of view, it's easier and easier.
Let's analyze the tactics of such bots on the fingers.

Fig. 2 The picture is divided into 4 frames.
1. In the first frame, we see a bot and a player facing each other. For clarification: we are the player, the bot is the program code.
2. In the second frame, the bot, seeing no obstacles, starts shooting at the player.
3. In the third frame, the bot is facing an obstacle and has to bypass it, since it cannot shoot through the obstacle.
4. And finally, the fourth frame, the essence is the same, only a lot of obstacles and the bot has to constantly change the trajectory to achieve the goal. Orange color is not in vain highlighted "visibility" of the bot. Since not having the intellect of a bot, the developer immediately tells him his task. The subtask is in our case the movement to the object.
So we figured it out. The main task - to reach the
fly, crawl, jump to the goal, the additional to choose the best path. These principles are used by many in nature, but I decided to choose a more ideal object in my opinion -
CAT . Although the cat is much superior to the bot, the principles are the same.
Characteristics of the object "Cat"

Fig. 3 Random motions
Unplanned goals, random, but at the same time accurate movement and finally tactical thinking.
From life observations, the cat will never go through a puddle or try to jump on an item that is above the 4th floor. He sees the cat well in the daytime and in the dark, but in no way “through” his favorite boxes. It hides when danger occurs during a hunt or from hopelessness.
Now, we can apply it to our bot, thereby improving its characteristics and change the predictability, and hence the complexity!
I think to drive such a bot, even in a closed room will be much more interesting.
We improve the characteristics
Visibility area - a bot should not initially see its enemy; visibility should be limited not only to the “fog of war”, but also to the objects that surround it. Fig. 4. Moreover, on the first frame, the bot immediately sees the player even through objects, at any distance. On the second frame, its review is limited and the bot tries to “feel” with his gaze at the search for a target. Bot has to perform subtasks in order to find a player.

Fig. 4 Visibility area
Comfort zone - the bot will go to the breach at any cost until it kills or is killed. So it should not be. If a bot understands that its life comes to an end (will come to an end), then it should hide. Or, for example, the forces are not equal, again I have to find shelter. Fig. 5. On the first frame, the bot classically thinks that he is “Rambo”; on the second frame, the bot is trying to increase his chances of survival.
Cats are very fond of the comfort zone, so they always get away from collisions with foreign moving incomprehensible bodies.
Fig. 5. Comfort zone
The affected area is hitting a bullet (knife, grenade), one of the interesting tasks of players and bots. Let's say in Battlefield 3 made such a cool effect as suppression, the trajectory of the bullet and the power of damage. Thus, from the same weapon it is impossible to kill at different distances with different shooting modes. In Counter Strike, this is not, except that the spread of bullets ...

Fig. 6 Left
Battlefield 3 and right
Counter StrikeBut these are already stronger games in comparison with those about which we speak. But nevertheless, it is possible to take at least elementary examples. The affected area should be limited. For example, objects and objects, and most importantly, distance. The figure below shows what the further the enemy is, the fewer bullets it will get into it. I understand that everything depends on the weapon, but this is the subtleties of the game.
As I said above, the cat will not jump higher than what he is capable of, even if he is sure that he will jump. Exception: cats with the number of lives> 6
Fig. 7 The scale of the defeat of the enemy.
Waiting area - well, everything is simple, bots, as a rule, rush like heads to find a goal; by this, the player just needs to sit and wait. Predictable. But in the same "Counter" bots sit out! But the "camper" bot is already a surprise for the player.
Cat 90% of his life in boot and standby mode. Perhaps it saves him from random actions.The trajectory of movement - if you imagine a situation that a bot has an opportunity to circumvent an object, then why doesn’t it have a chance to jump over it? Here the question is already to the subtleties of the game ... but no one excluded the alternative to the passage. See the picture below. The first frame shows the classic selection of the upper passage bot, because it is closer. In the second frame, our bot chooses the bottom one, because, in the third frame, the bot understands that the width of the passage is wider, which means more opportunities for maneuvers.

Fig. 8 movement trajectory
Unfortunately, only Chuck Norris can calculate the trajectory of cats.You can continue to invent more and more ways, but the conclusion is one. A bot serves in games as a substitute for a real person, usually a weak opponent. Thus, we will always want to play with a more serious opponent. And maybe even a partner who is "not stupid."
Tactical maneuvers
Intelligence is a classic trick, seeing the enemy, the bot opens fire, unaware that there may be another enemy nearby. Or there is an opportunity to bypass from the rear. In what way? We look at the picture below ... Of course, this is a complicated trick, considering that he remembers the location of the standing opponent No. 1, after which he goes further and remembers the location of the opponent No. 2. But to be such a reception, no one forbade.
The cat is always on the lookout, even when he sleeps, even when he thinks he is sleeping.
Fig. 8 Tactical maneuvers
Morale - if he had a bot, he would have said this: “I am alone, I'm scared, we are many, we will win all. I am alone and I have a machine gun, I am Jon Jay Rambo! ”
Collective mode - it was always interesting, why when shooting a real player, his partner runs to help, and the bot does not? Yes, because they are autonomous from each other. Why not make them collective? It is not necessary to go around the whole company, for example, a lonely bot, having met the same bot, starts to stick closer to it. If a lone bot meets the company of his comrades, it means everything, the team is assembled. So it makes no sense to run around the crowd. Hence the conclusion that this same bot will bypass from the rear, while his team makes an attack on the enemy from the front. I think everything is clear.
Again, in the collective mode, morale rises, and they can actually go to the breach, rather than one by one.

Fig. 9 Bait
A cat like James Bond, always alone, sometimes with pussies.Bait - even if there is no collective mode, the bot can “bother” the player with bait. The principle is as follows: -> got wounded -> moved back (to the side). In case there is a collective mode, the bot's friends may be nearby, who will be waiting for him or just be nearby. The player following the bot will be baited. If there are no partners, then the bot is just a TROLLO.
Tasks and subtasks.
And finally, classic bots have only two modes - the main task (to go to the goal), the task is additional (to bypass obstacles). I do not take into account the shooting. Because this is not a task, but a method.
If you expand the tasks and subtasks, the bot will cease to be so predictable, will cease to be a bot;)
PS: The implementation of all the examples in the code is another question.
PS 2.: I hope my method of explanation is clear to everyone.