Our objective was to design and code a bot for Code Ruler. The strategy I decided to use involved a commonly used AI technique where scores are given for various conditions and moves are decided to achieve the highest score. Many specifics are used for scoring including proximity to enemies and allies. Although the 0.5 second per turn timer limited my look-ahead capabilities, the bot performs quite well. The details of my implementation are available in the javadoc generated from my code. The zip containing my source file and javadocs is available Here.
The scores for the test runs versus the sample bots are as follows:
Game 1: bkarsin VS Split Us
bkarsin wins 823 to 60
Game 2: bkarsin VS Gang Up
bkarsin wins 780 to 172
Game 3: bkarsin VS Migrate
bkarsin wins 831 to 0
Game 4: 4 team free for all!
bkarsin: 1112
Smart Split Up: 120
Capture Castle: 112
Gang Up: 56
The rest of my runs are available in the javadocs.
It is clear from these results that my bot performs rather well when faced with these very simple samples. Hopefully it will do well in the tournament as well.
What I Learned:
Since I have previously done some AI work and enjoy it, I got to practice some of those skills. I had never heard of CodeRuler prior to this class so I had to learn all the rules and strategies. I enjoyed the designing the program and strategy for this project. Any practice with games and code is always useful.
I became much more comfortable with Eclipse and Java just in this exercise. This was a good refresher for Java syntax. My first time using javadocs took a little while but I now see how to use it and how useful it can be. I think my code is much more readable and well structured because of this simple tool.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment