reset password
Author Message
rabbott
Posts: 1649
Posted 23:40 May 12, 2012 |

Determining which ants are in which battles takes a bit of work.

 

A battle can be defined as a collection of ants all of which potentially

interact. It is not required that every ant interact with every ant on the

other team, only that if an ant interacts with an ant on the other team

the two of them are in the same battle. The implication of this is that

you have to consider chains of interaction, e.g., my ant A interacts with

ant B, which is not my ant. But B interacts with my ant C. All three

ants are in a single battle. Of course if C interacts with another ant D

that one is in the same battle also.

 

By interact I mean the following. Two ants interact if if it possible

for them to move in such a way that they will be within the attack radius

of each other. It's not necessary that they start within the attack radius,

only that there is a way for them to move into range of each other if each

moves in the right (or wrong) way.

 

I'd like you all to develop code to identify the battle groupings and be

prepared to talk about it next Saturday.  

 

This will give you a start on your combat code.

 

An alternative to this assignment is to read and understand Influence Maps and

write code that evaluates all moves on the basis of influence maps and combat

interactions. If you take this approach be prepared to explain why identifying

individual battles as above isn't necessary. In this case be prepared to discuss

your overall move evaluation strategy.

rabbott
Posts: 1649
Posted 11:32 May 13, 2012 |

I just ran this test case on my version of identifying battles. I set the attackRadius2 to be 5, which is the standard.

I put my ants at: (0, 0), (0, 2), (0, 4), and (0, 8)

and

enemy ants at (1, 1) and (1, 8)

 

Each battle is identified by the ants (mine and enemy) in it.  Two battles were identified

 

My ants: [(0, 0), (0, 2), (0, 4)]
Enemy ants: [(1, 1)]
 
and
 
My ants: [(0, 8)]
Enemy ants: [(1, 8)]
 
 
In the first battle the enemy ant at (1, 1) is within the attackRadius2 of my ants
at (0, 0) and (0, 2). It is not within the attackRadius2 of my ant at (0, 4). But if
either of those two ants moves toward the other by one step, e.g., my ant moves from
(0, 4) to (0, 3) the two will be within attackRadius2 of each other. Therefore they should
be included in a battle together.
 
Your code for identifying battles should do something similar.
srportnoff
Posts: 12
Posted 11:53 May 18, 2012 |

At the start of each turn, my bot is given a list of myAnts and a list of enemyAnts.

However, I see no way to distinguish among enemyAnts in a game that has 3 or more players.

Suppose that I have 2 myAnts and 2 enemyAnts all within attackRadius of one another.  If the 2 enemyAnts belong to the same bot, all 4 ants will die, correct?  However, if the 2 enemyAnts are each from different bots, then each of them is looking at 3 enemies, while myAnts are only looking at 2 enemies - therefore my 2 myAnts will survive and the 2 enemyAnts will die.  Again, is this a correct reading?

So if I have no way to distinguish among the different teams of enemyAnts, how can I possibly evaluate this situation?

rabbott
Posts: 1649
Posted 12:31 May 18, 2012 |

I believe your descriptions are right.  I have been making the simplifying assumption that all enemies are from the same team.

To do the complete analysis you can use the information that comes from the engine.  Each hill and each ant has a number associated with it.  Zero is for your hills and ants. Higher number are for different enemies. I haven't made use of this but I believe each enemy is identified with its own number. I don't know if the numbers are consistent from one turn to the next. See http://aichallenge.org/specification.php#Bot-Input for details.

mvalenc3
Posts: 4
Posted 14:03 May 18, 2012 |

The ants are identified by a number that corresponds to the order in which they appear in the play game command. so all the ants for bot 0 (the first bot in the play game command) are identified by the coordinate location followed by 0 and the same goes for all the others.

ex)

a 0 5 0 (bot 0 ant at 0,5 )
a 2 5 1 (bot 1 ant at 1,5 )
a 4 5 2 (bot 2 ant at 2,5 )
srportnoff
Posts: 12
Posted 22:51 May 18, 2012 |
What's your testing mechanism, i.e. how did you test your code using those exact locations?
 
 
rabbott wrote:

I just ran this test case on my version of identifying battles. I set the attackRadius2 to be 5, which is the standard.

I put my ants at: (0, 0), (0, 2), (0, 4), and (0, 8)

and

enemy ants at (1, 1) and (1, 8)

 

mvalenc3
Posts: 4
Posted 22:59 May 18, 2012 |

it goes by alphabetical order with the first bot being A the second B and so on. so if you want an ant at any specific location you can edit the map location and you a lowercase letter corresponding ant you want. so if you are bot A ie the first bot you would put an "a" at that specific location