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've created a little game on Android. Now, I want to add a multiplayer mode which works with bluetooth or WiFi, so you can play together with other "smartphones" in your neighborhood . Which is the best way to offer a fast, good working mulitplayer mode that supports so many devices as possible? I heard about Alljoyn, but Im not quite sure if it fits my needs. Which way do you recommend?

regards Lisa

share|improve this question

1 Answer 1

I would consider the requirements of your multiplayer experience. For a quick two week prototype I put together a couple months ago, I was on the ropes about whether or not to support TCP/WiFi connectivity between devices, or simply go with bluetooth. I chose to go with bluetooth due to the reliability of it in comparison with the local network I was dealing with, and the simple data format I was sending (XML). I wrote the bluetooth connectivity using the native android SDK, and was able to get it up and running within a day or two.

Additionally, consider whether or not you will be hosting the game externally, or requiring one of the devices to act as a host. If you plan on having more than a couple of devices connected at once, you may want to consider an external service (or at least extra device) dedicated to managing connections and processing requests.

edit also, bluetooth has very limited physical range, thus that may eliminate it as an option immediately.

share|improve this answer
    
hmm, are there often reliability problems in Wifi connections (is it a serious problem ? Because bluetooth strains much more the engegy resources than Wifi )? PS: native Android SDK means proberbly the SDK not the NDK, right? –  Lisa Vey Apr 7 '13 at 19:32
    
You will encounter more reliability issues with wifi and tcp than you will with bluetooth, but thats just because you are using a network controlled by other devices, and sharing bandwidth. In the right situation, too many people downloading on the same LAN can cause for less than spectacular performance. Yes I meant the SDK, as opposed to using a third party library. –  Evan Apr 7 '13 at 23:40
    
Ok , just an other last question: Whats about security ? Do I have to use encoding/authentication to prevent security leaks on the user's phone? –  Lisa Vey Apr 10 '13 at 14:27
    
Ultimately, the data will be transmitted using an unencrypted protocol whether you use TCP or bluetooth. If you would like encrypted data transfers across public domain protocols like this, then you would have to encrypt the data yourself at the application layer before it is wrapped for transmission. –  Evan Apr 10 '13 at 14:30
    
But do you think it is necessary to encrypt data or to use secure communication for multiplayer-games at all? –  Lisa Vey Apr 10 '13 at 18:57

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.