Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm just doing a bit of research into tech to use for a mobile multi-player game.

It's more an experiment at present so for the moment, the only thing that Players need to be aware of is the other Players.

If this was a typical web application and not a game It'd just have HTTP requests firing all the time -- but since this is a game, performance and accuracy is going to be a problem.

Due to the game being targeted at multiple phone platforms, lets say that the client will be written in JavaScript or a framework based on JavaScript. The server technology is totally open.

Each player will need to make the equivalent of a HTTP post and get only using a faster protocol. The reason for multiplayer being web based is because multiplayer across Bluetooth or other local networking would be too diverse across the platforms and could cause problems.

So the question boils down to whats a good protocol/technology to use for JavaScript multiplayer? Any advice on the server side stuff or does it matter? Any reason I should drop this two-tier architecture and go with direct phone-to-phone connection?

share|improve this question
add comment

2 Answers 2

up vote 12 down vote accepted

You want a better communication protocol then HTTP. You probably want UDP or TCP. Browsers have no way of doing UDP communication so your only choice is TCP.

For TCP you would want to use a WebSocket, however browser support is unstable on websockets.

This means you would need to use a COMET technique to emulate TCP, one popular emulation would be a websocket embedded in a flash application.

Socket.IO is a library (for node.js) that supports websockets and emulates them with an appropiate fallback on non compliant web browsers (it uses flash and other COMET techniques).

For multiplayer JavaScript games I would recommend the usage of socket.io and node.js

share|improve this answer
1  
Here's a sample of a real-time game made with HTML5 & WebSockets: rawkets.com. The source code is available here: github.com/robhawkes/rawkets –  Elisée Oct 10 '11 at 13:45
1  
Here are two more examples –  Raynos Oct 10 '11 at 13:56
add comment

Check this:

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.