To get units avoid the enemy units by a safe margin I have to bake the enemy units LOS into the obstacle map. First I'm saving the LOS of each unit into a separate layer. Then I'm merging all the layers and save the result into the obstacle map. Ranged units can attack workers from distance. I'm …
I managed to get attacking units avoid defenses. For now it's just one attacking unit that does that. In the video you can see how the red attacking unit travels towards the enemy half of the map notices the units that guard the entrance, turns back and choses another path to the enemy base.
With sincronisation probem solved I can now begin to work towards making the Red Player attack the White Player workers while avoiding enemy defenses. It's supposed to be a dynamic thing, if the White Player workers move/take cover behind White Player combat units Red Player units should find a way…
https://youtube.com/shorts/ZsybqKbYBLQ?feature=share
I'm describing what's in the video. I have a second map with a third player on it. White and Red players are building bases. On the second map Yellow player is building a base as well. White and Yellow players build archers. Whit…
A short video first, shows my progress
https://youtube.com/shorts/rwoxEuEsGlI?feature=share
I started working on making ranged units pick positions good for defending.
[edit]
The work on the making ranged units hide behind obstacles is completed
The code looks like the following:
case AISM::RunTestPa…
I managed to get two sides building bases and attack each other (or one side attack the other to be more exact). Which brings the following question to my mind. If you have a perfectly symetrical map with the two opposing AI players starting at the ends they will evolve identically and when it's ti…
Player 3 helps keep track of Player 2.
If Player 1 don't scout Player 3 is not going to tell Player 1 where the enemy units are but it will tell him the type and number of enemy units.
If Player 1 visits Player 2 base while there are no (Player 2) combat units there, if Player 2 combat un…
I have two state machines. They are pretty much the same. I have two AI players. One state machine for each player. The state machines are for base building.
I have three maps. One map for AI player 1 and one map for AI player 2.
Because the state machines are identical the base building takes …
Making AI player tanks chose high ground when defending base.
Find a path with the start point the enemy base and the end your base. This will be the attack path of the enemy. For every node in the attack path of the enemy run the pathfinding algorithm to nearby tiles. Lets call the resulting paths …