iOS Phone-to-Phone Connection

Started by
4 comments, last by ddn3 12 years, 3 months ago
I'm just starting into iOS development and was thinking of starting my first game. The first question that came to mind was whether or not I'd need a server for multiplayer. If I do, that might make things more difficult. Instead, I was hoping to find a way to use one device as a host and have the devices communicate directly. Is there a way to do this or do I have to use a server for multiplayer?
Advertisement
Some 3rd party libraries and Apples Game Center allows you to do this, which is called matchmaking. This allows you to pair up players without a dedicated matchmaking server, alleviating some of the backend burden. If your game requires a persistant server then, yes you'll need one but most games just assign one of the peers to be the "server"..

see :

http://stackoverflow...-using-game-kit
http://developer.pla...e/developer.php

Enjoy!

-ddn
Thanks for the feedback, but I was looking at something less like matchmaking and more like Words with Friends, wherein you play only with people that you already know. I was thinking of using facebook integration for that. What I really need to know is just how to send information directly from one phone to another, if that's possible. Sorry if I was unclear in my original post.
Sure its possible words with friends use a central server which stores the moves and the app just pings it to grab the moves which was uploaded by whoever turn it was.. That's my guess anyways. For an asynchronous multiplayer game like that you would need to store the moves on a server since you can't depend on having both players being active and one player servering at all times. For that you can just use straight up web server technology no need for anything exotic.

There are a few 3rd party library which will handle the hosting of these moves for you like these :

http://www.scoreloop.com/
http://openfeint.com/

I don't know if they integrate into Facebook already or not but it's worth checking out.

Good Luck!

-ddn
Though the game I have in mind is turn-based, it isn't exactly what I would call asynchronous. I think what I need to know above all else is whether there is a way for two phones to communicate over wifi or 3g that I could take advantage of in my game. I've been looking at Game Kit, but it seems to be emphasizing "close proximity." Could this leverage 3g or would the players actually have to be near each other?
Hmm well you would use the matchmaking server (provided by Game Kit or Play Phone) this will allow you to connect 2 devices to each other and start sending data. It's a complicated process, esp when people are behind firewalls, roaming, etc.. There are other ways to connect 2 devices such as direct ip on the same lan, by proximity through bluetooth, etc..

You can use Game Kits Auto-Match functionality to connect players together or you can use Play Phones web based solution..

Good Luck!

-ddn

This topic is closed to new replies.

Advertisement