12

Steven's comment is right: this is theoretically impossible to do. Luckily, in practice you can come close, which is how things like NTP work. For example, better than just sending a message out to 3 clients saying "start now", you can exchange a couple of ping messages beforehand to measure the time it takes to get a message to the client, and when you ...


5

You can only call [self presentModalViewController...] from a UIViewController (or one of its subclasses). In Cocos2d 2.0, the CCDirector is a subclass of UIViewController, so you can do something like: [[CCDirector sharedDirector] presentModalViewController...] (In previous versions of Cocos2d, I think you need to latch back to the RootViewController, ...


4

I think your only real option here is to create a new leaderboard and update your app. (I believe you can enable/disable specific leaderboards when updating the app.) The new app version would simply not use the old leaderboard, and enable the new one. The obvious downside here is the loss of previous high scores, but you should probably explain the problem ...


4

Why shuffle the deck in the first place? All clients know which cards were already played and which cards are still in the deck. What they don't know is the order in which they come. So instead of fixing the order at the beginning of the game, why not determine it during the game? Keep the deck as a sorted array and whenever a new card is needed, pick a ...


3

So, its a little weird, but... I used it once a number of years ago using Prime31's Game Center plugin. What it does is facilitate two (or more) copies of the game communicating with each other in a serverless multiplayer context. What that means is: one of the clients is also the server (they are the "host" and act like a server for all of the connected ...


3

What you've described is correct and commonplace. Ping times can vary widely though, so to get a more accurate result you can repeat the process a few times and take the average ping time as described on wikipedia.


3

As mentioned, this is impossible, so I'd try another approach: If you don't have a dedicated server, elect one participating client to become the host (this can be transferred if the need arises to). The host will now perform all important game logic, like hit detection, AI controls, inventory handling, etc. as well as time tracking (i.e. dictating game ...


2

I dont know the version of the sdk you are using, but in the latest version Game Center now support multiplayer games, witch means now Game Center can handle all data exchange. Take a look at this tutorial: How To Make A Simple Multiplayer Game with Game Center Tutorial: Part 1/2


2

You have to implement GKAchievementViewControllerDelegate protocol in your layer or scene. Declare your layer like this: @interface MyLayer : CCLayer <GKAchievementViewControllerDelegate> This will show the game center: - (void)showAchievements{ NSLog(@"Show achievements!"); AppDelegate *delegate = [UIApplication sharedApplication]....


2

I do not think you need to share leaderboards between sets to reach the 500 limit. Each leaderboard could be contained in only one set, for example. Later in the same document you quoted, it says "You can define up to 100 different leaderboard sets for your game. Each leaderboard set can contain up to 100 leaderboards with a maximum of 500 leaderboards for ...


2

For my game LowDown: A Social Experiment, I did this: The first time a user submits a number to a contest, there's a CAPTCHA to filter out bots. The server assigns the user a UserID, which is just the next index in the database table. It also assigns an invisible password (I call this a key; it's a randomly generated string). The client saves both the ID ...


1

Draco18s is mostly correct about the no-server limitations, but in fact GameCenter does allow multiplayer across the internet. I have released at least two games that use multiplayer via GameCenter on iOS and both are successful at playing with any opponent, regardless of where they are. You simply start a multiplayer game and either choose a random opponent(...


1

You should go with the recommended method of authenticating as soon as possible. The annoyance of not being logged in is not as big as you think it is. Authentication is persistent across games. This means, your customer is likely to be signed in already using another unrelated game. From the documentation: Because a player stays authenticated until they ...


1

I've found a solution to this problem. Note: this will be a relatively long answer. One thing that I did implement was the use of udp for some of my data transfers that are not as critical as others. For example, since I'm sending movement data about 10 times a second, I figured its ok if 1 or 2 of the 10 get lost once in a while. Now to the actual ...


1

just use gameCenterController for dismissing. [gameCenterController dismissViewControllerAnimated:YES completion:nil];


1

Well, any time you need persistent data that usually means you need to write it to a file. What I would do, is make a dictionary of dictionaries and write that to a file. The main dictionary will hold the keys of each username, and the value fields will hold the high scores in a dictionary. That is, assuming you have more than one high score per user, ...


1

You actually want unreliable messages not reliable ones. The reason is that if a retransmission occurs then your timings can be significantly out. Just repeat the unreliable process until it works. There's a standard protocol for doing this called NTP which may be of some interest, although it may be overkill for a game.


1

You say turn-based, but haven't used the magic word "asynchronous". (The question is, will the players be able to leave the match and return again later when it is their turn? I'd imagine you want the answer to be yes.) You are right about the max number of players limitation in GameCenter. (16 for asynchronous matches, I'm not sure about real-time.) I ...


1

It would be useful to know how far in the process you are. If you haven't already registered your app and set up your leaderboards and achievements through iTunes Connect, then you should read through this tutorial. If you have, then let us know exactly what you're stuck on.


1

As of iOS 7, it is now possible to submit scores for multiple players from one device. However, an app can do so only when ending the game, using the method -endMatchInTurnWithMatchData:scores:achievements:completionHandler: in the GKTurnBaseMatch class. From the documentation about this method: endMatchInTurnWithMatchData:scores:achievements:...


1

With GKTurnBasedMatch all communication is done between the device and the game center serves only, there's never any direct communication between two devices. You don't actually need two devices, you only need two different game center accounts. (Although testing with a single device would be a pain.)


1

I think the inconsistency is due to the fact that the server-side scores are not updated in real-time upon submission, because I came back to check after a day, and found out that the the scores were consistent.


1

Here's a few ideas: Create a separate leaderboard for each difficulty level. You might also want to consider having second set of leaderboards which auto reset say once a month. I'd be tempted to use something like an Elo system for ranking. That is you start with a fixed number of points, and gain or lose a variable number of points based on the difficulty ...


1

Make sure your resource bundle id is the same as the iTunes Connect app you submitted...but my guess is you haven't done this? https://developer.apple.com/support/resources/itunes-connect.html


1

I know this answer is a little late, but... Game Kit is the name of the framework that you use to add support for Game Center in your game. Game Kit is the developers interface to Game Center. You can read more about this here: http://developer.apple.com/library/ios/#documentation/NetworkingInternet/Conceptual/GameKit_Guide/Introduction/Introduction.html


1

I recommend synchronizing system timers on all clients and the server by means of NTP [Stratum 2] protocol, then the server sends a command to start the game at specified time, say, when all the timers reach 0:05:00. This approach should give you 3-4 ms accurate synchronization, I believe.


Only top voted, non community-wiki answers of a minimum length are eligible