glest-source icon indicating copy to clipboard operation
glest-source copied to clipboard

AI should prioritize attacking units, not buildings

Open andy5995 opened this issue 7 years ago • 4 comments

AI units should not attack a totem, for example, while it's being attacked by an enemy. If AI units are being attacked by units (mobile or otherwise), it should attack those first, and then attack buildings and other units.

This would be one step to making the AI smarter.

andy5995 avatar Feb 11 '18 10:02 andy5995

Can I take this up?

VishalRocks avatar Mar 13 '18 16:03 VishalRocks

Yes, and if you do, join our Discord channel https://discord.gg/WaAaXS7

andy5995 avatar Mar 13 '18 19:03 andy5995

I would go one step further and target units that have the best score calculated as follows: EnemyAttackDamageEnemyAttackSpeedEnemySplashRadius / (EnemyRemainingHealth*EffectiveDamageMultiplier + 1)

This "heuristic" can be improved a lot but I think it is a great place to start since it is quite easy to calculate.

For example not taking into account splash radius if we don't have ally units close to us, not targeting units that are already going to die and slightly biasing the formula towards attacking units that are further so we make better use of our range. Also maybe we can calculate if we are going to miss all the time by looking at the projectile speed and enemy movement speed and lower its value so we only attack it if we have nothing better to do and hope it stops or does a sharp turn.

On Mar 13, 2018 8:11 PM, "Andy Alt" [email protected] wrote:

Yes, and if you do, join our Discord channel https://discord.gg/WaAaXS7

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ZetaGlest/zetaglest-source/issues/54#issuecomment-372784655, or mute the thread https://github.com/notifications/unsubscribe-auth/AE64MMbxjRYalUvUnF5Zy-xqM0GugUcKks5teBnygaJpZM4SBSmE .

biels avatar Mar 13 '18 20:03 biels

Yeah, that's a good idea, but it needs to be in a separate ticket.

andy5995 avatar Mar 13 '18 21:03 andy5995