Skip to main content
GameDev.net gamedev.net
🔒 Locked

Browser-Multiplayer-Game?

Started by VanKurt Jan 16, 2005 at 3:25 AM 9 replies 1.8k views
Original Post
VanKurt
VanKurt
Hi there! I just wanted to ask what possibilities there are to create (more or less simple) multiplayer-browser games? What I mean are semi-realtime-peer-to-peer games, like chess or card games. I've seen lots of this stuff done in flash but since I'm a C++/Java guy I'd rather do that in &#106avascript or an applet (what's the difference?). But actually I never worked with stuff like that so I don't know if that's even possible? Please tell me about your expreiences! What do you think? Thanks a lot!
snisarenko
snisarenko
I've played an online , multiplayer , flash street fighter clone. So pretty much anything is possible(as long as its not too complex or graphics intensive).

EDIT: Stree Fighter Online
markr
markr
I disagree entirely. &#106avascript is quite good for writing simple games that don't have intensive graphics (Until we have native SVG scripting support, anyway). Here's one I made earlier.

The only obvious snag I can see, is the lack of ability to do "server push". Let me explain:

Requests can be sent to the server quite easily in client-side script, using the XMLHttpRequest object (which is almost identical between IE and Mozilla; Safari and Opera may also support it). The name is misleading, because it isn't limited to XML - in fact any type of request / response can be used (Although XML responses are slightly easier to process because it can also build a DOM for you).

"Server Push" is where the client makes a connection to the server, and instead of sending a request and expecting an immediate response, it waits for unsolicited information from the server. An example of an application for this would be a turn-based game, while waiting for the other players' turns.

As soon as another player has a turn, the information would come back.

The only way of "faking" this using XMLHttpRequest is to make a persistent / blocking HTTP request, which is rather ugly (and potentially doesn't work nicely with proxies). Most ISPs use transparent HTTP proxies for all port 80 HTTP requests.

So the only way of faking it is to say "Get me something..." and have the server block until something happens, or for a specified amount of time. Then if nothing has happened, the client gets a "nothing has happened" message, and immediately makes a new request again. This is to stop a timeout condition, which would otherwise break at the client / server / proxy level after a while (30s - 1min)

I think Mozilla may support server-push for XMLHttpRequests. But I'm still not convinced about how friendly this is towards HTTP servers or proxies (especially if there is a long delay, they may get bored and timeout)

---

&#106avascript is not to be confused with Java applets - they're completely different.<br><br>Although the Applet API is rather ugly and has some bad cludges in it, it is usable and some companies very successfully use it - look at Popcap.com for instance. Their games are all written in Java and they have free versions which play in the browser. They all work and have moderately complex interfaces and nice graphics - this is because they've obviously got their own more sensible API they've layered over AWT.<br><br>Mark
markr
markr
Ok, anonymous coward, what do you think Popcap.com are doing? There is nothing in the applet interface that cannot be worked around.

I was not presenting &#106avascript games as an alternative to native code C++ games, but rather a nice easy way (for the user) to get simple games workingo n the web.<br><br>Are you a total idiot or what?<br><br>Mark
hplus0603
hplus0603
Most simple browser games are probably written in Flash (although I don't have actual statistics to back that up). Another option is to write an ActiveX control, and screw the Mac/Linux people ;-)
enum Bool { True, False, FileNotFound };
ProcedureX
ProcedureX
CGI + Procedural C + IIS 5.1 == [cool]

Edit: hplus, you must explain your avatar to me!11 [razz]
redmilamber
redmilamber
Quote:
Original post by markr
Ok, anonymous coward, what do you think Popcap.com are doing?

Mark


Amongst other things: moving away from applets and into native compiled code or non-java x-platform stuff, last time I looked. Because the applet maintenance and support costs were too high. At least a third of the games I couldn't play because I wasn't running the right OS + plugins.

Maybe they've gone back to 100% applets again by now?
hplus0603
hplus0603
My avatar is a small section of the sector map for our main cluster, as of about a year ago.
enum Bool { True, False, FileNotFound };
VanKurt
VanKurt
Hey, c'mon! We're one community - we're all friends and love each other ;-)
I decided to use JAVA and WebStart. Thank's a lot for your ideas and comments!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.