How to count enemies ?

User avatar
TheGnoo
Automaton
Automaton
Posts: 175

How to count enemies ?

Post#1 » 16 May 2017, 01:02

Hello people,

I finally got BotTags and TeamTags (it's like my whole life has been a lie before) and I tried to develop an algorithm which counts the nearby enemies, and another one which counts the number of enemies attacking my bot.
The problem is that it takes too long. Whenever an enemy stops/starts attacking, my algo needs at least 0,5 second to count and I get rekt because of this, instead of getting an advantage.

So I wanted to know, do you guys count ?
I'm sure you all have secrets AIs and I don't want you to share it of course, but I'm really curious to know if there is an effective way to count.

TheKidPunisher
Autonomous Entity
Autonomous Entity
Posts: 565

Re: How to count enemies ?

Post#2 » 16 May 2017, 05:20

Normal that it take a long time. It is like counting sheeps: 1bot,2bots,3...bots...,4..bo...zzzzzz

User avatar
Kanishka
Skynet
Skynet
Posts: 1421
Contact:

Re: How to count enemies ?

Post#3 » 16 May 2017, 08:55

TheKidPunisher wrote:Normal that it take a long time. It is like counting sheeps: 1bot,2bots,3...bots...,4..bo...zzzzzz


This.
Fixes break an AI more than bugs do. :ugeek:

Gladiabots Off-Topic Chat


My Stats: Kanishka_RN3;Kanishka_MiPad

pier4r
Skynet
Skynet
Posts: 3390

Re: How to count enemies ?

Post#4 » 16 May 2017, 09:54

TheGnoo wrote:
So I wanted to know, do you guys count ?
I'm sure you all have secrets AIs and I don't want you to share it of course, but I'm really curious to know if there is an effective way to count.


As far as I know not everyone shares , but there are many useful tips already shared in the forum (see my signature) and even more on the telegram chat (but there searching is more difficult).

Sharing helps growing the level although the fun is to find out on your own.

Tags as you discovered are costly (and all those that whine 'I'm without tags!' do not recognize this, until they have it and get even more rekt than before due to overusage).

Normally the suggested approach is to set them at the start of the match when the position is away from the enemy (it still will slow down your bots) and then don't remove them, except for special cases.

I count assaults (up to 3) at the start of the match but I use this information in very few cases. Normally when 2 assaults are around it is already enough to say "hmm, not so great". Of course other players have 1vs1 , 2vs2 modules or even scouting to find weak points in the enemy formation but, well, I'm too lazy for that.
Last edited by pier4r on 16 May 2017, 23:36, edited 2 times in total.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
TheGnoo
Automaton
Automaton
Posts: 175

Re: How to count enemies ?

Post#5 » 16 May 2017, 16:30

Thanks for the information @pier4r !

I will try to count at the beginning of the game and see if this improves my score.
Also, I thought about naming a "captain" in my team who could take more time to count, I suppose many people already tried it but I want to make sure I'm not missing anything.

@TheKidPunisher, :D I never met you in a match but be sure that my bots won't sleep when it will come to beat your a** ! *shows bionic muscles* ;)

User avatar
Gimric
Script
Script
Posts: 24
Contact:

Re: How to count enemies ?

Post#6 » 17 May 2017, 11:23

Hi! It's not clear to me why one should COUNT enemies. In the beginning the amount of ally bots is identical to enemy bots. You can easily check if more than one enemy is attacking self (and in this 'fleeing moment' the exact number of self-attacking enemies seems slightly irrelevant). Furthermore you can easily check if there is any existing enemy at short range (up to 'out of range'). The only thing I could imagine counting enemies (and allies) makes sense is, that one can change tactics when not longer fight 5 vs. 5 but 3 vs. 5.
Am I right?
I got a new sensation
In perfect moments
Impossible to refuse
INXS

TheKidPunisher
Autonomous Entity
Autonomous Entity
Posts: 565

Re: How to count enemies ?

Post#7 » 17 May 2017, 12:21

I am soory to say thay if you are in 3v5, you already lose (or maybe draw if you plau the time in best score maps)

Count ennemy around can save your bot. It is all i can say. I think it is better to find by your own, if you need or not to count ennemy to understand the way it used for.


By the way i prefer «devil inside» of INXS but new sensation is good too.

pier4r
Skynet
Skynet
Posts: 3390

Re: How to count enemies ?

Post#8 » 17 May 2017, 15:52

Gimric wrote:The only thing I could imagine counting enemies (and allies) makes sense is, that one can change tactics when not longer fight 5 vs. 5 but 3 vs. 5.
Am I right?


What is important, for me, it is not to change tactics (although possible), it is to retreat in time so not to lose a bot. When one is one bot down, the game is mostly lost.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

User avatar
Gimric
Script
Script
Posts: 24
Contact:

Re: How to count enemies ?

Post#9 » 18 May 2017, 16:24

@TheKidPunisher: thank you.
I very love the light-flooded lyrics of "New sensation". :)

@ pier4r: thank you, sounds legit. Without counting it is like early WW II-radar... But in the moment I try hard to keep my head above water.
I got a new sensation
In perfect moments
Impossible to refuse
INXS

sollniss
Automaton
Automaton
Posts: 178

Re: How to count enemies ?

Post#10 » 20 May 2017, 23:17

TheKidPunisher wrote:I am soory to say thay if you are in 3v5, you already lose (or maybe draw if you plau the time in best score maps)


But if I'm in a 5v3 I can change my strategy to kill you even faster.

Besides that I think bot count is essential to make a good AI. You could make groups ("if at least two allies nearby") or get a clearer picture of the battlefield (one enemy in mid and no enemies in long range and one ally in range? kill that fucker).

Detecting 1v1s or 2v2 would also not require 5 billion nodes instead.

Also counting would also be a death sentence to all "assault only" AIs. :)

