by dutchflyboy » Sun Feb 28, 2010 10:45 am
As everyone is sending in his bot, here's mine. It has gotten in the top 10 once (just after upload, but still, great feeling). The rest of the time it floated between 50-100 (EDIT: in final ranking: 81st).
Short description:
- Bot can be in three states, "Hunt", "Eat" and "Survive" (I wasn't very inspired the day I wrote the skeleton).
- Hunt is when the bots are far away and the minimax encourages getting near to the enemy without wasting space
- Eat is at short distances (when minimax gets deep enough to make a valid strategy) and the evaluation function only considers squares. In both cases (Hunt and Eat) tie-brakes are done by trying to stay in a straight line, if this isn't possible, with a random number (add some variance).
- The survive function was a maxmax algorithm (I don't know how it should be called, it's minimax while ignoring the enemy) which tried to maximize the available space and tried to stick to walls (1 wall touched = 1/5 square, so it's only used as tie brake).
- The square count algorithm is a simple counter with a queue that counts all but one dead-end. No other optimizations where added. No pruning either (I tried adding alpha-beta, but it didn't add any speed improvement, so I probably did something wrong in the implementation).
- Attachments
-
StateBot.zip
- C# bot
- (10.29 KiB) Downloaded 203 times
Last edited by
dutchflyboy on Mon Mar 01, 2010 10:03 pm, edited 1 time in total.