|
While I was suffering through having the tint removed from my Minivan (who knew that legal tint in Texas would be illegal in New Jersey??), I drew up a rough cut of what I see as the basic network design for Ulysses Agenda. Below is a list of the various meshes that I see being used by the game, as well as a list of the messages that will be sent on them. Hopefully you feel the same way I did when you see this - the power provided by WCF Peer Channels is absolutely insane. I can have completely loosely coupled peer-transmitted events that any client, regardless of purpose, can listen to or push, giving me a truckload of power and flexibility that will come in handy when building this application using Extreme Programming (XP) techniques:
net.p2p://ulyssesagenda/chat
net.p2p://ulyssesagenda/nav/[galaxy id]
net.p2p://ulyssesagenda/combat/[galaxy id]
net.p2p://ulyssesagenda/shipyard/[shipyard id]
net.p2p://ulyssesagenda/starport/[port id]
net.p2p://ulyssesagenda/planet/[planet id]
net.tcp://[server ip]/universeserver.svc - note that this is not a p2p service, its a standard service
Hopefully my next post will be a walkthrough of the code I used to create a sample universe. Again, in keeping with XP goals, I want to create the smallest testable surface area for my application before continuing. Once I am assured that all is in working order, I can begin building out again. What I want to avoid is to get 3 months into the code to find out that something at the lowest level of the application doesn't work and I need to throw it all away. Removing scar tissue and refactoring as I go seems like a good trade off for the reliability and stability of being able to count on my underlying network backbone as I add more and more complexity on top.
I love what you're doing here.
Most of the p2p stuff is broadcast messages to reflect changes in game
state that can be listened to by any other client. The state of the game
itself, depending on which state you're talking about, is all maintained in
the clients themselves. Where necessary, the state is maintained on the
universe server as well.