My game is a simple 2D plane with 2D units, an intro on the mechanics, There are two groups of units one will be called Attackers that have hero-like stats that is limited to 4 units only per game/map. the other one the defenders which will be like mob units not limited to any number of units can be 10 to 15 units per game/map, Imagine a kingdom rush tower defense style of gameplay without the towers for the attacking units to the defending units, in this case, the player can only influence the game by healing or activating the skills of the attackers, while the attackers move and behave as an AI on a Tower defense, My first problem is I am having trouble on how would I design the behavior of the attackers and behavior of the defenders in relation to the attackers. so my question is what are the best practices for designing AI behaviors with all of the given specifications. for example, the 4 units of the attackers first met 3 units of defenders for the first battle in the game/map, My first thought is all units will only attack 1 to 1 if all are occupied and there is an extra it will attack the nearby units thus creating a 2 to 1. My question on this is what are the best coding practices on how to execute this scenario in a script. Btw, it would really great to have a more detailed answer and think of this as me learning good coding or designing practices. Lastly, this is my first question in this forum I am not sure if this is the best place to ask this question.