I tryam trying to make a simple rts typereal-time strategy game (only the battle system which makeof units fightfighting each other ,noother; no building , no economiceconomy,only fight only battles and endvictory) and. I use flowfiledam using flow fields to make the unitunits move.I
I don't know how to make the AI behaviortake the right actions when I finish the move, There iacompleting a game funcmove.
For example , I have a rangeranged unit,his its behavior is keepingshould move to its firing distance withfrom the enemy and stop ( or rotate with target likeor orbit/strafe in a circle patharound the enemy) and attack the enemy. But in my current code, but hethe ranged unit just followfollows the flow filedfield to move close to the enemy,.
I don't know how to make it flee from the enemy until it gets to its attack range.
There is a way is recreate the flowfiledsflow fields to the flee pos fordirect the unit to its flee positions from an enemy, but there are many rangeranged units, and their enemy is same ,. I don't know is thatif it's right to create many flowfiledsflow fields for the units which hashave the same target.
I can't find a solution for this condition,I I want my AI to the ai could bebehave more freefreely and not only follow the flowfiledsflow fields.