What’s In the Cloud: Canada Does Windows Azure - Code of War

image_thumb3_thumb2_thumb2_thumb2_th[1]

I’m always on the search for stories of Canadian developers who have either built new applications using Windows Azure services or have migrated existing applications to Windows Azure. The mission: To share how Canadian developers are using Windows Azure to create innovating and unique solutions.

This is one of their stories.

Social Gaming Powered By Windows Azure

Social gaming – an industry that is likely to increase to $1.32 billion in revenues by 2012 – is booming. Gaming companies are looking to take their games to the next level, and consequently, they are looking for platforms that allow them to do it. In Social Gaming Powered By Windows Azure, I talk about how Windows Azure and Social Gaming make a perfect match and how the Windows Azure Tooklit for Social Games is making it easier to utilize the power of the Cloud for the intensive backend processes needed by social games.

In this instalment of Canada Does Windows Azure, I sat down with developers Jacques Chamberland and Ryan Easterbrook, from Toronto-based gaming start-up Huge Monster Inc. (Twitter, Facebook) who have just recently launched their Facebook social game Code of War.

Code of War

195774_193612490669643_454925_n[1]

Code of War is a casual real-time-strategy (RTS) game set in the near future where you and your friends collect resources to build your base and army. Once you’re done, together, you unleash everything you’ve got and crush enemy targets.

Jonathan: When you guys were designing Code of War, what was the rationale behind your decision to use Windows Azure as the game’s backend?

Jacques: About half way through our development effort, one of our test servers was cracked from somewhere in China.  After going through the effort of restoring the server and attempting to patch the holes, we realized that we didn’t want the hassle of managing the infrastructure.  That just isn’t our core expertise so we decided to outsource our infrastructure.

Ryan: We tried out a few different server rental and cloud options. We picked Windows Azure because it’s a great fit for our software stack (.Net and MS SQL Server) and, more importantly, we liked that all we had to do was build and manage the application.  All lower-level software and hardware management is someone else’s problem. We also liked how easy it is to scale out our application horizontally.

Jonathan: What Windows Azure services are you using? How are you using them?

Jacques: We use SQL Azure to store our config, player, and log data.  We use Windows Azure Compute to host our web presence and our services.  We architected it to scale out both vertically and horizontally within Windows Azure.  We use Blob Storage to store Azure metrics.  We use SSIS to migrate our configuration data from our game design environment into our SQL Azure hosted system database.
We have a 3 different complete game environments set up for development, testing, and staging, and 1 environment set up for production.

Jonathan: During development, did you run into anything that was not obvious and required you to do some research? What were your findings? Hopefully, other developers will be able to use your findings to solve similar issues.

Ryan: Many of the configuration settings required to run on Windows Azure were confusing at first, but once I looked up the relevant information and discovered the way that Web and Worker roles function and how they differ it became quite simple. The largest challenge was uploading a database schema and data to SQL Azure. Originally we were deploying directly from a Visual Studio Database Project; however, this can’t be done in SQL Azure. After discovering Red Gate [a Microsoft Gold Partner] database management tools, this process became very easy. We did have to upgrade to Visual Studio Ultimate in order to get IntelliTrace.  Not having that probably blocked us from getting things running for quite a while.  I wouldn’t bother trying to deploy to Azure Compute without it.  You won’t be able to debug your deployment issues.

Jacques: There are subtle differences between SQL Azure and a local instance of SQL server so we had some challenges in migrating our SSIS packages over.  The most challenging was restructuring the packages so they didn’t use distributed transactions.  Another issue we had was that all developers had access to our test servers prior to the migration.  They often reset our application during testing as a convenient way of reloading all of our game configuration data.  After migration, only two accounts could log into the management console.  So we had to write some code that would re-initialize configuration data while the service was running (not a trivial task given that this means the game design can change while players are actively playing the game). I think the other thing we did to really make it easier to manage the system is we started logging every thing to a log database (service calls, errors, exceptions).  That way we could easily compare stats from hour to hour and day to day to identify when or where we were having problems.

Jonathan: Lastly, what were some of benefits of you saw as you got started with Windows Azure?

Ryan: We moved over to Windows Azure during the development stage of our product; however, it still involved porting over a fully fleshed out system. Although there were a couple difficult moments, I was able to host our existing system on Azure Compute and SQL Azure with only minor changes to the system. Most of which happened at the hosting layer. It was easy to create multiple hosting environments using the smallest instance sizes for development and testing, then scale up our production environment as demand grew.

Jacques: From my perspective it was pretty painless.  We had about 20 person-months of development on our server product running on several standalone SQL Servers and Windows 2008 boxes. We were worried that it would be hard to make the move when we made the decision.  But Ryan was able to port it and have it running on Azure in a couple of days by himself.  We were not afraid to contact Microsoft support whenever we ran into a problem that we couldn’t solve by ourselves.  They were helpful and I believe accelerated the process. 

Jacques, Ryan, thank you for sharing your story with us.

If you’re a Facebook user, head over to Code of War, get all your resources, build up your army of friends, and show the enemy what you’ve got! If you like the game, make sure to show Jacques and Ryan that you do – “Like” Code of War. As the number of people playing at any given point in time continues to increase, just remember, there are Windows Azure Compute instances and SQL Azure databases working hard behind the scenes to give you that exceptional social gaming experience.

Join The Conversation

What do you think of this solution’s use of Windows Azure? Has this story helped you better understand usage scenarios for Windows Azure? Join the Ignite Your Coding LinkedIn discussion to share your thoughts.

Previous Stories

Missed previous developer stories in the series? Check them out here.