Graphics and Games • iOS, macOS, tvOS, watchOS • 23:32
Apple’s social gaming network is ready to play. We’ll walk you through the latest updates to Game Center, starting with its in-game interface and all-new player experience. Learn how to integrate GameKit into your app and authenticate players effectively, and discover the Access Point, which brings players into the in-game dashboard. From there, we’ll explore player profiles and their options for privacy. After exploring Game Center’s interface, Dashboard, and player profiles, continue to the next video to learn about Leaderboards, Achievements, and Multiplayer gaming. And for more about preparing your game’s interface for these new capabilities, see “Design for Game Center.”
Speakers: Ally Kazmucha, Udayan Kale, Christy Warren, Jonathan Ellenbogen
Downloads from Apple
Transcript
Hello and welcome to WWDC. Hi, I'm Ally. I'm the engineering program manager for Game Center. I'm super excited to talk to you about not only what's new, but to also walk you through some updates to existing features that we think you and your players are really gonna love. Throughout both sessions, we'll touch on all the core features of Game Center. At the end, we hope you walk away equipped with the tools you need to add Game Center support to your game.
But before we get to details, let's take a minute to talk about what Game Center is and what it offers you and your players. Game Center is Apple's own social gaming network. It offers a single identity for players to use across all their games. And once signed in, they can instantly access their Game Center network of friends. As a developer, you can implement as many or as few Game Center features as you'd like. It's really about what makes sense for your game.
Leaderboards are a good place to start if you're new to Game Center. They let your players see how they stack up against friends and other global players. And as players progress through your game, why not reward them along the way? Achievements are a great mechanism to do just that.
They also encourage players to come back and keep playing. And if your game is more fun when played with others, you can also use Game Center to create rich multiplayer experiences. Most of Game Center's functionality can be added within your own custom-built UI. Or you can take advantage of the native Game Center offering, which has been completely refreshed this year. That's what I'd like to walk you through now. To do that, let's jump into a game.
Upon launch, the Game Center welcome banner will still appear. But once it rolls away, a new element appears. This is the Game Center Access Point. At a glance, I see some useful highlights, like how many achievements I've earned and where I stand in the leaderboards, all without any action on my part.
Once the highlights finish displaying, the Access Point collapses into my player avatar. This element is meant to remain on your title screen as a consistent way for players to access Game Center. To add Access Point functionality within your game you'll need to adopt the Access Point API. This lets you choose what corner to position it in and whether or not you want to display highlights to the player. Christy will cover Access Point implementation in depth a little later. But for now, let's tap on my player avatar.
This takes me to the in-game dashboard-- a centralized location for players to browse and interact with Game Center. From here you have quick access to existing features, like Leaderboards and Achievements. But as you've probably already noticed, the biggest change is the addition of a new section that offers in-game access to your Game Center player profile. But before we dig into that, let's talk about the main dashboard for just another second.
To give your players access to the top-level dashboard, you can adopt the Dashboard API. Your player will then be able to choose what section they want to explore. If you already link to specific sections of the dashboard in your game, don't worry-- those will continue to work as well.
For example, if you link to an individual leaderboard somewhere within your UI, we'll still take you directly to it. Top-level highlights within the dashboard are also new in iOS 14. These are little bits of information that are meant to offer useful stats at a glance. You'll see similar highlights throughout each section of the dashboard, so let's continue to drill in.
Tapping on the first section of the dashboard brings me to my own player profile. Right away I get some useful stats about my overall game play. I can view and edit my friends list or see a list of players I've recently been matched with. I'm also offered some friend suggestions here.
And if I see one I like, I can tap on "invite" and send that person a friend request. All of this can be done without having to leave the game. Scrolling further, I now have a way to view the achievements I've earned across all my games. And if I want to change something within my profile, like my nickname or avatar, I could tap on Profile Settings. I'm pretty happy with my profile, though, so let's go back to the dashboard.
Next up is Achievements. Right away, I'm greeted by the achievements I've already completed. This is a great way to let the player feel a sense of accomplishment. Scrolling a little further, here are the achievements I've yet to earn. And if the game has implemented in-progress achievements, like this one has, I can tell how close I am to earning it. Notice that the artwork you choose to use for achievements is prominently displayed. We'd encourage you to check out the "Design for Game Center" session as well the Human Interface Guidelines for guidance on how to create great achievement art.
Both will cover best practices for creating all kinds of assets for your game. And later on, Dersu will walk you through exactly how to set up different kinds of achievements within your game. Let's move on to Leaderboards. Just like achievements, the artwork associated with your leaderboards is now the center of attention. So it's a great idea to use different assets for each one. This is an opportunity to help the player better recognize which leaderboard they're looking for. The design session I referenced just a second ago also has details on creating great leaderboard art.
Tapping into an individual leaderboard, the most obvious difference is the addition of a friends-only leaderboard. This is now the default and makes it much easier for players to see how they rank amongst their friends. I could also view global and recent leaderboards if I want by changing views at the top.
But while we're on the topic of friends, I can also tap on a friend within a leaderboard. This brings up their player card. And if that friend has chosen to share their info, I can see what they've recently played as well as their achievement progress. The best part is player cards are accessible in lots of new places.
I can see this same information in my friends list and even while browsing the App Store, which we'll talk more about in just a bit. Returning to the leaderboard, perhaps the largest change is the option to create a recurring leaderboard. This leaderboard is set to recur every 15 minutes, and I'm currently only in fourth place. That's okay-- scores will reset shortly, and I'll have another chance to come out on top.
Notice that I can see my standing not only in the current leaderboard, but in the last iteration I played in as well. Recurring leaderboards can be set up within App Store Connect, similar to classic leaderboards. Later on, Udayan will be walking you through how to configure both types.
Returning to the dashboard one last time, the final section to check out is actually an optional one, and that's Challenges. We only made one change this year, but it's one worth calling out. The Challenges feature now lives behind a new opt-in flag within App Store Connect. By default, the Challenges section of the dashboard will not appear within your game. However, if this is a feature you support and would like your players to continue to have access to, simply check a box in App Store Connect and you're good to go.
Now, let's move on to a different area of Game Center, and that's multiplayer. Game Center can be used to create both real-time and turn-based multiplayer experiences. During implementation, you can choose the one that fits best within your game. The other choice to make is whether you want to use your own multiplayer UI or the default Game Center one. To help you decide, let's take a look at the native experience.
Choosing the multiplayer option from the main menu brings up the new UI. As you can tell, the colors of the game underneath really show through. This is meant to make the design feel at home within any game with no additional work from the developer. Now let's set up a game the way a player would.
At the top, I can adjust how many players I want to add up to the developer-specified limit. For this example, let's choose three. Within each slot, I can tap on "Add Player." This will bring up the player picker. This is where I choose the people I want to play with. If nearby players exist, they'll appear at the top.
Or what I tend to do most often-- I can choose to play with an existing Game Center friend. We'll also offer suggestions based on people you've recently played with or recently contacted on your device. Coming back to the main screen, I don't have to fill all these player slots in if I don't want to.
Any slots I leave blank will automatically be auto-matched. And now I'm ready to start the game. Look how easy that was. No join codes, no friction-- just set up and play. And that's a quick overview of the new multiplayer UI. A little later on, Christy will walk you through in more detail.
Now that you've seen an overview of what Game Center has to offer, I want to spend just a few minutes talking about some new ways we think Game Center can help players discover new content. And there's no better place to start than within the App Store. Now, when browsing popular areas of the store, like the Arcade and Games tabs, players can better discover what their Game Center friends are playing.
We're also integrating this same information right into your game's product page. I can even view a friend's player card right within the App Store. From there, I can check out more of their recently played games and download any of the ones that look interesting to me. We think this will give players a convenient way to discover new games they may have otherwise missed. Now, let's start diving into details.
Here's a look at how the rest of the sessions will break down. To get started, Udayan is going to show you how to implement the Dashboard API within your game. After that, Christy will cover adding Access Point functionality... followed by players and friends, where Jon will show you not only how to enable Game Center, but also how to properly interact with the local player and more.
And this will bring the first session to a close. To kick off part two, Udayan will be returning to show you how to set up both classic and recurring leaderboards. In the achievements section, Dersu will walk you through the different types of achievements, how to set them up, and how to ensure they're reported accurately.
Finally, Christy will talk about multiplayer functionality and what's new there. But to get you started with Dashboard, I'd like to now turn it over to Udayan. Thank you, Ally, and hello, everyone. My name is Udayan Kale. I'm on the Game Center engineering team. In this part of the session, we will take a deeper look at the Game Center dashboard.
Ally just showed you the new Game Center dashboard. I will now show you ways to invoke the main dashboard and each dashboard section from within your game. The new Game Center dashboard is a consistent, one-stop UI for many Game Center features. It allows you to access the local player's profile, leaderboards, achievements and challenges. All these features are provided to you through the familiar GKGameCenterViewController class.
Here is an example of using the dashboard. It uses the same GKGameCenterViewController class that you are probably using today. The main difference is how you initialize it. For most games, we recommend using the main dashboard view. You can see here, when I initialize the view controller, I'm specifying the dashboard state. This gives you the main view that you see here on the right. Another option is to go directly to a specific section of the dashboard. You can go right into the leaderboards, achievements, challenges or the local player's profile.
All you need to do is set the state to the one you want. So here is the Achievements section. You can see I have earned three achievements so far, and I can browse through the achievements to see which ones are remaining. Or here, I have chosen to go straight to the player profile view.
I can look at friends, people I have played with, and access my profile settings. All of this is up to you. You can also deep-link directly to a specific leaderboard. For this, you just provide the leaderboardID along with the playerScope, global or friends, and the timeScope, all time, this week or today, and present the view controller.
And regardless of which section you start them in, your players will be able to navigate to any available section on their own. So that's all it takes to adopt the new dashboard. We wanted to make it easy for you to move your apps onto this right away. Now let's talk about the new Access Point. And for that, let me welcome Christy. Thank you.
Thank you, Udayan. Today I want to talk about Access Point-- a great new way to let your players view and manage their Game Center data right within the game. As you can see, there is now a small button in the upper left with your avatar in it. Tapping this button will take the user to the in-game dashboard. This button can be placed in any corner that you choose. Additionally, there are options to show highlights, including the number of achievements earned or your rank on the default leaderboard.
Ally has already showed you what this looks like from the player perspective, so now let's take a look at how to adopt Access Point within your game. So first, I will cover some configuration options that let you specify position, content and so forth. Then I will talk to you about how to display Access Point as well as some behaviors around this. Next, there are some properties you can observe to know when you are presenting Game Center and to adjust your layout. And finally, we will cover some considerations for Apple TV and game controllers and how to trigger the Access Point programmatically.
So, let's talk about positioning. By default, Access Point is placed in Top Leading, which is the upper-left corner. However, Access Point is flexible, so you can place it in any corner of the screen that best suits your game's UI. The positioning of Access Point will depend on your language setting. So in languages like Arabic and Hebrew, Top Leading will appear on the top right, Top Trailing on the upper left, and so forth on the bottom from right to left.
Access Point allows you to choose which highlights you wish to display. You can choose to show just the avatar or show highlights, including the number of achievements you've earned or your rank on the default leaderboard. So here's how to configure and show the Access Point. Typically you want to display Access Point while you're on your main menu. So first, I want to set the location to be top left. Now, I set Access Point to showHighlights, and finally, I set isActive to be true in order to activate it. Please notice that all of these calls are to a shared singleton off of GKAccessPoint.
As I just showed in the code, we recommend that you show your Access Point when presenting your main menu. You should hide the Access Point in situations like cinematic intros, game play or your Settings screen. Our design team has put together some best practices for when to show and hide Access Point, so I suggest you check that out. Now, if the player taps Access Point, they will be taken into the dashboard.
While that is happening, you may wish to pause your menu animations or whatever. We provide a property, isPresentingGameCenter, that you can use for this. So here, I'm setting up an observer to keep an eye on that. And based on this property, I'll pause or un-pause my game. In this case, the Access Point overlaps the moon in our sample app. So we provide a property, frameInScreenCoordinates, which can be used to adjust the layout of your UI.
In this case, we use the frame to shift the artwork out of the way. This can also be observed as the Access Point progresses through each of its highlights. Let's show you what this looks like in code. Here I am observing the property, and when a change happens, I grab the frame from our singleton, convert it to my view's local coordinates and adjust the layout.
Another use for frameInScreenCoordinates is for games using controllers or on Apple TV where you track the remote directly. As you can see, as the user navigates through the menu of our game, the game draws its own custom feedback. Here you can use frameInScreenCoordinates to draw focus feedback when the user navigates to the area behind the Access Point.
Here's what this looks like in code. The first part's similar to our previous code where we get the screenFrame for the Access Point and convert it to myView coordinates. Then I toggle focusFeedback based on whether or not the tracking position is inside the frame of the Access Point. To finish this, we need to do one more thing. When the user selects the accessPointElement, they call our programmatic API, triggerAccessPoint, to show the dashboard.
In closing, I've given a quick tour of Access Point and gone through the API used for adoption, including configuration, activation, observable properties and programmatic activation. Now let's hand it off to Jonathan Ellenbogen. Thanks, Christy. I'm Jonathan Ellenbogen. I'm on the App Store team. I'm going to talk to you about players, friends, and getting started with Game Center.
Let's start with players. Just like in a game, Game Center refers to users as players. Game Center uses players to track scores, achievements, build leaderboards and start multiplayer games. Players have one avatar and nickname that is used across all Game Center games. This gives your users a consistent and familiar look right from the start, which is good for both users and developers, saving you the time and trouble of implementing this yourself.
The fact that players have just one account means they only need to sign in once per device, and can start playing your game even faster. And this year, with all the new redesigned Game Center features, players are more accessible than ever. From leaderboards to friends lists, users can access player profiles for themselves and their friends. Before using Game Center for the first time, users will create a single account which will identify them across all Game Center games. In code, players are represented by two different classes-- GKLocalPlayer and GKPlayer.
A great way to think about these classes is that the GKLocalPlayer is the user playing your game, while GKPlayers are everyone else. Let's take a quick look and compare. All players will have an avatar and a nickname. Both types of players will also have scoped playerIDs, which can be used for leaderboards, game invites and challenges. However, the local player will have a persistent ID, while GKPlayers have IDs that change with every instantiation of your game.
Since the local player is used to represent the player that's currently signed in, some additional information is needed. The local player class exposes information related to restrictions which may need to be applied in your game. The local player is also used by Game Center services to save states such as scores, achievements and friends.
Now let's look at how you can start using players in your game. First, before we start using players directly, you'll need to enable Game Center. To do this, add Game Center as a capability in your Xcode project. You'll also need to enable Game Center in App Store Connect. This is done in the Features section under Game Center. You'll be prompted to enable Game Center if you haven't already.
After Game Center has been enabled in Xcode and App Store Connect, you'll need to authenticate the local player before accessing any Game Center APIs. Authentication allows Game Center to make sure there's a signed-in local player and that the Game Center account is ready to use. Authentication also checks whether your game has been configured to make Game Center API calls and talk to Game Center services. Once authenticated, you'll be able to turn on Game Center features and receive notifications such as game invites, challenges and user changes. Let's look at how authentication works in your game.
Authenticating the local player should be done as early as possible in the life cycle of your game. This ensures your game is ready to receive notifications and make Game Center API calls. First, you'll need to set the authentication handler on the shared instance of GKLocalPlayer. This will kick off Game Center authentication automatically, and you'll receive callbacks when authentication-related changes happen, and you can respond accordingly.
It's likely that the local player will have already been signed in. In this case, the authentication handler will be called without any errors or UI to present, which means you've successfully authenticated and are ready to go. There will also be cases where the player hasn't yet authenticated with Game Center. In these cases, your authentication handler will be called with a error and a view controller. Your app should present this view controller, giving the user a chance to sign in or continue their account setup.
Once the user has successfully signed in, your authentication handler will be called again, this time without any errors or UI to present, and you're ready to start your game. You'll also need to handle the case where the user decides not to sign in. When this happens, your authentication handler will be called yet again, but this time with an error. You should disable Game Center and start your game.
Once you've successfully authenticated and have a signed-in local player, you can start accessing Game Center APIs. But I'm going to talk to you about player profiles. This year, player profiles have moved beyond just settings and are now a larger part of Game Center. As a result, you have the ability to present local player profiles right from within your game, and it couldn't be easier. All you have to do is initialize a GKGameCenterViewController with the localPlayerProfile state. Set yourself as the delegate, and present it as you would any other view controller. It's that simple. From here, players can see their achievements, find friends and see what their friends are playing.
There are cases where the local player may have certain restrictions on their account and it's your app's responsibility to check these restrictions and disable or hide relevant content. As we can see here, in addition to checking whether the user is underage and has access to multiplayer games, I'm also checking the personalized communications restriction.
This is new in iOS 14, and when this restriction is turned on, it means the user will not be able to use voice or messaging features in Game Center multiplayer games. So if your app has any custom communication features, be sure to honor this flag and disable them when necessary. This restriction will always be true if the user is underage.
This year, as part of user management on tvOS, Game Center has added support for multiple Game Center accounts per device. This means that as users switch accounts, the GKLocalPlayer will change, and your game will receive callbacks via the authentication handler when it does. This is all done transparently to your game, giving you the ability to easily support multiple players with very few changes. Any tvOS game can easily opt into this feature by adding the user management capability in Xcode. Refer to the tvOS multiuser session for more information. Now let's talk about Game Center friends.
Friends are an incredibly important part of Game Center and are used in leaderboards, multiplayer gaming and challenges. And through friend profiles, you'll be able to see which games friends are playing and the achievements they've earned in those games. With local player profiles, we now have one place where you can see all your Game Center activity, including achievements and games.
You can see all your friends and invite new ones. You will also have access to your friends' profiles. These are referred to as player cards. From here, you can quickly see what your friends are playing and the achievements they've earned. This year, you'll notice player cards are accessible from many different places throughout Game Center.
And with player profiles becoming a larger part of Game Center, profile privacy and visibility becomes even more important. Players can choose from three different privacy settings-- Everyone, Friends Only and No One. This is all handled automatically in the game, showing and hiding profile information depending on which setting a player chooses.
You can see the difference between someone with a profile visible to everyone... and a profile visible to no one. To wrap things up, we've taken a look at the different types of Game Center players, the importance of authentication and making sure that it's done as early as possible, the Game Center APIs around presenting player profiles, honoring player restrictions and enabling multiuser support on tvOS. We've talked about the new player cards and how different privacy settings affect what other players can and cannot see.
Earlier, Ally, Udayan and Christy took you through what's new in Game Center, the new in-game dashboard, and how to enable Access Point in your game. In our next session, you'll get a more in-depth look at some of the cool new features in leaderboards, achievements and multiplayer gaming. That's all for this session. Thanks for watching. Have a great rest of your day.