Jump to content
  • Advertisement
Sign in to follow this  
StarikKalachnikov

What is the best method for network programming?

This topic is 4705 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everybody, me again with a probably misleading subject title... I've been involved with a project for a while, and I have some questions regarding the multiplayer/networking part. I myself work in a business environment where we use webservices (in .NET and in Java). And I was wondering if webservices can be used in multiplayer games, performance and stability-wise. And another question, what do you use for storing server side data, which database and do you use some kind of data access layer? Please share your thoughts and information it will be very much appreciated!

Share this post


Link to post
Share on other sites
Advertisement
hello StarikKalachnikov

i've been trying to understand network programming for quite a while now (over 3 weeks) and i find Beej's Guide to Network Programming Using Internet Sockets very helpful. It's in plain c and have a couple of nice examples. Things are a bit different under win32. You need to create your own window messages. This is nicely explained in this article. Besides it'd be a good idea to take a look at the whole multiplayer and networking section here in gamedev.

the examples above arent exactly in java but those languages are pretty similar so they should give you some start which is needed a lot. as i mentioned, i've been learning networking for quite a while and now i'm only able to make some simple chat client-server. it's a bit tricky to lear but once i got started with my first networking application i found this subject kind of fascinating.

Share this post


Link to post
Share on other sites
Quote:
Original post by StarikKalachnikov
I myself work in a business environment where we use webservices (in .NET and in Java). And I was wondering if webservices can be used in multiplayer games, performance and stability-wise.

Of course, this depends a lot on the game. But generally speaking, stuff like webservices will be much too slow.
Keep in mind that it's an abstraction made to "hide" the fact that you're actually working over a network, to make things easier on the programmer. But it doesn't exactly help efficiency or performance. There's a huge amount of overhead (in general for all such technologies, and for webservices in particular, due to the xml-based protocol they use).

Mostly you use plain old sockets for multiplayer games. Either TCP or UDP, depending on your particular needs.

As for the server-side, again, it depends.
I think you'll find that databases aren't used that much. Only to ensure durability of your data (if you're writing a MMORPG or persistent world of some kind).
But at runtime, they're not really used. Things are kept in memory as much as possible, again due to performance requirements.

Share this post


Link to post
Share on other sites
It is possible to use web services. They're often offer good programming models, high reliability and scalability. But those things arent neseccarily what you're looking for in a game.

In many types of game low latency is the most important. Bandwidth consumption is another factor.

I've worked on a commerical (although canned) MMORPG and for the database we used PostgreSQL and libpq.

MMORPG games dont need that low latency, nothing like FPS, but they do need scalability and bandwidth controls.

I recommend you go with a middleware solution like HawkNL or Quazal NetZ(?)

Share this post


Link to post
Share on other sites
Thanks for all replys, you made some good points I didn't think of in the first place.
I was trying to evade winsock programming for a while since webservices hide all that from you. Maybe I'll pick some library suggested by the multiplayer/network forum.

Thanks!

Share this post


Link to post
Share on other sites
As mentioned before, all depends on the type of game. Games like HatTrick can be modelled with a WebService, Maibe a game like Gunbound as its more like a chat. But I really don't know if it will be able to handle the speeds required for a FPS or RTS. In those cases the layers required for a web service may cause all the system to slow down.

Luck!
Guimo




Share this post


Link to post
Share on other sites
Personally, I wouldn't consider using SOAP for any game application.

SOAP is extremely heavyweight, and seeing as it's usually over HTTP, it almost always requires opening a new connection for each message.

Couple this with the fact that HTTPS does not (properly) support server-push, and you've got an environment very non-conducive to game programming.

Of course it depends entirely on the game, but I would say that no game programmer would want the huge overhead of a SOAP request very often.

That doesn't mean you couldn't use SOAP for (for example) registration, or login, but you wouldn't want to use it for the gameplay itself.

HTTP itself is not idea, but SOAP adds a huge layer of complexity which slows things down a lot.

Mark

Share this post


Link to post
Share on other sites
Quote:
Original post by markr
Personally, I wouldn't consider using SOAP for any game application.

SOAP is extremely heavyweight, and seeing as it's usually over HTTP, it almost always requires opening a new connection for each message.

Couple this with the fact that HTTPS does not (properly) support server-push, and you've got an environment very non-conducive to game programming.

Of course it depends entirely on the game, but I would say that no game programmer would want the huge overhead of a SOAP request very often.

That doesn't mean you couldn't use SOAP for (for example) registration, or login, but you wouldn't want to use it for the gameplay itself.

HTTP itself is not idea, but SOAP adds a huge layer of complexity which slows things down a lot.

Mark


I agree with Mark...

That being said, depending upon your game requirements you might be able to leverage the SOAP functionality for some kind of web reporting. Say you want a public site to display some ingame stats to visitors (average frag rate, a "global" high score list for your game, etc)..

This can be written in a small external app which can pull data from your db backend.

*shrug*


Share this post


Link to post
Share on other sites
You could use email for a game if you wanted to depending on the type. I've played diplomacy by email before. It *really* depends on the sort of game.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!