Brendan Enrick

Daily Software Development

Rock Paper Azure Contest Bot Tips

A Rock Paper Scissors tournament is being put on by the Windows Azure team. The competition is a fun challenge designed to be a fun way to compete against other developers for some bragging rights. If bragging rights aren’t enough for you, there are prizes also being given out.

1st: XBox 360 / Kinect bundle
2nd: Kinect
3rd: $50 Gift Card

To join the competition, you just have to download the starting code and set up an Azure account to submit your code. They have detailed instructions on the site. You can use a code to get the Azure account set up for free.

How the Rock Paper Azure Game Works

You might be asking, isn’t Rock Paper Scissors just random? Basically, yes. Against a human opponent there will be trends, but with a computer you can be far more random. There are a couple of adjustments made to the game.

To win the tournament, you have to beat the most number of other bots. Beating a bot means that you play RPS until one player wins at least 1000 points. If there is a tie on a point, then the winner of the next point wins the points for the tie as well. This means that if you can get a few ties in a row and then win, you can win a lot of points.

How do you win ties? They’ve added a new move called “Dynamite” That move beats all of the basic moves: Rock, Paper, and Scissors. You can only throw Dynamite 100 times per match, so use it wisely.

Isn’t the dynamite broken? No. They’ve also added a move called “Water Balloon”, which only beats dynamite. You can use as many Water Balloons as you want, but be careful they’re beaten by all of the standard moves.

Rock Paper Azure Bot Tips

Look at Log Files

When you submit your bot to the Rock Paper Azure competition and view the log file from each match your bot had with each other. It will show each point in the game, what each player did, and who got the point. Make sure you’re checking games you lose to see why you lost and also examine some games that you won. This is important so you can see which decisions you’re making that help you win.

Tell Yourself Why You Made Each Choice

You are able to write to the log yourself. If you decide to use Dynamite or a Water Balloon, print out a log message telling yourself why you did it. Then take a look at the log of a game and see if you made the right or wrong choice and adjust your bot accordingly.

Don’t Throw Too Many Water Balloons

A problem that I’ve seen with a lot of bots is that they throw too many water balloons. If I can make my bot trick yours into throwing Water Balloons, I will. Be careful of these tactics (my bot sometimes uses them).

Tactics to use and watch out for:

  • Use only 99 dynamite, because your opponent’s algorithm will keep throwing water balloons.
  • Have an intentional gap where you don’t use dynamite. If your opponent was trying to predict your dynamites they will throw some water balloons and you will win.
  • Start delaying your dynamite throws if your opponent starts water ballooning you.

Don’t Be Too Predictable

This sounds obvious, but I’ve seen plenty of bots which are not using random move selection, I write code to defuse them specifically. There was one bot which always countered your last move, so if you do the same move twice he beats the second one. I wrote the code to disable him and he only got 1 point against me after that.

Write More Than One Strategy

My bot has more than one strategy. I have Water Balloon strategies and Dynamite Strategies. Essentially, my bot is able to change how it decides on water balloons and how it decides dynamite based on information at runtime. What this lets me do is either change strategies mid game or select certain tactics to face certain opponents. I am able to check the name of the bot I am facing and use the strategy designed to beat them.

Summary

Go give the competition a shot. There are prizes for the next couple of weeks. Go get a free Azure account set up and see how well you do.

NimblePros is Hiring Developers

NimblePros is looking for new team members as passionate about writing great software as we are. We don’t believe in writing crappy code, and our team is always improving in order to write better code. We continually adjust our processes to promote our goals of reducing waste and delivering better software.

I enjoy working with the NimblePros team, because they’re a fun group of individuals working towards the same goals I am.

If you would like to join the NimblePros team, you can contact us directly by emailing careers@nimblepros.com. Please let us know what interests you about joining our team and what you’re really passionate about.

Here are a few tidbits about us:

The NimblePros team was founded by our area’s Microsoft Regional director, Steve Smith.

We believe that board gaming is great way to build a cohesive team.

NimblePros sponsors and its team runs the local Software Craftsmanship group.