Here is a little peak at some of the code for the AI in TAHC2. This event allows a soldier to check for line of sight to all the enemies within an arc of vision and within a range and then target the closest enemy within that range.
It will save internally the ID value of its target enemy, as well as its coordinates and range. By adding a few MORE conditions, I should be able to let each soldier know how many allies are nearby relative to enemies and then make a fight or flight decision.
Any ideas for more AI features?
|
|