XNA Creators Club Online
Page 1 of 1 (3 items)
Sort Posts: Previous Next

Who sends what where?

Last post 03-06-2008 1:06 PM by Anti. 2 replies.
  • 03-05-2008 7:10 PM

    Who sends what where?

    I wasn't sure where to post this exactly because this isn't quite a question of XNA in general but, generally speaking what data is sent to the client and what data is sent to the server in a aciton paced game?

    I've been researching this quite a bit and most places tend to say the server should be king. Even so what data would I send to the server to return my position? Would I send button presses, or the velocity. Perhaps both? Would I send the players state to the server or would the server send the state to me. It's all confusing really.

    If I had to imagine how it's done, I'd say button presses and state changes (such as dying) would be sent to the server and the client would recieve the position, velocity, and state.

    All these seem to work but I'd like to know what's normally done for a game that runs at a quick pace.
  • 03-06-2008 12:47 PM In reply to

    Re: Who sends what where?

    That is indeed the question :-)

    Unfortunately it's not an easy thing to answer: figuring this is by far the biggest challenge in making a networked game, and there's no single answer that will apply to all games.

    Some people use a single server, some use a peer-to-peer architecture, others use some kind of hybrid approach.

    If you are new to game networking, you should probably start by comparing the client/server and peer-to-peer samples from this site, then once you understand how those work, look at the network prediction sample.

    I also wrote a series of blog posts about game networking that you might find interesting:

    http://blogs.msdn.com/shawnhar/archive/2007/12.aspx
    http://blogs.msdn.com/shawnhar/archive/2008/01.aspx

    (in particular my "Network object ownership" post is about exactly what you are asking here)

    XNA Framework Developer - blog - homepage
  • 03-06-2008 1:06 PM In reply to

    Re: Who sends what where?

    Thanks this helps a lot!! It looks to be the most informative thing I've seen thus far.
Page 1 of 1 (3 items) Previous Next
var gDomain='m.webtrends.com'; var gDcsId='dcschd84w10000w4lw9hcqmsz_8n3x'; var gTrackEvents=1; var gFpc='WT_FPC'; /*<\/scr"+"ipt>");} /*]]>*/
DCSIMG