iOS iOS multiplayer development

doadam

macrumors newbie
Original poster
May 6, 2013
23
1
Hey,

I just bought a Mac Mini and I want to develop a multiplayer game, and I would like to ask a few questions.



1) Game Center or a standalone server? currently when playing a "PvP" game with game center I experience high amount of lags and the game is almost unplayable (unless it is not real-time) but my game is going to be real-time.

Also, what about p2p? I'm a little afraid this is an issue over 3G as mobile companies don't really allow port-forwarding, is there any other way it would be possible?

2) Should I wait till sprite-kit gets public? or start developing the game with cocos2d and Box2D? the game itself isn't so complicated and will probably be 2D.


Sincerely,
Adam.
 
Last edited:

dantastic

macrumors 6502a
Jan 21, 2011
569
645
1) Write your code in such a way it will be easy to switch between. Start by implementing game center, it's simple enough, and should it be too laggy you can then work on your own service.

2) I've had a bit of a play around with sprite kit and I must say me likey. It really ticks all the boxes. There is nothing stopping you starting with sprite kit already now. I'm guessing from what you've said you are pretty new to obj c anyway.
 

doadam

macrumors newbie
Original poster
May 6, 2013
23
1
1) Write your code in such a way it will be easy to switch between. Start by implementing game center, it's simple enough, and should it be too laggy you can then work on your own service.

2) I've had a bit of a play around with sprite kit and I must say me likey. It really ticks all the boxes. There is nothing stopping you starting with sprite kit already now. I'm guessing from what you've said you are pretty new to obj c anyway.
Yes indeed, I've been learning objective-c for last than 1 week, but I have past experience with lots of other programming languages which seem to be more and more similar to Objective-C...

About game center, wouldn't it be a waste to implement the game to work with game center while I'm sure it won't be good enough?


And forgot to mention, I didn't (obviously) yet bought the developer account for 100$... Is there any other way I can get Sprite Kit framework without the account?
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
8,575
4,005
Yes indeed, I've been learning objective-c for last than 1 week, but I have past experience with lots of other programming languages which seem to be more and more similar to Objective-C...

About game center, wouldn't it be a waste to implement the game to work with game center while I'm sure it won't be good enough?


And forgot to mention, I didn't (obviously) yet bought the developer account for 100$... Is there any other way I can get Sprite Kit framework without the account?
You can wait until it comes out of beta later this year or you can pony up the $100. I generally advise against paying so early in - I would say that games are generally the most complicated type of thing you can program, so you should probably learn Objective C and the non-beta frameworks for now. That'll probably keep you occupied up until sprite kit is out of beta, then you can develop your game for the simulator for free and save yourself the $99 until its time to test on a real device.
 

dantastic

macrumors 6502a
Jan 21, 2011
569
645
Game center is so simple to implement that it will quickly get you going. If you are going to create your own services and everything it will probably take a few days but with game center you will be up and running within the hour. Sure you have "wasted" an hour but then you're on to building your game and not trying to figure out the best way of authenticating new players or something like that...

I've written a few bits of cocos2d and it's great but unless you're proficient in cocos2d already I personally wouldn't feel it would make a whole pile of sense to be trying to learn that now. There are many pain-in-the-you-know-what with cocos2d that spritekit have taken care of for you.

if the $99 is an issue for now just hold on and learn some objective c for the time being. Figure out how game center works and see if it maybe meets your needs.
 

dejo

Moderator
Staff member
Sep 2, 2004
15,981
447
The Centennial State
1) Game Center or a standalone server? currently when playing a "PvP" game with game center I experience high amount of lags and the game is almost unplayable (unless it is not real-time) but my game is going to be real-time.
What services of Game Center are you hoping to take advantage of in your real-time game?
 

doadam

macrumors newbie
Original poster
May 6, 2013
23
1
Thank you everyone for your replies.

About the learning process, more or less I can see how I build this project so I think it would be fine. I've finished the "Objective-C Programming guide" Apple provides (it teaches the basics) but have no knowledge of the "advanced" APIs. I guess making the connection to the server and handling the graphics are the most complicated issues in my project. However I read about the NSStream and it should be good for my needs (just need to learn how to integrate SSL to it and I'm done).

And about Sprite kit, as I said before, I will probably keep this part for the end.

What services of Game Center are you hoping to take advantage of in your real-time game?
I'm not completely aware of the features Game Center provides, but as I saw on other apps - it gives you the possibility to make a real-time matches (such as in Fruit Ninja for example). However, never have I played a game via Game Center without experiencing lag issues.
 

dejo

Moderator
Staff member
Sep 2, 2004
15,981
447
The Centennial State
I'm not completely aware of the features Game Center provides, but as I saw on other apps - it gives you the possibility to make a real-time matches (such as in Fruit Ninja for example). However, never have I played a game via Game Center without experiencing lag issues.
I would suggest you do some more research into Game Center, then, as well as GameKit. Only once you better understand the functionality they provide can you decide whether they are applicable to what you are trying to build.

Game Center Programming Guide
 

doadam

macrumors newbie
Original poster
May 6, 2013
23
1
I would suggest you do some more research into Game Center, then, as well as GameKit. Only once you better understand the functionality they provide can you decide whether they are applicable to what you are trying to build.

Game Center Programming Guide
Game Center is actually fine for my needs. the problem is that it's way too much laggy for me. I've been playing games on iOS for two and a half years and I found all the real-time games who use Game Center a complete useless and I've never found a stable real-time game that uses Game Center as it's provider.

and it's not just me, it's also for all of my friends, and we're on the same\different mobile carrier so it's not a specific-phone issue.
 

Duncan C

macrumors 6502a
Jan 21, 2008
853
0
Northern Virginia
Game Center is actually fine for my needs. the problem is that it's way too much laggy for me. I've been playing games on iOS for two and a half years and I found all the real-time games who use Game Center a complete useless and I've never found a stable real-time game that uses Game Center as it's provider.

and it's not just me, it's also for all of my friends, and we're on the same\different mobile carrier so it's not a specific-phone issue.
It's likely a latency issue. Realtime game play is very sensitive to latency. I wonder if it's game center, or cellular network latency overall.

You could try using sockets directly, but that opens a huge can of worms for you to deal with. Firewalls make it really hard to open socket connections between 2 devices on arbitrary networks. Plus, users can change IP addresses mid-stream. (Moving back and forth from cellular to WiFi)
 

doadam

macrumors newbie
Original poster
May 6, 2013
23
1
Ok. I learned some basics and some cocos2d & box2d features... not really advanced stuff but a bit more than just the basics.


Regarding Sprite Kit, Should I buy LevelHelper? or wait for Sprite Kit because it has it's own Level Editor\won't support LevelHelper's format\whatever reason. (I have no access to Sprite Kit as I did not enroll for the developer program yet).
 

dejo

Moderator
Staff member
Sep 2, 2004
15,981
447
The Centennial State
Regarding Sprite Kit, Should I buy LevelHelper? or wait for Sprite Kit because it has it's own Level Editor\won't support LevelHelper's format\whatever reason. (I have no access to Sprite Kit as I did not enroll for the developer program yet).
Just be aware that SpriteKit is still under NDA and many developers will be reluctant to violate that in order to answer your query.