Jump to content
  • Advertisement
  • entries
    17
  • comments
    28
  • views
    27271

Network Subsystem v1.0

Sign in to follow this  
Nit

448 views

I have finished the UDP network communication layer between the client and the server and i'm pretty happy with how well it is working right now. I am properly handling reliable and unreliable packets, using the Reliable UDP protocol presented in Game Programming Gems 5.

The two components that I plan on adding next include a Network Simulator and an ecryption scheme. The network simulator is just a component that sits between my socket wrapper and the raw socket, and will be responsible for dropping packets, duplicating packets, and reordering packets. Each of these actions will be seeded with a probability, as a means of simulating particular network behavior. This will make it easier for me to catch problems with packet reliablity while developing, rather than encountering these problems later on.

I am still working out which encryption algorithm will best suit my needs. I just read something on slashdot about the one-time-pad , and that may be a good solution. If I do attempt this, perhaps I'll see how well it works when using a pseudo random number generator to generate the "pad". More on this later (hopefully).

Per suggestions by Sange (AKA Gospel) and Hope Dagger, I want to add some screenshots showing some progress. Unfortunately screenshots of my UDP protocol in action isn't all that exciting, so I whipped up a crappy helmet item. One thing I do love is how items attach to player skeletons effortlessly. This didn't take me long to whip up, so keep in mind that over time crappy artwork will be phased out as the game progresses.





As I integrate the last few utilities in to the network system, I am going to start hooking up a database to the server. At present time, I'm leaning towards using SQLite as my database system for several reasons: I like its liscense (public domain), it is lightweight and embedded. This will be my first project using a Database System, so I am not 100% sure if SQLite will meet my performance needs. For that reason, I want to be sure that I can swap out SQLite for alternative db software (e.g. postgre or mysql). Enter the Adapter Design Pattern:





There isn't much to this uml diagram -- i put it together just minutes before i had to leave for work. The purpose of the IDBAdapter will be to establish a standard interface to a database, allowing me to swap out SQLite if I want to experiment with another DB system. Naturally, the database formats won't be the same, but code wise the server shouldn't notice the difference.
Sign in to follow this  


3 Comments


Recommended Comments

With your network implementation, how many packets-per-second do you expect going in/out of your server as the # of players scales upward?

I'm very interested in comparing numbers (or algorithms :P), even though I'm writing a different genre of online game. Maybe we could toss some network banter back and forth over MSN sometime if you're game. :)

(Oh, and nice helmet! :P)

Share this comment


Link to comment
Well, the server is still primitive right now, so I don't have the exact numbers just yet ... i'll be there soon. As I mentioned in a post in the multiplayer network forum, I pack as many messages into a packet as I can until I either reach the max packet size (configurable, but currently set at 256 bytes -- will probably end up being 512) or until I flush my socketmanager. I "flush" the socketmanager 20 times/second, just to cut back on traffic. I'll be tweaking this number as well as I get a better feel for my network traffic congestion.

I would also like to say this before the singleton police kick down my door -- I am not in voilation, the socketmanager is NOT a singleton! :)

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!