Images in this post missing? We recently lost them in a site migration. We're working to restore these as you read this. Should you need an image in an emergency, please contact us at imagehelp@codebetter.com
Game Programming with .NET 3.0

Introduction 

Rob Eisenberg and I are writing a game in .NET 3.0. We entered the game into Microsoft Code Master Challenge and we made the semi-finals.  Today we had to make a 20 minute online presentation to a panel of judges using Microsoft's new Live Meeting, and while the presentation did not go as well as we would like, we are very excited about the game itself.

 Back in the early 90's, I used to haunt the BBS's on my 9600 baud modem (or was it 2400?) and my first exposure to online multiplayer gaming was something called Trade Wars.  It left quite a mark, and I always wanted to write my own version of the game.  About three years ago, I discovered a number of servers hosting the game (you can connect with telnet) and within two weeks I had half a dozen friends playing.  (Rob even set aside Knights of the Old Republic to play!)  This motivated me again to consider writing my own spiritual successor to the game.

We started out with .NET 1.1 and the intention to use Flash for the client. (I did a prototype using Flash Remoting to pull a star map from SQL Server and render it in 3D).   Aftersome initial design work,  and a little bit of coding, Work got in the way for two years.  As we began to learn about WinFX, the fire began to kindle, and when the Code Master challenge came along the time was ripe.  We gave the game the codename Empyrean.

So why .NET 3.0? 

I mean, aside from the fact that we are both .NET developers (and XNA wasn't available when we started).

The Windwos Presentation Foundation was a natural fit for the type of client I wanted.  I wanted the features Flash had to offer, vector-based graphics, timelines (storyboards), etc. and WPF has them (and 3D support!).  The only negative was that the potential audience would not be as large.  I decided that I could live with that. 

Rob and I have both been interested in Interactive Story Telling and we wanted the world of Empyrean to feel alive and moving.  We wanted the NPC's to be interesting, dynamic, and adaptive.  It did not take long to realize that Windows Workflow Foundation could provide a lot of the infrasture to support our ideas.  Early on, we had a notion of "workflow based" AI's and eventually "workflow based" quests.

Windows Communications Foundation made sense because, well, it's a multilplayer game and WCF greatly simplifies the networking API.

Funny enough, Kevin Hoffman was having similiar ideas, and he's currently working on a .NET 3.0 Trade Wars inspired game called Ulysses Agenda

Features Of The Game

Empyrean Screenshot

That is: features as they relate to .NET 3.0.  This is a developer's blog! 

In the game, you fly around in a starship and you can purchase new  starships when you save up the money.  We wanted the game's UI to reflect the ship you currently own.  We did this by creating a series of controls that support templating.  The controls do things like displaying your character's stats, or exposing game commands (trade, attack, scan).  We then create a set of themed templates in WPF's markup language, XAML, and store that XAML in a database, then we deliver the XAML to client whenever they purchase a new starship. (Of course, right now we only have two skins.)

As mentioned above, the NPC's use WF to make decisions.   NPC's have certain types of behaviors (trading behavior, combat behavior, etc.) and for each of these behaviors we designate a WF workflow.  The markup is stored in the database.  This allows us to tweak the behavior of NPC's ad nauseam.  So when a player approaches an NPC, hoping to purchase something, the NPC loads a workflow to decide what to charge for the item (or to if they kick the player out of the store, or attack the player, or whatever!)

The other visual conent of the game (portraits of NPC's, models of starships and space stations) is all also stored in the database as XAML.  We used eRain's ZAM 3D and Blender (with Daniel Lehenbauer's export script) to produce the 3D content.  Fireworks (with Infragistics' XAML Exporter) was the primary tool for 2D content (I haven't gotten my head around Expression Graphics Designer yet).

All of this (skinning, visuals, workflows) allows each server running the game to vary widely.  An administrator of the game could configure the game to look and behave however they want.

We use WCF to expose an RSS feed with player specific information (such as what has happened to you in between game sessions) and a Vista gadget that displays the feed.

Question for You

Is this interesting to anyone out there?  Would you like me to blog more about our game development efforts?  Things like implementing the A* alogrithm in C#.

Or would you prefer for me to keep in in the realm of Business Development?  (Our game development is still heavily patterns influenced and domain driven; we also wrote our own OR\M that the game uses). 

I will post more about .NET 3.0 and what I have learned in that respect.


 


Posted 11-09-2006 4:30 PM by Christopher Bennage

[Advertisement]

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)