Page 1 of 1

Adaptive Shield Reliance

Posted: 27 Aug 2018, 07:59
by Draloric
My beginner strategy is quite basic, I have a machine gun, sometimes a sniper and rest is Assault. The problem is that sometimes a unit would end up in a 1v1 vs. another unit of the same type. They would both stop and shoot then one would disengage (mine mostly) and then take a few steps while shield regens then they go back at it. I could have dropped the shield % before retreating, which would have allowed my units to stand their ground alot better, but in bad matchups this would lead to already weakened bots to overexert their sheilds and wind up dead. So I introduce to you: The adaptive shield reliance AI (or SmartRetreat)
Capture.PNG
Capture.PNG (161.29 KiB) Viewed 1306 times


If you have trouble reading that (As do I), essentially it checks that it is actually under fire (no point retreating if it isn't) then it splits into the 3 supported bot classes: Sniper on left, which always retreats if it has <75% shield, machine gun in the middle, which retreats at 25% shield when HP is 75% or less, then 50% shield when HP is 50% or less then 75% shield when HP is 25% or less. This has the effect that when the bot is more damaged it is much more cautious and therefore less likely to take additional damage, while simultaneously standing it's ground as much as possible. The assault retreats at 50% shield when HP is >50% and at 75% shield when HP is < 50%.

It is mostly built for assault and machine guns, in fact there is not support for Shotguns at all in this version. I just got the game literally about 12 hours ago but this bit of code has greatly improved my combat. Let me know what you think about my version or any problems, and also do you use a similar block of code as well or do you have some other strategy to decide when to retreat?

Re: Adaptive Shield Reliance

Posted: 27 Aug 2018, 09:26
by ElvenMonk
You can improve it by taking into account how many enemies and from what range attack your bot.
Also health is something you shouldn't give up that easy.
I have 2 modes for each class:
- normal: try not to lose health
- low health: don't ever take a risk

Re: Adaptive Shield Reliance

Posted: 27 Aug 2018, 09:43
by Hairy Phil
Regarding 1v1 fights, did you notice the other simple filter that you can use to decide whether to retreat, "if enemy has higher/lower/same health+shield as me".

Re: Adaptive Shield Reliance

Posted: 30 Aug 2018, 10:05
by Den
realy impressive.
I've just test it in my new AI (with some modification to the result choice) and it's helping me to go in platinium league !

So it's working ^^

Re: Adaptive Shield Reliance

Posted: 30 Aug 2018, 15:25
by sollniss
I have a 1v1 engine that handles every matchup.

Re: Adaptive Shield Reliance

Posted: 25 Sep 2018, 21:50
by DjSapsan
dont forget about counting ticks!

Re: Adaptive Shield Reliance

Posted: 01 Oct 2018, 00:43
by VNavigator
DjSapsan wrote:dont forget about counting ticks!


I understand the idea of "lost" ticks during tagging, for example, but I don't understand how ticks matter in this case?

Re: Adaptive Shield Reliance

Posted: 01 Oct 2018, 17:30
by Jeffrey Harpen
VNavigator wrote:
DjSapsan wrote:dont forget about counting ticks!

I understand the idea of "lost" ticks during tagging, for example, but I don't understand how ticks matter in this case?

Some advanced players count ticks between moment enemy bot starts aiming and moment it actually fires. This way some of the bots know how much time they have till enemy starts shooting and they can start fleeing later, saving some time for other actions like attacking. It can be useful especially against bots with long aiming time (sniper, machine gun).