Sign in to follow this  
chichchoe81

Web service or socket for Real time Combat

Recommended Posts

chichchoe81    100
Dear All,I have developed a strategic web game online include real-time combat in Silverlight framework. I plan to use web service for communication between server and client, but is this possible for real-time combat or I have to use additional socket method for combat. Each combat will have maximum about 10 player.
Could you please help to give me some advise since I am not professional in network programming. Thanks in advance.

Share this post


Link to post
Share on other sites
SimonForsman    7642
[quote name='Chichchoe' timestamp='1312946846' post='4847009']
Dear All,I have developed a strategic web game online include real-time combat in Silverlight framework. I plan to use web service for communication between server and client, but is this possible for real-time combat or I have to use additional socket method for combat. Each combat will have maximum about 10 player.
Could you please help to give me some advise since I am not professional in network programming. Thanks in advance.
[/quote]

It depends on how realtime "realtime" is.

In general you want to use sockets to avoid the insane amount of overhead you get with HTTP requests. (Bandwidth is expensive and having the client open a connection, download a document, parse it, etc for each update isn't very efficient either)

Share this post


Link to post
Share on other sites
frob    44911
[quote name='SimonForsman' timestamp='1312953260' post='4847038']
[quote name='Chichchoe' timestamp='1312946846' post='4847009']
Dear All,I have developed a strategic web game online include real-time combat in Silverlight framework. I plan to use web service for communication between server and client, but is this possible for real-time combat or I have to use additional socket method for combat. Each combat will have maximum about 10 player.
Could you please help to give me some advise since I am not professional in network programming. Thanks in advance.
[/quote]

It depends on how realtime "realtime" is.

In general you want to use sockets to avoid the insane amount of overhead you get with HTTP requests. (Bandwidth is expensive and having the client open a connection, download a document, parse it, etc for each update isn't very efficient either)
[/quote]

I don't think you understand the nature of a web service. The idea that somehow he should "use sockets to avoid the overhead" seems to show a complete lack of understanding.

They are not inherently problematic. It would be unwise to close your connection each time, and few web service systems do that. You can keep a persistent connection with a web service. You can keep your transactions small with a web service. There is no reason to have a verbose text-only or xml-wrapped web service that is usable only to full-featured web browsers. In the business world there is a very high adoption rate of systems that rely on remote data sources very similar to those we use in games.

It is not particularly difficult to implement a low-latency, low bandwidth communication protocol as a web service. Many people have done it. It is irrelevant to the description of "real time", since with intelligent engineering the overhead can be quite small, even better than some game protocols I've seen in shipping titles.


At the OP:

You need a design.

You need to know what transactions need to come over the wire, you need to know who owns what data, understand how requests work and how you plan on processing responses, how to handle cases where the data does not match what you expect, and more.


After you have a design that says what data you want and when you want it, then you can pick a communications system that meets that goal.


Since you say you wrote "I am not professional in network programming" I would recommend you use an existing library for network communications. There are many problems to solve and hurdles to jump in network programming, and the existing libraries have already done much of that work for you. See the FAQ for a list of many libraries that may suit your needs.

Share this post


Link to post
Share on other sites
oldbard    101
Can you name some of those libraries? I also have had the same question in working on a multiplayer action game... http://celtruler.com/games/thegrid/ [Click the link on the top-left]

Share this post


Link to post
Share on other sites
hplus0603    11347
[quote name='oldbard' timestamp='1313469318' post='4849700']
Can you name some of those libraries? I also have had the same question in working on a multiplayer action game... [url="http://celtruler.com/games/thegrid/"]http://celtruler.com/games/thegrid/[/url] [Click the link on the top-left]
[/quote]

Did you check the forum FAQ? It lists a number of libraries. You can find the link at the top of the forum topic listing page.

Share this post


Link to post
Share on other sites

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

Sign in to follow this