Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


iOS Phone-to-Phone Connection


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 Darir   Members   -  Reputation: 100

Like
0Likes
Like

Posted 16 January 2012 - 02:52 PM

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?

Sponsor:

#2 ddn3   Members   -  Reputation: 1328

Like
0Likes
Like

Posted 16 January 2012 - 04:18 PM

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

#3 Darir   Members   -  Reputation: 100

Like
0Likes
Like

Posted 16 January 2012 - 08:01 PM

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.

#4 ddn3   Members   -  Reputation: 1328

Like
0Likes
Like

Posted 16 January 2012 - 11:18 PM

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

#5 Darir   Members   -  Reputation: 100

Like
0Likes
Like

Posted 16 January 2012 - 11:47 PM

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?

#6 ddn3   Members   -  Reputation: 1328

Like
0Likes
Like

Posted 17 January 2012 - 01:09 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS