.NET & Funky Fresh

Syndication

News

  • <script type="text/javascript" src="http://ws.amazon.com/widgets/q?ServiceVersion=20070822&amp;MarketPlace=US&amp;ID=V20070822/US/bluspiconinc-20/8001/8b68bf4b-6724-40e7-99a5-a6decf6d8648"> </script>
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
.NET Games & What Took Part 5 So Long?

Well, in case you hadn’t noticed, it took me an unbearably long time to post part 5 of my .NET 3.0 series.  Believe it or not, there’s actually a good reason for this.  Christoper Bennage and I were selected as Code Master Challenge semi-finalists!  We have been hard at work preparing for our live meeting with the judges.  Unfortunately, our presentation didn’t go as well as we had hoped, due primarily to technical problems with live mail, live meeting and vista.  In any case, the online multiplayer game we have been creating is turning out awesome!  We are very pleased with the product and the platform that we have chosen to build it on - .NET 3.0.  I believe that our game is one of the broadest and most impressive demonstrations of what .NET 3.0 can do.  I haven’t really seen anything quite like it.  There are three parts to the product:  the game client, game server and the administrative tool.  I’d like to share a little bit about how we have used the different pillars of .NET 3.0 with respect to the different parts of our application.

WPF:

Obviously the game client is done with WPF.  We are taking full advantage of its 3D capabilities.  We are doing a decent amount of animation of 3D content as well.  The entire client is skinnable, allowing us to use WPF’s control templating and styles to completely change the look of the game.  The admin tool’s UI is also built with WPF.  We did this in order to support some of the 3D stuff we needed to show in the tool, but it was also much faster and more stylish to develop this in WPF than WinForms, not to mention the greater maintainability of the code that resulted.  Here’s a shot of the admin tool:

Upload 3d content for the game.

Notice the custom context menu, combo box and text box.  That’s all done with control templating.  Sweet!  We also have a custom control that displays a rotating 3d model, in this case:  a space craft.

WF:

We are doing some pretty cool things with workflow as well.  All of our AI is run by workflow.  We have created a set of custom activities that can be used to build AI personality behavioral patterns.  When an NPC finds them self in a particular situation the appropriate workflow for that character is executed to determine how the NPC will respond.  We define set types of behaviors and create the activities in code, but full authorship of the behaviors themselves is done through a custom re-hosting of the WF designer in the admin tool.  This means that an admin can create completely original NPC’s that we haven’t thought of by simply dragging and dropping personality components and wiring those behaviors up to an NPC.  Here’s a shot of the behavior designer showing how a particular NPC will react during combat:

It gets better though!  Not only are we using WF to create AI behaviors, but we are using it to let the admin author unique story lines!  We have developed a set of custom activities that represent story events and triggers.  These can be combined to create quests within the game.  The admin can literally work any story they want into the game world.

WCF

Since it is an online multiplayer game, we have to handle communications somehow.  WCF fits the bill.  With WCF we are able to send messages about the players actions to the server and the server can push info out to the players.  Thanks to WCF duplex messaging over tcp, this is very simple and we were able to keep all of the game logic on the server.  Also, it was a synch to enable chatting between players and to top it off we used WCF to publish an RSS feed of game events (specific to the player) that enables one to see what is happening online when they are not playing.  (We have a special vista side bar gadget if you want to display this feed in a stylish manner.)

Other cool things:

In .NET 3.0 there is a speech recognition API that can be used to control vista and its applications.  We used this API to build a custom grammar for the game.  So, if you don’t want to use the mouse, you can control the game entirely with voice commands!

The client is less than 1mb in size at this time.  How did we accomplish this?  Well, remember the admin tool?  You can use this to add all of the content to the game: skins, ship models, character portraits, npc behaviors, quests, etc.  All of this is being stored in the SQL as XAML!  (Yes, 3D models too) . When the game needs to display something visual, it simply asks the server for the content.  We are actually using WCF to send Xaml 3D models over the internet as needed by the game.  (Yes we cache the data on the client.)

All together, we are very pleased with what we have been able to do and look forward to sharing more of our progress.


Posted 11-10-2006 4:42 PM by Rob Eisenberg

[Advertisement]

Comments

Chris Slatt wrote re: .NET Games & What Took Part 5 So Long?
on 11-13-2006 1:51 PM

WOW! All of that sounds fantastic!  I'll read anything you're willing to write about this game.  I miss Trade Wars :(

Jarle Nygård wrote re: .NET Games & What Took Part 5 So Long?
on 11-14-2006 8:58 AM

Cool! Keep the info coming! :)

.NET & Funky Fresh wrote Prism and Caliburn's Future
on 06-06-2008 9:24 AM

First I&#39;d like to say that I&#39;m stoked about the work the Prism team has been doing.&#160; I have

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)