Tag Info

Hot answers tagged

9

The algorithm posted was correct, but in your example you are forgetting about the time it takes for the server packet to get to the client, so: Server time: 1 Client time: 0 Client sends 0 to server ... 150ms to get to server (ping is 300! not 150ms in this case. Ping is round-trip) Server time: 1.15 Client time: 0.15 Server receives packet and sends ...


8

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

Off the top of my head, if negative scores are not allowed: track positive and negative scores separately. For instance, when writing the leaderboard: // Pseudocode points_for_win = 3; points_for_loss = 2; if (didWin) leaderboard.positive_score += points_for_win; else leaderboard.negative_score += points_for_loss; When retrieving the ...


5

Make it very easy to play again, and less easy to quit. For example, as soon as the game is over, display the user's current score and best score. Have them simply click the mouse (anywhere, not on a particular button) to play again. This will greatly increase the 'one more time' factor. Of course, the most important thing is for the game to be fun. ...


4

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

The general technique is for the the server to maintain authority, and send the game state updates to the client as rapidly as needed. The client maintains a local copy of the game state which it simulates itself, predicting that most of the time the server will confirm the input it sends. When the server game state and client game state differ, you adjust ...


4

You can include Game Center without limiting which devices can run your game. First you have to set the 'Base SDK' to 4.1 or higher and the 'Deployment Target' to the minimum you want to support e.g. 3.1.3. Then you weak link and use GameKit as described in the Apple docs about Optionally Using Game Center In Your Application.


4

You have to add a new App to iTunes Connect in order to use Game Center. However, all of the data can be bogus (it just needs to be valid) and you can change it later. Except for the App's name if I remember correctly. If you need to change that, you can still simply create a new App with the desired name, and then transfer the Achievements and Leaderboards ...


3

A high score list in which player can see their rank relative to other people may give some motivation. I am not sure if this works for your game, but it may be possible to collect stats like total number of right answers summing up all played matches. If you use an internet based high score list, it may be a good idea to split it into "recent players" and ...


3

If you just want to kludge a couple of quick game ideas together for online play, have you already looked at Starcraft 2's Galaxy Editor? It's the first thing that came to mind, since you already seem familiar with Warcraft III Custom Games. You can whip up a basic Starcraft 2 Melee map together in a few minutes, and that's a great way to learn the tool and ...


2

All that you need to do is store the game state somewhere persistent where all the players can get at it. For example in a database accessed via a web server. That server could also process each players turns on the game if you want it to (this helps prevent cheating). You can then easily control how long it stores the game state for. For example it would ...


2

First I am going to assume that that evaluation is going to be shown to the player, if so, I would enumerate all the accomplishments he had on that playing session, lets say winning a certain amount of virtual money, reaching a certain level, it can congratulate the player if it was the best game he played so far, and tell him he beat his previous scores. ...


2

Whenever I have network architecture questions, I refer to this wonderful document about how the Unreal Engine does it: http://udn.epicgames.com/Three/NetworkingOverview.html It's likely more than you need, but it's a great read and you'll likely be able to use concepts from it.


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 ...


2

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

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.


2

In general, the big disadvantage of the fixed window approach (Monday through Sunday) is that new players will need to work very hard to achieve a competing leaderboard count in that first week, relative to old players, unless they happen to start playing on the first day of your score tracking period). The disadvantage of the running window approach is ...


2

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 ...


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 ...


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 task endMatchInTurnWithMatchData:scores:achievements:completionHandler: in the GKTurnBaseMatch class. From the documentation about this method: ...


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 ...


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

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 don't think there is any way around this because the real weak link is the connection to Game Center. I faced that same problem as you have, so I encrypted all data saved to the device while it waited to be uploaded, yet, 1 day after my App was released, the high score tables were filled with bogus scores. Obviously the data has to be un-encrypted before ...


1

Finally I done.. I have use this blog tutorial And do some logic with turn base.. Only maintain in this game center needs Send and Receive.. Thanks all who be a part of that.. Thanks...


1

How you synchronize the games is going to be very different from game to game. You just need to figure out what both clients are going to need to send across, package that up, and send it. There are some turn-based game helpers in iOS 5 that you can use to send messages back and forth.



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