Page 1 of 1

Counting allies

Posted: 29 Nov 2018, 14:49
by M4L4
pretty technical question, i'll try to be as clear as possible:

I'm making a counter to check differences between points, bots carrying resources, resources left etc.
example:

"set Team counter E to my score"
"increment Team counter E with Allies carrying resources"
"Decrease Team counter E with enemy score"
etc......

since every bot get checked in a precise order every tick (as far as i've understood), they will make the same calculation one by one.
The algorithm starts wit "set" so each bot will overwrite previous bot calculation, till the last one.

What if the last one is the one carrying the resource? will it still add the "allies carrying resource" to the count? does it count itself as an allies carrying resources?
is my understanding of ticks/bots mechanics correct?

Re: Counting allies

Posted: 29 Nov 2018, 15:31
by Hairy Phil
No, bots don't count themselves as allies. For example, if all 4 of your bots were carrying resources, then allies carrying resources would return 3.

Re: Counting allies

Posted: 29 Nov 2018, 16:23
by M4L4
Hairy Phil wrote:No, bots don't count themselves as allies. For example, if all 4 of your bots were carrying resources, then allies carrying resources would return 3.


thanks alot.
so an "if myself carrying res true" >> "increase counter by 1" should do the trick.

edit.
i could also use both "increase with allies carrying" and "increase with myself carrying"

Re: Counting allies

Posted: 29 Nov 2018, 16:29
by Hairy Phil
Exactly.