I'm writing a FPS XNA game. It gonna be multiplayer so I came up with following:
- 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).
- 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.
- I'm completly decided to use
XNA.Framework.Gameclass for the clients to run their game in window (or fullscreen) and the
DrawableGameComponentclasses 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:
- Create my own
Gameclass on the server, which will process all the game logic (only, no graphics). The reason why I am not using the standart
Gameclass is when I call
Game.Run()the white window appears and I cant figure out how to get rid of it.
- Use somehow the original XNA's
Gameclass, which is already has the
GameComponentcollection and Update event (60 times per second, just what I need).
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 processed on the server, how to make them to be drawn on the client? Inherit them (while they are combined to an assembly)? Something else?