Friday, November 25, 2011

Server/Client Architecture

With it being Thanksgiving and all, I was able to actually get some work done. I was still doing school work, but at the end of the day, I got to work on Galaxy Gangs. What I've been spending a lot of my time into is the client/server architecture. I have been basing it off of the Valve Source SDK networking concept. It's really kind of interesting and a really cool way to send information between a client and server. It all relies on this concept of tickrate. The server runs at a user-defined number of tickrates per second. Each tickrate, the server checks for incoming messages, checks the game rules, and updates its own objects. It also does some other things, but the major things are the ones above. The next thing the server does, is that it checks for clients that need updating.
For the most part, I think that will be 99% of the time. I still have to rattle my brain some to figure out on how to do this. After it figures that out, it sends out "snapshots" to the clients that need updating. The client captures and sends out user input at another user defined variable.
So in a nutshell: The client samples user input at a certain rate. Sends out all of that data. The server reads all incoming data and updates the game objects at a user defined tickrate. After each tick is over, the server sends out a "snapshot" to each client that needs it. Rinse, wash, repeat. Throw some lag compensation in there with interpolation, and there ya go.
I'm still working on this, but once it is done, hopefully it'll at least work like I want it to. I REALLY am excited to start working on the core of the game.

If you have questions, leave a comment! It would also be appreciated if you could follow the blog!

Dave

No comments:

Post a Comment