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: 432
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 theGameComponent/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 standartGameclass is when I callGame.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 theGameComponentcollection 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