views:

375

answers:

2

What is a good architecture for implementing a real-time, multi-player Silverlight-based game that is intended to integrate and run from Facebook?

The idea is to build a Silverlight-based game that uses social network information from Facebook as part of its play environment.

Specifically,

  • Where should the game rules be implemented, in the client or on some server?
  • How should the game obtain credentials and session information from Facebook?
  • What should or should not be cached in the game (social network data, interactions, session keys, etc)
  • How should the game notify players about asynchronous world events - polling? out-of-band-push?, some other technique?
  • How should the game be implemented to minimize the risk of hacking or malicious disruption?
  • How should the game be architected to minimize latency and other network bandwidth constraints?
+1  A: 

Make the game work first. Stick stuff wherever it's easiest to get it done - whether that makes sense to keep it on the client or your server or whatever. If you follow good coding practices - SoC, IoC, unit tests, interfaces - it will be extremely easy to profile your working prototype and move things around as performance wins become obvious. Trying to anticipate how to optimize ahead of time is a losing game.

Rex M
My concerns are not so much about optimization, but rather what will result in functional problems. For example, allowing game decision logic to live the Silverlight client may make the game easier to hack and cheat - but putting game logic in the server may make the game too chatty.
LBushkin
@Lbushkin sure, that's what I'm getting at - you're worried about client-side security, so put everything on the server first. You don't know if it'll be too chatty 'till you try. Then selectively move things back to the client as needed, and solve security problems as they arise, not before.
Rex M
+1 for "do not optimize first." Premature Optimization is a nasty antipattern, especially with new stuff like Silverlight.
Dave Swersky
A: 

Saw this tip online today from a former Microsoft Silverlight Program Manager.

Executive Summary: Silverlight is new for everybody, expect to throw away a lot of code while we all figure out how best to do this stuff.

Based on your requirements, I'd say your game is quite ambitious and will push the boundaries of what has been done with Silverlight (did I mention I'm jealous you're getting paid to do this? :)

Silverlight was first released less than three years ago and is just starting to come into its own. If you're going to embark on a project like the one you've described, you'll be at the forefront of the community learning curve. Bon Voyage!

Dave Swersky