Adding networking

May 29, 2009 at 5:47 AM

So the main functionality we really need to work on adding is networking support. It seems clear that WCF would be the best technology to utilize, but where do we go from there?

In particular, what's the best architecture for the communication that will be going on? I think it would be nice for players to operate in a peer-to-peer manner of some sort but I don't know if WCF can really host the data from within the existing Silverlight app or if there will have to be some kind of separate back-end program hosted in addition to the battlemat itself, or what.

Aug 7, 2009 at 11:36 PM

Very brief research makes it look like .NET 3.5 has built-in P2P support in WCF that we could utilize, and with all the nodes just being instances of a Silverlight app hosted on one server I suspect it could be completely pure P2P for now. It's supposedly easy to have nodes broadcast and find each other, then enter into a contract to exchange data - I foresee people using GUIDs or whatever identifier to join a mat session and send updates to each other about created, updated, and deleted mat items as well as simple player metadata.

I will try to prototype this soon if I can work up the energy to be productive.

Aug 21, 2009 at 8:48 PM

Some additional very brief research yields the following insights:

  • WCF pipe binding since the communication is (for now at least) all on one machine?
  • Hybrid P2P - secretly make one of the nodes (oldest node?) the leader node. Synching information is a lot easier since you always go to and from one other specific node, but you have to worry about electing a new leader when the old one quits. This pretty much sounds like WSN concepts that I already have some practice with so it should be easy.
Jan 31, 2010 at 1:21 AM
  • Callback contracts for publish-subscribe style event handling. Maybe this would get a P2Pish setup going real easy?
  • It seems like we need to add GUIDs to all shared objects (battlemat shapes, lines, and tokens; game session) and users. I haven't looked to see if maybe there's already GUID support on these .NET classes we're using; maybe adding them with class inheritance wouldn't break anything?