Sunday, October 17, 2010

Project Ion: First-Person Shooter Server/Client in XNA

Over the next months/years/decades (depends on how much "free time" I have), I'm going to be attempting to write an open-source Server/Client for a first-person shooter game called Ion. I'm going to write both the server and client in C#. The client will be built using the XNA framework, while I am going to try my best and avoid XNA usage on the server side to maximize portability. However, I would like the simulation code to be identical (same shared library), and because the client is going to be heavily XNA based, this poses a nice challenge to look forward to.

Why are you writing this game?
I suppose there are a few reasons why, but the main purpose is education. Not necessarily to educate others, but to educate myself. I have good bit of server and client experience working with TCP multi-player games at Electrotank, which are mostly controlled via a simulation where latency can afford to be seconds off, yet the priority of message order and send success is high; however, in terms of "real-time" simulations, using UDP for a networking protocol, and having to handle high frequency volatile packets in a 3D environment is certainly a new venture.

Why XNA instead of something like Unity?
So, this is probably the question that anyone who reads this post will ask, and my answer is probably not the best, but it will have to do. Let me first start my saying that I think Unity is an incredible tool/framework. I think you can pretty much build your application to run on any platform, and the ease of use and low learning curve are also great. I don't think that I have found anything that it can't do (and do it easily).

Because Unity makes things so easy, writing an FPS game would be much less difficult. If I was writing the game against strenuous deadlines and for business reasons, I would certainly use Unity. However, since the point is, once again, to educate myself on the underlying concepts behind an FPS game, I'm choosing XNA. This will force me to focus in on each individual component of the game.

What can we expect?
Well, to be quite honest, I have no idea how to answer this because I'm not fully aware of the power behind XNA. I have a lot of experience with XNA v1.0, but Microsoft just released 4.0 a few months ago, so we'll have to see. Obviously, the game will not be a "Halo" or a "Gears of War," but I am hoping to achieve something of "Quake 2" quality using today's standards and technology. This may be too large of a goal initially, but I don't think it's impossible. (I will probably re-visit this statement later and laugh at my ignorance).

Have you started?
So far, I've written a small multi-threaded UDP server that accepts and deserializes in-bound client messages, and I've started working on the client rendering, physics simulation, and basic input. Here's a link to a video that somewhat demonstrates my progress:

I've also been reading a fair amount which, for me, is somewhat of a feat as I'm severely ADD (haha). I have to say I'm a fan of Glenn Fielder's articles, and thus far, have played a large role in my education on FPS games. I've also reached out to Electrotank co-founder Jobe Makar for insight and expertise, who has also provided excellent feedback.

In terms of 3D art, I'd like to think I am mediocre at best. I can certainly create some decent looking models, but the time it takes is so far beyond reasonable that it becomes a real pain in the ass. With that said, if anyone wants to contribute art for the game, please send anything (that I can legally use of course) to: