glest / glest-source

Glest is a network multi-player cross-platform 3D real-time strategy (RTS) game, where you create armies of units and battle different factions.
https://glest.io
GNU General Public License v3.0
57 stars 39 forks source link

AI should prioritize attacking units, not buildings #54

Open andy5995 opened 6 years ago

andy5995 commented 6 years ago

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.

VishalRocks commented 6 years ago

Can I take this up?

andy5995 commented 6 years ago

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

biels commented 6 years ago

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" notifications@github.com 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 .

andy5995 commented 6 years ago

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