Jump to content
  • Advertisement
Sign in to follow this  
lefnirex

Web Service (not TCP/IP) for MMORPGs?

This topic is 4051 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

I'm not terribly familiar with web services (i've built a simple tutorial-taught WSDL getup, so i'm not unfamiliar). I was wondering if web services is fast enough to replace TCP/IP for an mmorpg? I can think of a structural paradigm in which web services could functionally serve that purpose-- I just don't know about performance.

Share this post


Link to post
Share on other sites
Advertisement
i guess i should have explained that paradigm in order to analyze performance ;)

first off, the reason i want to use web services is that silverlight doesn't support TCP/IP (MS, go figure). I'll stop developing in silverlight if i'm sufficiently convinced, but i've gotten pretty far so I don't want to turn back just yet.
What i was thinking is that each client would send a web request per game-loop update. instead of having a server application running all the mobs, NPCs, and game logic, there would be a web service that responds by storing/retrieving character data/positions to and from SQL Server, and sending that information back to the client. The mobs and NPCs will actually be its own running C# app that acts like just another client, sending its own web requests to the web service. Does that make sense?

Share this post


Link to post
Share on other sites
Hmm, lots of synchronization issues.

C = client
WS = web service
GS = game server

Now consider player attacking:

C -> WS -> GS -> WS -> C (all)


You have a 2 additional send delay before acknoledgment. Compared to traditional zone model:
C -> GS -> C(all)
-> Database


Why not just connect clients to game server, or build a C# frontend that does high performance client dispatching (the typical connection proxy), while all the rest of your cluster is hidden behind.

Just because you're using a browser doesn't mean that "web" services means anything - if silverlight doesn't support TCP/IP it can't use HTTP anyway, at least not in the usual way, and SOAP is incredible bloat.

Or perhaps I misunderstood something about silverlight and how it works. Seems odd that a browser plug-in wouldn't support HTTP.

Share this post


Link to post
Share on other sites
The problem is, WSDL and its buddies aren't designed for the kind of communication you're talking about. Normally, your client would keep a TCP connection going and pump stuff back and forth using a compact protocol... but the WSDL is more of a chunky data transfer idea. The service usually fronts a database or something. Also, there might be way too much overhead, since everything is marshalled into XML (or *maybe* JSON if you're lucky enough to have the option).

If you can get away with infrequent updates, you might be able to pull it off, but you would majorly be going against the grain of what it was designed for.

Share this post


Link to post
Share on other sites
Danger will robinson, Danger!

Web services are NOT adiquate for a real-time or semi-real-time MMORPG. ALOT of bloat, and im pretty dang sure your hosting service will pull you quickly, LOL. If not , the players of your game will. Lag is typicaly caused by slow ping times, so this will be.. well.. quite bad.

Im presuming your main problem is you cant afford a dedicated or semi dedicated host for your game? Build something similar to a "torrent tracker" to manage connected clients. Build a "banking server" which handles distributing objects to client run worlds. It will be a living nightmare to code, but it might work.

Share this post


Link to post
Share on other sites
Quote:
C -> WS -> GS -> WS -> C (all)

good call, i didn't even think of that.. lag from extra routing instead of slow routing.

Quote:
Just because you're using a browser doesn't mean that "web" services means anything - if silverlight doesn't support TCP/IP it can't use HTTP anyway, at least not in the usual way, and SOAP is incredible bloat.

Or perhaps I misunderstood something about silverlight and how it works. Seems odd that a browser plug-in wouldn't support HTTP.

hmm.... maybe i'm missing something about silverlight myself. i'll have to research it a bit more. Here's what I got on its web services:
Quote:

Microsoft Silverlight-based applications can communicate with a Web service by using managed code. An application can transmit and receive data to and from the Web service. The communication can be performed by using the System.Net.BrowserHttpWebRequest and HttpWebResponse classes. Data may be transmitted either synchronously or asynchronously.
from http://www.silverlight.net/quickstarts/Remote/default.aspx

Replicon, that's what I was afraid of... i was I wouldn't get an answer like that :) might have to scrap the silverlight plan

PaulCesar, *looks like a dear in the spotlight* um, i haven't started dealing with hosting yet, so i don't know if it'll be a problem or not. if it is, though, i'll remember to lookup what you said.

Share this post


Link to post
Share on other sites
Quote:

Quote:

Microsoft Silverlight-based applications can communicate with a Web service by using managed code. An application can transmit and receive data to and from the Web service. The communication can be performed by using the System.Net.BrowserHttpWebRequest and HttpWebResponse classes. Data may be transmitted either synchronously or asynchronously.
from http://www.silverlight.net/quickstarts/Remote/default.aspx

Replicon, that's what I was afraid of... i was I wouldn't get an answer like that :) might have to scrap the silverlight plan

PaulCesar, *looks like a dear in the spotlight* um, i haven't started dealing with hosting yet, so i don't know if it'll be a problem or not. if it is, though, i'll remember to lookup what you said.


HttpWebRequest is XML formatted, plain-text encoded, SOAP structured HTTP requst. A lot of layers over layers. And yes, it's TCP/IP.

What's worse, these requests don't need to maintain a connection, which may result in each query to issue a new request, possibly also opening a new connection.

Share this post


Link to post
Share on other sites
Quote:

HttpWebRequest is XML formatted, plain-text encoded, SOAP structured HTTP requst. A lot of layers over layers. And yes, it's TCP/IP.

What's worse, these requests don't need to maintain a connection, which may result in each query to issue a new request, possibly also opening a new connection.

I was definitely confused. haven't had much exposure to this networking business, and i think the question i should have asked is HTTP vs. strait-up sockets. Java (and i think flash) let me work with sockets, SL with httpwebrequest. sounds like httpwebrequest is a no-go for realtime then, eh?

Quote:
Also, there might be way too much overhead, since everything is marshalled into XML (or *maybe* JSON if you're lucky enough to have the option).
evidentally, it does support JSON, though that's probly no better in my case since i'm not using AJAX, right? i understand JSON to simply be a more javascript suited format than XML?

Quote:
Im presuming your main problem is you cant afford a dedicated or semi dedicated host for your game? Build something similar to a "torrent tracker" to manage connected clients. Build a "banking server" which handles distributing objects to client run worlds. It will be a living nightmare to code, but it might work.

ok, i think i just got what you were saying. genius. pure genius, but i'll have to go java in order to establish sockets between peer. can't use httpwebrequests in that instance, right?

Share this post


Link to post
Share on other sites
Original post by lefnirex
Quote:
evidentally, it does support JSON, though that's probly no better in my case since i'm not using AJAX, right? i understand JSON to simply be a more javascript suited format than XML?


While it's true that putting JSON into a javascript 'eval' call will create a proper structure, there ARE JSON bindings in other languages, specifically designed to replace big ol' XML :-). But that's kind of beside the point, since for a MMORPG, it still has the same kinds of issues.

Share this post


Link to post
Share on other sites
ok, i got one. this sounds silly, but hear me out.
Is it possible to setup a socket in flash and access that socket via javascript? i could go the javascript route through c# do do socket communication in my silverlight project.
so there would be an invisible flash div that sets up my socket that my c# uses. defeats the purpose, I know, but (1) grapevine says that SL will soon support sockets, and this would be an interim, and (2) otherwise, I can still stick to my .NET guns with just a little bit of straying, rather than having to learn flash.

i know it sounds stupid, but is it possible?

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!