Post

Replies

Boosts

Views

Activity

Reply to Using GameKit for Leader to many Follower type connections
Thanks for the updated information! Having 16 in one peer to peer GKMatch will certainly be better than the 8 - 10 individual GKMatch(es) with 2 in each that I've been able to get working so far.  Could you offer an example or pseudocode for best practice to programmatically create such? I imagine it goes like this: Follower starts: [[GKLocalPlayer localPlayer] registerListener:self]; request = [[GKMatchRequest alloc] init]; 							request.minPlayers = 2; 							request.maxPlayers = 16; 			 request.playerAttributes = 0x0000000F; request.playerGroup = groupName;										 [[GKMatchmaker sharedMatchmaker] findMatchForRequest:request... Leader starts: [[GKLocalPlayer localPlayer] registerListener:self]; request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 16; request.playerAttributes = 0xFFFFFFF0; request.playerGroup = groupName; 			 [[GKMatchmaker sharedMatchmaker] findMatchForRequest:request request... //(should this completion handler finish matching and call addPlayersToMatch or will that happen automatically?) Update UI with the completion handlers, but don't count on a real match until: (void)match:(GKMatch *)match 			 player:(GKPlayer *)player didChangeConnectionState:(GKPlayerConnectionState)state { 				//add player to array of followers 				//(should I finish match and call addPlayersToMatch here or is it not necessary?) } Send data to either with: [match sendData:encoder.encodedData toPlayers:playerArray dataMode:GKMatchSendData(Un)reliableerror:&error]; and receive in: (void)match:(GKMatch *)match didReceiveData:(NSData *)data forRecipient:(GKPlayer *)recipient fromRemotePlayer:(GKPlayer *)player { // you've got mail from player! } I've tried a few ways of ordering the connections but haven't figured it out yet. I'm not sure if I need to call finishMatchmaking in the leader code after each new peer then addPlayersToMatch, and if so should it be in the findMatchForRequest completion handler or in didConnect? Any additional insight or example would be appreciated.
Jun ’20
Reply to Using GameKit for Leader to many Follower type connections
PBK, thanks for the reminder of 4 max GKPlayers in a GKMatch, but I'm using a seperate GKMatch for each follower, so a "lawyer" defense is that I never have more than 2 players in each GKMatch... but I'm trying to let one player (the leader) be in many matches at a time. I couldn't find any documentation on that scenario. My tests seem to indicate a cutoff around 7 but at times have had 10 active GKMatches.Your input is very appreciated and leads me to consider having multiple GKMatches of 4. _IF_ the leader could be in 6 concurrent GKMatches and each GKMatch could be with 3 followers, then I'm making progress.If anyone can offer success/failure experience with multiple GKMatches I'd appreciate hearing it.And again, PBK, I'm very grateful for your quick and helpful replies!
Jun ’20
Reply to Using GameKit for Leader to many Follower type connections
I've added a small 'poke' message from each follower to the leader every 0.9 seconds using the GKMatchSendDataReliable message type. The connections may be a bit more reliable, but with more than 7 or so followers, there is still a constant disconnect, reconnect dance that seems to happen.Has anyone successfully kept more than 6 active GKMatch connection pairs on a device for more than a few minutes?If not, are there any data transmission services that anyone would recommend? I wanted to stay in the safety of Apple's services but am willing to look beyond if necessary.PBK, although your daisy chain idea is clever, I fear the reliability might be even worse, as one lost connection would mean multiple lost connections.
Jun ’20
Reply to CloudKit for near realtime exchange of small data?
I have mixed results to report. I've been able to achieve most of my objectives with an atypical GameKit implementation:Follower starts:[[GKLocalPlayer localPlayer] registerListener:self];request = [[GKMatchRequest alloc] init]; request.minPlayers = 2; request.maxPlayers = 2; request.playerAttributes = 0x0000000F;request.playerGroup = groupName; [[GKMatchmaker sharedMatchmaker] findMatchForRequest:request...Leader starts:[[GKLocalPlayer localPlayer] registerListener:self];request = [[GKMatchRequest alloc] init];request.minPlayers = 2;request.maxPlayers = 2;request.playerAttributes = 0xFFFFFFF0;request.playerGroup = groupName; [[GKMatchmaker sharedMatchmaker] findMatchForRequest:request...You can update UI with the completion handlers, but don't count on a real match until:- (void)match:(GKMatch *)match player:(GKPlayer *)playerdidChangeConnectionState:(GKPlayerConnectionState)state{ use the match / player combo to note the connection for both leader and follower. Add to array of followers for leader. If Leader, call your leader code again}Send data to either with:[match sendData:encoder.encodedData toPlayers:playerArray dataMode:GKMatchSendData(Un)reliableerror:&error]; and receive in:- (void)match:(GKMatch *)matchdidReceiveData:(NSData *)dataforRecipient:(GKPlayer *)recipientfromRemotePlayer:(GKPlayer *)player{ // you've got mail from player!} So far, so good. Here's the bad news: depending on network strength, connections disconnect regularly. Even though I've built in dependable reconnect code, it can take up to 15 seconds to reconnect so it really isn't a good "real-time" experience.I'm currently testing with various combinations of data size (sometimes pad it so it's heft may keep the connection) or frequency (sometimes just send a "poke me" message) or tweaking the reliable vs unreliable flag in the send message calls.I can get about 10 followers per leader on a good day, but other times, more than 3 followers cycle between connect, disconnect, reconnect in an unusable fashion.I'm still trying to make usable, but wanted to document my success/failures so far in hopes that I can help many and perhaps get help from a few.Any ideas would be welcomed and any tweaks will be tested and reported.
Jun ’20
Reply to CloudKit for near realtime exchange of small data?
Game Center does work over the internet, and I'm currently experiementing with creating multiple GKMatch(es) on the "lead" device so that more than 4 'followers' can be connected. Thanks for the recommendation of Firebase, I'll take a look if I can't get GameKit to work. I hope I can, as staying inside Apple walls makes me feel safe ;-) I'll update in a few days when I have more experience with testing.
Apr ’20
Reply to CloudKit for near realtime exchange of small data?
While PBK's gamekit suggestion seemed perfect, after implementing, I see that Game Center limits to peer to peer are 4 players per GKMatch. Could someone recommend another method of communicaing small amounts of near real-time data from one app instance to another across the internet for 20 or so users at a time? Extra credit for an Apple framework that can handle the security and server items. Thanks in advance!
Apr ’20
Reply to Apple Watch console / device logs is empty
Installing this profile does indeed allow the console app to display activity of a connected Apple Watch. Thanks!But I can't get the logs to reappear in Console after running an app in XCODE on the Apple Watch. When the Apple Watch is selected as a run destination, it's messages are displayed in the XCODE console, as expected. But after XCODE is closed, I can't get the messages from the Apple Watch to go back to being displayed in the console app.Anyone have any advice?
Dec ’19