Here at Novaleaf, we make consumer apps in addition to games. Our first web app is a Thai specific computer hardware eCommerce web app built on Google App Engine (GAE), using Java.

I’m historically (and well, currently) a .NET developer, but find the idea of a GAE based game server platform intriguing. But hey, I’m pretty much a 1 trick pony: “C# or nuthin.” (I can write C++ but hate it), so how do I get into the world of “weird” java buzzwords like servlets and WAR, in addition to the platform specific knowledge that makes up GAE?

One way would be to force one of Novaleaf’s webdevs to sit down and teach me. I might just do that, but… after I give it a try myself.   Here’s the steps I took to learn GAE’s basics, and get a “hello world” app running. I hope it’s useful for other .NET developers looking to expand their skills in a relatively painless way.

First: Get a high-level picture.

I skimmed Google’s online resources about GAE and it’s various features. and learned from a high-level what GAE can and can not do, and what it will be able to do in the near future.  I prefer to do this high-level overview first to frame the capabilities of the platform, so later when doing in-depth tutorials I can frame the knowledge in context to how it’d fit into my project’s needs.

I was a bit surprised about how well described it is, at least relative to Sun’s Java/Javadoc references. I am sure that for Java developers, the documentation is perfectly fine… but for people starting out, it’s a bit painful to figure out the difference between J2SE, J2EE, that Java “2″ is actually v1.2, etc etc…  Anyway, no need to go into that here, right ;)

Second:  will GAE do what I need?

Once I understand the general capabilities of GAE, I ask myself if it will do what I need?   Well, I have a ton of ideas floating in my head, but to put this in perspective for a “simple game server” here’s some key points:

  1. GAE scales very well with multiple users (each request is on a separate thread)
  2. Storing intra-gamestate will be too expensive (GAE stores all state in database, so high-frequency read/writes will be monetarily expensive)
  3. Storing macro-level metagame information (low-frequency user information and matchmaking data) seems to be a good match for GAE’s feature set
  4. Per-user server polling is the only viable option for GAE right now  (a socket api is in development but not yet ready)
  5. Threading is not supported right now (in development) so no multithreaded fancyness is available.
  6. Supports XMPP based chat protocol
  7. To summarize, GAE seems suitable for synchronizing with users every few minutes, so for savegame, matchmaking, topscores, achievements, etc.    but not for high-frequency use .
So this is all fine by me.   Current GAE features seems to restrict my game-use to matchmaking services only, though if I want to get creative with the XMPP functionality, it may be possible to introduce a high-latency gamestate server, though the adding of sockets to GAE in the future also looks promising.

Third: Find a good book.

I searched amazon for the highest rated books on the matter, and settled with “Programming Google App Engine“.

I am currently on chapter 2 of this book, following the tutorials to put together a “hello world”.  Seems good, however their explanations detail using Eclipse,  which is nice and all (and free) but not realy that user friendly to .NET developers comfortable with Visual Studio.

Fourth: Setting up the right tools

I did some research as to the most visual-studio-like java IDE, and came up with Google Web Toolkit integration, so seems great to me.     I’ll quickly summarize the steps I take to get the tools setup:

  1. Install Java6 JDK from Sun’s website (J2SE x64 is what I used) 

Run IntelliJ and create a new project with the following options:

  1. Setup a new project (Java Module)
  2. Under technologies, choose “Google App Engine”, choose the right SDK dir that you extracted the GAE SDK to.
  3. If not set, point JDK dir to the program files\java\jdk1.6.x dir  (File–>Project Structure–>Project)
  4. Add J2EE servlet references:  File–>ProjectStructure–>Libraries–>AppEngine API–>Classes->Attach Directory:   “%PATH_TO_APP_ENGINE_API%\lib\shared”  also add \lib\orm\ and \lib\user\ and \lib\
  5. Add GAE Javadocs for inline documentation:   File–>ProjectStructure–>Libraries–>AppEngine API–>Specify Documentation URL–>“google’s own tutorials.

    Summary:  Pretty easy!

    In total, I spent about 3 days figuring out these details and finish up my first “hello world” app and getting it published on GAE.   If this information proves useful (or not), please leave a comment.  I’d love to hear.