pier4r
Skynet
Skynet
Posts: 3390

Re: How to count enemies ?

Post#11 » 20 May 2017, 23:34

yes I do believe that counting for tactical operations can be pretty useful, but one has to be dedicated. I'm too lazy.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

forReason
Script
Script
Posts: 17

Re: How to count enemies ?

Post#12 » 22 May 2017, 12:34

I have an generic ai and am getting to grandmaster soon.

this is an simplified way of counting enemies.

in this case: if less than 2 enemies are left, do sth. you can, of course extend that to more tags but one keypoint is you want to have your kis as simple and effective as possible.
If this simple version is not enough for you and/or you really need the teamtags for different things you can can count binary up to 7 with 3 teamtags but it takes time... so only do that when you got nothing better todo (never)

Image

User avatar
Bombafat
Script
Script
Posts: 40

Re: How to count enemies ?

Post#13 » 22 May 2017, 15:52

I think it is not needed to teamtag special bots since each side can only have one of them each and this means you can work with "bot class" in the filters for your conditions/actions. This means you can use your teamtags for other stuff. Or do I miss something here?

TheKidPunisher
Autonomous Entity
Autonomous Entity
Posts: 565

Re: How to count enemies ?

Post#14 » 22 May 2017, 15:54

forReason wrote:I have an generic ai and am getting to grandmaster soon.


Congratulation for getting in GM league.

No bombafat,i do not tagg specialbot and it seems work as well as if they were tagged.

pier4r
Skynet
Skynet
Posts: 3390

Re: How to count enemies ?

Post#15 » 22 May 2017, 16:00

when you get in GM, for reasons, prepare yourself to have a "warm" welcome.
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

sollniss
Automaton
Automaton
Posts: 178

Re: How to count enemies ?

Post#16 » 22 May 2017, 16:04

Here is how to count properly. I find it useless since it costs too much time.

I made this ages ago and only tested it a few seconds, it seemed to tag properly though.

Edit: Oh yea, I remembered that the last few nodes are wrong so it can only count a certain number and then tagging becomes buggy. It seems to work for all current maps though, unless someone goes all assaults.
Attachments
Unbenannt.PNG
Unbenannt.PNG (81.25 KiB) Viewed 3080 times

forReason
Script
Script
Posts: 17

Re: How to count enemies ?

Post#17 » 22 May 2017, 17:08

@Bombafat im not marking special enemies in this case. in this case im assigning task "E" to an ally that fits the task best.

well GM is pretty fun. At first i thought ill fall down (only fighting vs 2000+) but its pretty nice. actually my bots were doing better before i tried to create an answer to more sophisticated tactics (dancing etc) -.-

Edit:
@bombafat thx for this tip i think i understood what you want to say. lets see if i can do it without tagging.
the question im facing is: in this case my squadleader finds situation X occurring and assigns one gatherer by tagging him. Without tags where should my team know from who actually is gatherer? this is why I assign him over a squadleader

