I put together a solid proof of concept “game” from the stripped down Org I mentioned last.  I left out the live networking, because without NAT punch-through which requires a live TCP/IP server, hosts behind routers have to port forward, and people don’t want to do that for good reason.

So I took a different approach.  I wanted to make a turn based strategy game with vague similarity to Plot & Conquer.  It had to be easier to use though.  In the end, I came up with a responsive system for making a turn based game.

My ASP.NET server handles authentication and holding the list of games and players, and all that.  You log in to the game on your computer, and you can start a new game or load one from the list that your player is in.

It’s a simultaneous turn based system, similar to Medieval Total War (the first one), where all players give orders at once, and then they are executed together.  So when you load the game, it knows what turn it is, and if you haven’t finished the turn yet, you can give orders.  My proof of concept “game” is just a multi-user map editor for Org.  You click the hexes to change their terrain, and when you’re happy you click Finish.  When all players in the game have clicked Finish, the Watch Turn button appears, and clicking that executes all of the orders.  If you’re the host, it also sends the savegame back to the server after executing the orders, which is how the server can record the game.

After watching the turn, you can immediately start giving orders for the next one.  It works pretty well.  It also has live, well, five-times-per-second-polling chat, to make it feel more like you’re playing the game with other people.

In the process, I learned a lot about ASP.NET MVC 3.  I tried the database-first, model-first and code-first methods.  I ended up liking code-first best, it was the cleanest and didn’t leave a bunch of ugly generated ORM code.  I made a really clean interface for passing objects between the desktop and server using xml serialization.  It’s very nice to be able to share entire C# projects between server and desktop, which is a luxury I didn’t have when using php for the website.

Oh yeah and tonight I installed an Ubuntu VirtualBox and ran some C# on it.  Glad to finally see mono work, all I had ’til now was rumors.

Leave a Reply