The road to the app

I like coding. I like Reversi.
I like to have Reversi on the go.
I like to play vs a challenging opponent, in my phone.

So here started the journey to create a professional Reversi application for Windows Phone 7: “Reversi Pro”.

First and foremost, I wanted a rock solid game, that did not crash, and with nice graphics. Dusting off almost forgotten minimax algorithms, I started the journey to create the game during my paternity leave time, as well as during some weekends.

Wow, it is much harder than I remember to create a good game. Lots of little details make the difference between an average game and a professional game.

Board pieces have to animate perfectly, the phone can be turned in portrait or landscape mode, users can click all options, can change theme colors, can play one color or the other, users can pass, users can go back during a pass move, add the option (difficult to test) to add a Trial option, no animation, slow animation, fast animation, and many many details — lots of work!. So the first version was ready, fully operational, and … oh no, it had a really lousy AI.

More work to improve the AI. I read all about strategies, and found out that just counting pegs is not good enough, so I added mobility scoring, weighted board position scores, edge scoring, variable (random) strategies, pass penalty scoring, and changing strategies depending on the stage of the game. Ah, much better, the improved AI can beat *all* the iPhone and Windows Phone 7 Reversi games I could get my hands on (and also it beat the very few free PC Reversi games I could find). Such a good feeling!. But now, of course, the program is slow.

You just can’t have it all.

So back to review the algorithms and optimize the most frequently called functions, add alpha-beta pruning, and voila, it is quite fast in all levels except the “impossible” level. I also developed a ‘debug mode’ where the game ran against itself without stopping, and I left it many nights for hours at a time in continuous mode, to pinpoint any possible issues or bugs. This technique identified issues in some edge cases, in particular during end game, and when a user (or the computer) passes. Finally, I read the comments in existing iPhone and WP7 Reversi apps to identify what else could become an issue. People complained about four main topics in existing Reversi apps:

  • Crashes
  • Too difficult, or “I can never win”
  • Too easy or bad AI
  • Hate the board piece animations

So I tried to address these potential issues in my new app through i) lots of automatic testing, ii) making the first couple of levels very very easy to teach new users how Reversi works, iii) the best AI I could muster, that beats most of the time all other mobile phone Reversi games, iv) an option to turn off the animation. If there is enough interest in the app, I’ll add in the future a few things that I think are still missing: sound, the ability to recover from an app switch (e.g. save the state, or “tombstone” when a user chooses another app and then goes back to the Reversi app with the ‘back’ button), and an improved “about” screen (the current screen seems not to work well depending on the phone model, I’m still trying to figure out what is the issue).

I submitted on Nov 12 2010 the app to the Windows Phone 7 marketplace, so crossing fingers the app will be in the marketplace soon!.

At the last minute I added a “Trial” mode (that I can’t fully test without the app being in the marketplace).

So (when it finally becomes available), try out Reversi Pro, and let me know what you think!.

Categories

About the Author:

Leave a Reply