Hello,
has anyone been able to implement in their game a way to display the number of players currently online in their game?. I thought up of this feature and thought it will be useful for players to find out if there is anyone currently online so that they don't waste their time trying to find a random online match. Any help will be greatly appreciated.
Kind regards,
Jabir Abdi
GameKit
RSS for tagCreate apps that allow players to interact with each other using GameKit.
Post
Replies
Boosts
Views
Activity
I have a VisionOS app that uses a Game Center Leaderboard. On 'appear' of my content view, I check authentication, and if the user is auth'd, I display a 'leaderboard' button. This works on development / TestFlight – the little floating 'Game Center logged-in' pop up shows up when the app runs, and the button appears.
Tapping the button opens the leaderboard, and I can tap over to 'global' and see everyone's scores.
However, the app launched today on the App Store, and I'm having some issues.
The leaderboard button isn't showing up, meaning that the auth call is probably failing silently. Not sure why. If I log out of Game Center on the device, and re-open the app, I'm able to auth and see my leaderboard button.
Once I've done that, the leaderboard seems busted. On App Store Connect I can see the values that I expect (high scores from my beta test flight). But, on the production app, the leaderboard is just empty. And there's no 'global' tab to tap on.
Wondering if this is a propagation issue? Like, does it take time to roll out the Game Center entitlements when the app is live?
I'm going to distribute promo codes to try and get some more people with the App Store version testing for me to see what happens for them.
Any help appreciated!
This may be a bit dumb but I've really been having trouble with understanding the documentation for Apple's Unity Plugins. I wanted to implement Game Center functionality on my game. So far the only line of code I've managed to get working is the authentication, in which I did
async void Start()
{
await Login();
}
public async Task Login()
{
if (!GKLocalPlayer.Local.IsAuthenticated)
{
var player = await GKLocalPlayer.Authenticate();
var localPlayer = GKLocalPlayer.Local;
]
}
However, I'm at a complete loss as to how to open leaderboards. I followed the documentation given:
void OpenLeaderboard()
{
var allLeaderboards = await GKLeaderboard.LoadLeaderboards();
var filteredLeaderboards = await GKLeaderboard.LoadLeaderboards("leaderboardIwant1");
}
But it did not work. What did I do wrong? Am I missing a function to get it to work? Why can't Apple write proper documentation to properly implement this in a simple way?
My apologies for my frustration. Up until now I've used another plugin from the Unity Asset Store which is shockingly easy to use, but I decided to attempt to use Apple's system because the plugin I had used deprecated functions and I was afraid the App Store would not approve it. But Apple's own plugins are stunningly opaque and hard to test.
As additional questions (but not the main ones), I'm also completely at a loss how to submit scores or load specific leaderboards and Apple's documentation does nothing to help there either.
Any help or thoughts are appreciated. Thanks.
In the last several days I've gotten reports from customers saying that Game Center suddenly cannot connect to players. I was able to verify this myself.
It will find players to match, but then during the Connecting process it just sits there indefinitely with a spinning thing. Up until maybe 4 days ago this had worked fine for the last 12+ years, so something on the Game Center server broke.
Is anyone else experiencing the same problem?
Now I am using iOS 16 beta 6, I can get buttonA/buttonB is pressed event. but cannot get accelerator motion data info.
//work
buttonA?.valueChangedHandler = {(_ button: GCControllerButtonInput, _ value: Float, _ pressed: Bool) -> Void in
print(">>> ButtonA tapped")
}
//work
buttonB?.valueChangedHandler = {(_ button: GCControllerButtonInput, _ value: Float, _ pressed: Bool) -> Void in
print(">>> ButtonB tapped")
}
// this is not works
gameController.motion?.valueChangedHandler = { (motion: GCMotion)->() in
print(">>>> motion data \(motion.acceleration.x) \(motion.acceleration.y) \(motion.acceleration.z)")
if let delegate = self.motionDelegate {
delegate.motionUpdate(motion: motion)
}
}
Is there any plan to support this?
At WWDC 2023, the background asset feature was introduced, allowing essential resources to be downloaded before the game is first launched. How does this differ from including all necessary resources directly in the installation package? What are the advantages of this approach, and how does it enhance the user experience?
https://vimeo.com/957974306
Canvas #1(Unity) stopped rendering context when I switch tab on inspector. Also my device 13 pro max running iOS 17.5.1 lost context when I screenshot. It has no log in console. Not happened on 13 pro max running iOS 16.4
Dear Apple Developer Support,
I have a question regarding the Background Assets feature for a game we are planning to release on the App Store. Specifically, I would like to understand the user experience during the initial installation process.
If our game utilizes the Background Assets feature and we have essential assets specified in the BAExtension, will the end user need to wait for these essential assets to be fully downloaded before they can open the game after installing it from the App Store? Additionally, during this download process, will there be any indication of the essential assets' download status on the App Store or on the home screen icon of the game?
Your guidance on how this process is managed and what the user can expect would be greatly appreciated.
Thank you for your assistance.
Hello,
First of all, I understand that GKVoiceChat has been deprecated and replaced by shareplay but for my situation, it does not seem useful as I will be matching with the random players hence I can not utilise the Facetime(Shareplay) capability.
I have set up a voice chat function using the GKVoiceChat object, my game connects with another player successfully but the voice chat does not work for some reason. The code snippet below is how I implemented it with the help of the tutorial from : apple (Start Voice chat between players)
class OnlineGame {
var voiceChat: GKVoiceChat? = nil
...
// When online game succesfully connected and game view loaded
self.startVoiceChat()
func startVoiceChat() {
// Handle an unknown, connected, or disconnected player state.
/// - Tag:voiceChatChangeHandler
///
if voiceChat == nil {
// Create the voice chat object.
voiceChat = myMatch?.voiceChat(withName: "Gamesession")
}
let voiceChatChangeHandler = { (player: GKPlayer, state: GKVoiceChat.PlayerState) -> Void in
switch state {
case GKVoiceChat.PlayerState.connected:
self.voicechatstate = 1
case GKVoiceChat.PlayerState.disconnected:
self.voicechatstate = 2
case GKVoiceChat.PlayerState.speaking:
self.voicechatstate = 3
case GKVoiceChat.PlayerState.silent:
self.voicechatstate = 4
case GKVoiceChat.PlayerState.connecting:
self.voicechatstate = 5
@unknown default:
print("Player unknown state.")
}
}
// Exit early if the app can't start a voice chat session.
guard let voiceChat = voiceChat else { return }
// Handle an unknown, connected, or disconnected player state.
voiceChat.playerVoiceChatStateDidChangeHandler = voiceChatChangeHandler
// Set the audio volume.
// Activate the shared audio session.
do {
let audioSession = AVAudioSession.sharedInstance()
try audioSession.setCategory(AVAudioSession.Category.playAndRecord, mode: AVAudioSession.Mode.gameChat, options: AVAudioSession.CategoryOptions.allowBluetooth)
try audioSession.setActive(true, options: [])
}
catch {
print("ERROR: \(error.localizedDescription).")
}
voiceChat.volume = 0.8
voiceChat.start()
voiceChat.isActive = true
}
}
Thats my implementation of it and hope it explains my issue. Thanks for your assistance in advance!.
GKLocalPlayer.local.authenticateHandler = {viewController, error in
When authenticating a player using authenticateHandler, the completion handler is only called if the player is already logged in. If the player is not logged in, the authentication window will appear but the completion handler is never called.
If I have content in a volumetric window that obscures the login window (which appears at a slight Z increase from the parent window), what can I do? If the completion handler was being called then I could make adjustments to my view, but it never gets called if the user is not already logged in.
https://developer.apple.com/documentation/gamekit/authenticating_a_player
Thanks.
It show the following :
==> Upgrading apple/apple/game-porting-toolkit
1.0.3 -> 1.1
==> Staging /Users/mtahin07/Library/Caches/Homebrew/downloads/7baed2a6fd34b4a641
==> Patching
==> /private/tmp/game-porting-toolkit-20240619-16666-si8pyg/wine/configure --pre
==> make
Last 15 lines from /Users/mtahin07/Library/Logs/Homebrew/game-porting-toolkit/02.make:
/private/tmp/game-porting-toolkit-20240619-16666-si8pyg/wine/dlls/crypt32/unixlib.c:641:23: error: use of undeclared identifier 'noErr'
if (status == noErr)
^
/private/tmp/game-porting-toolkit-20240619-16666-si8pyg/wine/dlls/crypt32/unixlib.c:647:31: warning: this function declaration is not a prototype [-Wstrict-prototypes]
if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr)
^
/private/tmp/game-porting-toolkit-20240619-16666-si8pyg/wine/dlls/crypt32/unixlib.c:647:51: error: use of undeclared identifier 'kSecFormatX509Cert'
if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr)
^
/private/tmp/game-porting-toolkit-20240619-16666-si8pyg/wine/dlls/crypt32/unixlib.c:647:95: error: use of undeclared identifier 'noErr'
if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr)
^
2 warnings and 7 errors generated.
make: *** [dlls/crypt32/unixlib.o] Error 1
make: *** Waiting for unfinished jobs....
If reporting this issue please do so to (not Homebrew/brew or Homebrew/homebrew-core):
apple/apple
I can't verify what error occur
I was trying update gptk, so i removed the old one ( installed by Xcode 15.0 ) and reinstalled it, but accuired a issue:
Error: apple/apple/game-porting-toolkit 1.1 did not build
Logs:
/Users/CASEM/Library/Logs/Homebrew/game-porting-toolkit/00.options.out
/Users/CASEM/Library/Logs/Homebrew/game-porting-toolkit/01.configure
/Users/CASEM/Library/Logs/Homebrew/game-porting-toolkit/01.configure.cc
/Users/CASEM/Library/Logs/Homebrew/game-porting-toolkit/02.make
/Users/CASEM/Library/Logs/Homebrew/game-porting-toolkit/wine64-build
If reporting this issue please do so to (not Homebrew/brew or Homebrew/homebrew-core):
apple/apple
Error: Your Xcode (15.0) is outdated.
Please update to Xcode 15.4 (or delete it).
Xcode can be updated from the App Store.
So I upgrade the Xcode to 15.4 by app store and still encountered:
Error: apple/apple/game-porting-toolkit 1.1 did not build
Logs:
/Users/CASEM/Library/Logs/Homebrew/game-porting-toolkit/00.options.out
/Users/CASEM/Library/Logs/Homebrew/game-porting-toolkit/01.configure
/Users/CASEM/Library/Logs/Homebrew/game-porting-toolkit/01.configure.cc
/Users/CASEM/Library/Logs/Homebrew/game-porting-toolkit/02.make
/Users/CASEM/Library/Logs/Homebrew/game-porting-toolkit/wine64-build
If reporting this issue please do so to (not Homebrew/brew or Homebrew/homebrew-core):
apple/apple
I've been reading some post says use 15.1, but still get same error report.
What should I do next?
Any help woulbe appreciated.
my game center account are linked both on my ipad and iphone but the activity on the game center didnt update when i play games on my ipad. It only linked to games on my phone. So all the games i‘ve downloaded on my ipad arent linked to the game center. Is there any solution so that the games i‘ve downloaded on my ipad could link to the game center? i have tried to turn on and off both on my ipad and iphone but it still only linked to the phone.
when i install game porting toolkit 1.1 ,i got an error as below:
Error: Failure while executing; patch -g 0 -f -p0 exited with 2
==> Installing game-porting-toolkit from apple/apple
==> Staging /Users/***/Library/Caches/Homebrew/downloads/bf215bb93a68251243c69e19a3ba0d670aa82daad63a2bfe24d7ff0a11c2c969--crossover-sources-24.0.2.tar.gz in /private/tmp/game-porting-toolkit-20240520-35139-asrgp4
==> Patching
Error: Failure while executing; patch -g 0 -f -p0 exited with 2. Here's the output:
patching file 'wine/include/distversion.h'
patching file 'wine/configure
guys who knows how to fix it?
I've added a recurring leaderboard in App Store Connect which I can get the localized title from, submit scores to, and load players from, but I'm getting an error whenever I try loading the image for it with the instance method for GKLeaderboard, loadImage().
The description from the error is:
The requested operation could not be completed due to an error communicating with the server.
Both the completion block and async versions of this method yield the same result.
I made sure the image is a PNG in 1024x1024, 72 DPI, and in the RGB colorspace. No errors appear after I upload the image.
Are there any hidden requirements that might be causing this error? Perhaps there is a waiting period before the server can provide the image?
When I run the following code, the Matchmaker view is populated with me (local player) and my opponent (correct picture and friendly name). however, the "Send Game" button is disabled. I assume that recipients is set correctly.
There are errors from loadPlayersForIdentifiers .
GKMatchRequest *request = [[GKMatchRequest alloc] init];
request.minPlayers = 2;
request.maxPlayers = 2;
request.defaultNumberOfPlayers = 2;
request.inviteMessage = @"Testing";
[GKPlayer loadPlayersForIdentifiers:@[ playerID ]
withCompletionHandler:^(NSArray<GKPlayer *> *_Nullable players,
NSError *_Nullable error) {
if (error) {
NSLog(@"Error loading player: %@", error);
} else if (players.count > 0) {
request.recipients = players;
GKTurnBasedMatchmakerViewController *mmvc =
[[GKTurnBasedMatchmakerViewController alloc]
initWithMatchRequest:request];
mmvc.turnBasedMatchmakerDelegate = self;
mmvc.showExistingMatches = NO;
[self presentViewController:mmvc
animated:YES
completion:nil];
}
}];
If I remove the opponent, and then re-add them manually, the "Send Game" button is enabled.
Here is a link to a super long conversation with a true genius at StackOverflow
https://stackoverflow.com/questions/78343630/what-algorithm-is-available-to-correlate-a-skspritenodes-position-with-the-uibe/78379892#78379892
He has done an extraordinary amount of work to make up for what I consider is the non-working of UIBezierPath’s orientToPath = true.
He’s done multiple hours work to make up for orientToPath = true not working.
What are we missing?
[UE] Assertion failed: Binding.index < ML_MaxTextures [File:./Runtime/Apple/MetalRHI/Private/MetalPipeline.cpp] [Line: 563]
Metal texture index exceeded!
How can I solve it?
My MacBook Pro is M3 max, running macOS 14.4.1 (23E224), with Xcode 15.3 and Command_Line_Tools_for_Xcode_15.3 installed. When I tried to execute "brew -v install apple/apple/game-porting-toolkit", it reported the following error.
Error: apple/apple/game-porting-toolkit 1.1 did not build
Logs:
/Users/yuanmouren/Library/Logs/Homebrew/game-porting-toolkit/00.options.out
/Users/yuanmouren/Library/Logs/Homebrew/game-porting-toolkit/01.configure
/Users/yuanmouren/Library/Logs/Homebrew/game-porting-toolkit/01.configure.cc
/Users/yuanmouren/Library/Logs/Homebrew/game-porting-toolkit/02.make
/Users/yuanmouren/Library/Logs/Homebrew/game-porting-toolkit/wine64-build
If reporting this issue please do so to (not Homebrew/brew or Homebrew/homebrew-core):
apple/apple
I found the following error reasons in the console.
/private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:629:11: error: unknown type name 'SecTrustSettingsDomain'
const SecTrustSettingsDomain domains[] = {
^
/private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:630:9: error: use of undeclared identifier 'kSecTrustSettingsDomainSystem'
kSecTrustSettingsDomainSystem,
^
/private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:631:9: error: use of undeclared identifier 'kSecTrustSettingsDomainAdmin'
kSecTrustSettingsDomainAdmin,
^
/private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:632:9: error: use of undeclared identifier 'kSecTrustSettingsDomainUser'
kSecTrustSettingsDomainUser
^
/private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:640:18: warning: this function declaration is not a prototype [-Wstrict-prototypes]
status = SecTrustSettingsCopyCertificates(domains[domain], &certs);
^
/private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:641:23: error: use of undeclared identifier 'noErr'
if (status == noErr)
^
/private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:647:31: warning: this function declaration is not a prototype [-Wstrict-prototypes]
if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr)
^
/private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:647:51: error: use of undeclared identifier 'kSecFormatX509Cert'
if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr)
^
/private/tmp/game-porting-toolkit-20240414-2133-st99bv/wine/dlls/crypt32/unixlib.c:647:95: error: use of undeclared identifier 'noErr'
if ((status = SecItemExport(cert, kSecFormatX509Cert, 0, NULL, &certData)) == noErr)
^
2 warnings and 7 errors generated.
make: *** [dlls/crypt32/unixlib.o] Error 1
make: *** Waiting for unfinished jobs....
How should I resolve this issue?
Hello,
As stated in the title, we implemented the GameKit unity package.
We did a lot of testing and never encountered any issue related to the authentication until now, andwe identified that the device with the issue was Intel.
The configurations and provisioning profile used are correctly set.
I was wondering if any of you encountered this issue or had an idea how to debug this?
Thanks!