pier4r
Skynet
Skynet
Posts: 3390

Re: How to count enemies ?

Post#18 » 22 May 2017, 19:35

@sollniss some part of the tree is missing, moreover the filters are not so clear sometimes (I don't get if there is a not _filter_ or it is just me). Could you explain it in words or code?
http://www.reddit.com/r/Gladiabots/wiki/players/pier4r_nvidia_shield_k1 -> Gladiabots CHAT, stats, insights and more ;

sollniss
Automaton
Automaton
Posts: 178

Re: How to count enemies ?

Post#19 » 23 May 2017, 14:07

pier4r wrote:@sollniss some part of the tree is missing, moreover the filters are not so clear sometimes (I don't get if there is a not _filter_ or it is just me). Could you explain it in words or code?


The line that goes out is that same line that connects the lonely bottom node, technically it would continnue there counting from AE onward (if the nodes before that would be correct, that is).

Here how it works:

Code: Select all

If there is an Assault that is not tagged with either A,B,C,D,E
    If there is an Assault tagged A and E
       // handle BA - BE here

    If there is an Assault tagged E
        If there is no Assault tagged A and not tagged with either B,C,D,E
            Tag A (closest Assault that is not tagged with either A,B,C,D,E)
        If there is an Assault that is tagged with A and D
            Tag E (Assault that is tagged with A)
        If there is an Assault that is tagged with A and C
            Tag D (Assault that is tagged with A)
        If there is an Assault that is tagged with A and B
            Tag C (Assault that is tagged with A)
        If there is an Assault that is tagged with A
            Tag B (Assault that is tagged with A)

    If there is an Assault tagged D
        Tag E (closest Assault that is not tagged with either A,B,C,D)
    If there is an Assault tagged C
        Tag D (closest Assault that is not tagged with either A,B,C)
    If there is an Assault tagged B
        Tag C (closest Assault that is not tagged with either A,B)
    If there is an Assault tagged A
        Tag B (closest Assault that is not tagged A)
    If there is no Assault tagged A
        Tag A (closest Assault)
   


Let's run it through a bit:
If there is no Assault tagged A -> Tag A (current: A)
If there is an Assault tagged A -> Tag B (current: A,B)
If there is an Assault tagged B -> Tag C (current: A,B,C)
If there is an Assault tagged C -> Tag D (current: A,B,C,D)
If there is an Assault tagged D -> Tag E (current: A,B,C,D,E)
If there is an Assault that is tagged with A -> Tab AB (current: B,C,D,E,AB)
If there is no Assault tagged A and not tagged with either B,C,D,E -> Tag A (current: A,B,C,D,E,AB)
If there is an Assault that is tagged with A and B -> Tag AC (current: B,C,D,E,AB,AC)
If there is no Assault tagged A and not tagged with either B,C,D,E -> Tag A (current: A,B,C,D,E,AB,AC)
If there is an Assault that is tagged with A and C -> Tag AD (current: B,C,D,E,AB,AC,AD)
If there is no Assault tagged A and not tagged with either B,C,D,E -> Tag A (current: A,B,C,D,E,AB,AC,AD)
If there is an Assault that is tagged with A and D -> Tag AE (current: B,C,D,E,AB,AC,AD,AE)
If there is no Assault tagged A and not tagged with either B,C,D,E -> Tag A (current: A,B,C,D,E,AB,AC,AD,AE)

And now it breaks because it tags everything A with
If there is no Assault tagged A and not tagged with either B,C,D,E and then messes up everything.

At least thats how it should work, there could be bugs.

I'm not going to try to improve this because it is not really useful to me. I just screenshotted what I did ages ago to give someone a good basis to start with.


Edit: oh yea, the Tagging operators are wrong in the E routine. It just tags a random A. If we add conditions it should work:

Tag B (Assault that is Tagged A and not either of B,C,D,E)
etc.

Blue_Lucario
Hello World
Hello World
Posts: 5

Re: How to count enemies ?

Post#20 » 09 Jun 2017, 00:29

I only use:
If I am not attacking any attacking self enemy.
Then
I should think about backing up.

This way my bots will fight one on one but not if they are getting ganged.

Return to “Strategies”

Who is online

Users browsing this forum: No registered users and 2 guests