CodeRuler is an application provided by IBM <LINK> where one is challenged to create the best possible ruler using Java programming. The game premise is simple: you must battle other rulers for land and dominance. For each game you start off with one castle, ten knights, and ten peasants. You get points for claiming land and capturing other ruler's things.
Team Members: Tyler Wolff
Daniel Tian
For this project I worked with Daniel Tian. He and I consulted a lot about what our strategy was going to be and it was ever evolving. We started with the basic code given on the IBM site and initially decided to optimize some basic things:
- Command our castles to create more knights when knight count is low
- Program our peasants to capture land more effectively
- Program our knights to go after the closest enemy (other knight/castle) immediately in a large group. After all are gone, go after other peasants.
What we eventually created did in fact do all these things and more. However, we basically threw out all of the start up code from the IBM site and put in our own codes. We programmed out very efficient peasants who are constantly claiming new lands. We programmed intelligent castles to create what's needed most. Probably the most efficient thing we programmed was the knights. What the knights do is basically gang up on the nearest enemy, be it another enemy knight or castle. Normally it can take them all out. Then it goes for the left over peasants. More details can be found in the code javadoc. The source code and javadocs for our implementation can be found here [tylerwolff-daniel.f.tian.zip].
Evaluation Results
Opponent Name | Opponent Score | twolff-daniel.f.tian score | Winner |
Split Up Ruler | 70 | 788 | twolff-daniel.f.tian |
split Up Ruler | 86 | 797 | twolff-daniel.f.tian |
Split Up Ruler | 58 | 801 | twolff-daniel.f.tian |
Migrate Ruler | 0 | 864 | twolff-daniel.f.tian |
Migrate Ruler | 0 | 814 | twolff-daniel.f.tian |
Migrate Ruler | 0 | 639 | twolff-daniel.f.tian |
Gang Up Ruler | 84 | 712 | twolff-daniel.f.tian |
Gang Up Ruler | 133 | 739 | twolff-daniel.f.tian |
Gang Up Ruler | 60 | 809 | twolff-daniel.f.tian |
As shown above, our ruler does super good against all of the built in sample rulers. It will always beat them in a one on one game. The hardest sample ruler, 'smart split up ruler' will always loses to our ruler. Even in a 6 player free for all match our ruler wins 70% of the time. What I found to be the hardest part in winning was making the 0.5 second time restraint per turn. If at any moment a turn took longer than that, our guys would freeze up due to a disqualification. I figured this had to do a little with my computer speed (2GHz intel core duo) since it almost always ran fine on Daniel's computer. When this didn't happen, it almost always ran smoothly and efficient.
Lessons Learned
Overall, working on this CodeRuler project was very new and insightful for me. On the one hand it dealt with gaming strategies, something I've never really been exposed to much. I tried my best to think like a gamer but I missed a lot of little things here and there. I was so grateful to have Daniel on my team because he is really interested in game development and he always had clever ideas for improving our ruler. I liked how we would push each other to make better and better code. I have a real good idea of what the best strategies are for codeRuler now. I could probably apply some of the concepts to other games.
Another thing that was new to me was working in a group for a programming project. This is the first time I've programmed something with another person and it was a lot different. Initially it was hard to coordinate times to meet up to work on the project since we both are very busy outside of school. However, we found that we could almost always reach the other somehow, either by phone, email, or IM. A hard thing too was trying to sync up our ideas, even if they were similar. In coding out what the peasants do, we were always throwing back ideas of how to change things to make it better and it was quite hard to come up with a final solution that worked for both of us. It was great working in a group though because it really took what I would have done to a whole other level. Our ideas were more refined working together and our code runs really well.
Using Eclipse for this project was a dream once again. It was my first time using it to create javadocs and it was so simple to do so! That really is a useful thing that can make it easier for anyone editing or adding to it. It was nice to have the application right there next to the raw code too. It made it incredibly easy to edit and test things. Doing this exercise also allowed me to get some experience in using collections. I never really messed around with it before and I really like how simple it can make things.
0 comments:
Post a Comment