It is currently Sat Jul 11, 2020 4:41 pm Advanced search

This is my bot

Share and discuss ideas for your entries here.

This is my bot

Postby itzkow » Wed Dec 14, 2011 9:08 pm

there are many like it but this one is mine

I read some topics here and got some ideas so i thought i should share as well

I believe his level is about top 20 but hopefully tomorrow i will add some fixed and get even further :)

Early in the development of my bot I made a decision to go for the following strategy:

BFSing on all the my ants simultaneously, while deciding after each BFS step which ant should continue to BFS and which shouldn't (meaning the ant found its destination point).

Destination point could be one of the following: food, enemy hill, unexplored area and "dangerous" enemy ant

If an ant had found food I remove it from all the other ants so that only one ant goes for one food

If an ant found unexplored point, I mark the area as explored so that not many ant will go to the same location

"dangerous" enemy ant is an ant which is surrounded by more at least two of my ants, (I do this cause it may be a weak ant and may be killed!)
I also decided that no more than two ants will have its destination on a single enemy ant (that's because I don't want too many ants attacking one ant)

There are many downsides to this method, one of them is that I don't have priorities for different "targets", if an ant is 2 steps away from food and three steps away from an enemy hill, it will chooses the closest target which is food.

The combat is quite easy to explain, I just use minimax (I break the ants to groups so that no group has more then 7 ants total).
I also use alpha beta pruning to reduce calculation time (more like alpha pruning since its only one minimax step)
This combat method also has downsides, my bot is very passive and goes forward only when he believes he won't die!
This resulted a funny game of my bot not beating a 2000# rank bot :P

fun fact about the bot is that its more than 1000 lines of code, I wonder how many lines of code are other bots

Suggestions on improving my bot in the last minute would be nice :)
Posts: 7
Joined: Wed Dec 14, 2011 8:27 pm

Re: This is my bot

Postby McLeopold » Wed Dec 14, 2011 10:59 pm

What is your performance like when you have a lot of ants?
Contest Organizer
Posts: 262
Joined: Sun Sep 19, 2010 3:31 am

Re: This is my bot

Postby Memetix » Thu Dec 15, 2011 12:37 pm

Thanks for sharing .... I hadn't thought about doing it that way. As it turns out you've used the inverse of my approach, I run the BFS from the points of interest (food, unexplored, enemies etc.) and stop when I reach a given number of my ants.

Good luck ....
Posts: 39
Joined: Tue Nov 08, 2011 3:53 pm

Re: This is my bot

Postby ferchoman » Thu Dec 15, 2011 3:38 pm

Hi Bro,
You have a good bot.
Much thanks for share it.
Posts: 17
Joined: Wed Nov 09, 2011 4:29 pm

Re: This is my bot

Postby agent_smith » Thu Dec 15, 2011 5:24 pm

Yesterday 20th, today 11th, nothing to be sneered at. Strange that the combat algorithm couldn't deal with those last three ants.

I don't do BFS, but I believe it's more efficient to run it from points of interest, as in any given time there's probably less points of interest than own ants.

My bot, if you take out blank lines and comments, is probably about the same size.
Posts: 54
Joined: Mon Nov 28, 2011 2:28 pm

Re: This is my bot

Postby itzkow » Thu Dec 15, 2011 10:17 pm

I first started coding my bot with python but then switched to c++ for performance reasons..
that's why I find it very admirable that many top bots use slow languages
Posts: 7
Joined: Wed Dec 14, 2011 8:27 pm

Return to Strategy

Who is online

Users browsing this forum: No registered users and 3 guests