What is the best way to code the XNA Game Server for FPS game?

Posted by AgentFire on Game Development See other posts from Game Development or by AgentFire
Published on 2012-03-24T07:21:07Z Indexed on 2012/03/24 11:39 UTC
Read the original article Hit count: 361

Filed under:
|
|
|

I'm writing a FPS XNA game. It gonna be multiplayer so I came up with following:

  1. I'm making two different assemblies — one for the game logic and the second for drawing it and the game irrelevant stuff (like rocket trails).
  2. The type of the connection is client-server (not peer-to-peer), so every client at first connects to the server and then the game begins.
  3. I'm completly decided to use XNA.Framework.Game class for the clients to run their game in window (or fullscreen) and the GameComponent/DrawableGameComponent classes to store the game objects and update&draw them on each frame.

Next, I want to get the answer to the question:

What should I do on the server side? I got few options:

  1. Create my own Game class on the server, which will process all the game logic (only, no graphics). The reason why I am not using the standart Game class is when I call Game.Run() the white window appears and I cant figure out how to get rid of it.
  2. Use somehow the original XNA's Game class, which is already has the GameComponent collection and Update event (60 times per second, just what I need).

UPDATE:

I got more questions:

First, what socket mode should I use? TCP or UDP? And how to actually let the client know that this packet is meant to be processed after that one?

Second, if I is going to use exacly GameComponent class for the game objects which is stored and process on the server, how to make them to be drawn on the client? Inherit them (while they are combined to an assembly)? Something else?

© Game Development or respective owner

Related posts about XNA

Related posts about engine