Post

Replies

Boosts

Views

Activity

Reply to How to prevent 2 players from joining a match together?
no, this is not the same issue. I am clearly not explaining this issue nicely.My game allows a player to HOST a match or simply FIND an available match.When a player HOSTS a match then the player sets all of the game options and then requests a match to be created using player attribute 0xFFFF0000 (meaning "HOST") value. Using this player attribute will ensure no other HOST player can join a match which already has a host player included. Only one HOST player is allowed in a match at once.When other players want to FIND a match to join only, then I want these other players to only be allowed to join a match which has a HOST player in it. I do not want these other non-host players to be able to join matches together (without a host player being present in the match). Is this possible?
Mar ’20
Reply to How to clean up match when canceling a findMatch request?
Hey PBK,After many hours of investigation, I finally figured out what was going on which explains why the GKMatchmakerViewController did not find the players who requested join a match only (ie: not host a match). It was because the player was being added into another match with another player who was a non-HOST. Basically, I had one player who set options for the game and was the HOST, and requested the matchmaker to go find other players to join the match. This would result in the GKMatchmakerViewController interface being initiated, which would eventually spin looking for players. I then had multiple other players simply request to "join" a match only (ie: not host a match). I never saw these players being added to the GKMatchmakerViewController, however, I discovered these other players were being paired up for a match themselves. For some reason I thought my code logic would prevent non-HOST players from being paired together but that turned out not to be the case. This is all explained, along with my request for help, in my latest forum post called "How to prevent 2 players from joining a match together?" Perhaps you can take a look at that post and see what you think? If I cannot find a easy solution then I will need to redo a bunch of my user interface logic to fix my game (ie: a lot more effort)I do not think I need any assistance in this forum post anymore since this post turned out to be a red herring (ie: going down the wrong path on what I thought was happening, but really was not happening).
Mar ’20
Reply to Is it possible to test different iPhone models in simulator with real iPhone8 ?
I am confused by your reply.>>I believe it works for all models I know I can select a different model in the simulator and test my game application on the simulator, however, my question is why different models selected on the simulator do not connect to my personal "real" iPhone 8 phone.>> ...but the simulator never receives notifications from Game CenterI understand sending/receiving Game Center "invites" does not work on the simulator. This is not my issue though.Here is an example of my issue, hopefully explained more clearly:1) Select "Iphone 11" in the simulator, then start running my game application in the simulator.2) In my game running on the simulator, select to "Host" a 2-player game, then select "Play Now" on the Game Center matchmaker View Controller, which is displayed, so it can go off and automatically find one other player to play my game. It is now spinning looking for an available player.3) On my personal "real" iPhone 8 phone, I start my game application and request to "Join" a 2-player game.4) The game running on the iPhone 11 simulator and the game running on my iPhone 8 never find each other so the game never starts. Each keeps spinning/looking for a player to add OR a game to join.** If I perform all of the steps above again but use "iPhone 8" model on the simulator then everything works fine and the simulator and my real iPhone 8 model join together and can play a game successfully.Basically, if the iPhone model selected in the simulator is set to any model other than "iPhone 8", then it will never automatically find my personal iPhone 8 phone to join to the game. This makes me think that the simulator iPhone model must match the "real" iPhone model being used for testing for Game Center to find players.Any ideas why the simulator must be set to iPhone 8 model in order to allow it to set up a game with my real iPhone 8 phone?(EDIT)In addition, I added the "iPhone 8 (12.4)" simulator to Xcode. When I select "iPhone 8 (12.4)" in the simulator and try to connect to my real iPhone 8 phone (running iOS 13.3), then the simulator and my real iPhone cannot find each other. If I select "iPhone 8 (13.3)" in the simulator then the simulator finds/connects to my real iPhone 8 (with iOS 13.3) phone and starts the game. So it even seems the simulator iOS version has to be the same as the version on the real iPhone being used for testing as well.
Mar ’20
Reply to Game Center real time match search failure serial number
I have nothing to offer except to say I see this error all of the time as well even though my game app works fine.I am assuming this is what is happening ....Viceroy seems to be a network algorithm which is used by Game Center to send packets over the peer-to-peer network. This error comes out as part of the viceroyTrace logging so I am assuming there was an issue sending some packets to some players in your game (ie: packet loss perhaps???) . I am assuming you are using TCPIP as a delivery protocol so the packets are re-transmitted until they arrive at the destination successfully. So you might get the viceroyTrace error but eventually the required network packets are received by the intended player (as a result of re-transmitting) and your game goes on successfully.
Mar ’20
Reply to After Invite is clicked then how to launch view controller from didAccept?
My code handles the case you indicated.My code checks for two things when the didAcceptInvite comes in:1) Is an active game in progress?If (1) is TRUE, then my game sends a notification to my gamePlay module indicating the player wants to quit the game. This will result in the actual game cleaning itself up and also ensuring all Game Center match data is cleaned up properly. After the current match processing is cleaned up, then I present the Invite View Controller so the player can join the game they are being invited into.2) Is a match in the process of being created (ie: although gameplay has not started)?This represents the time in between either one of the following:a) When a player starts setting up a match by presenting the GKMatchmakerViewController (ie: by calling findMatchWithGKMatchmaker() function) and the eventual call to the "delegate.matchStarted()" indicating gameplay should startb) When a player tries to find match to join (ie: not hosting the match themselves) by calling "GKMatchmaker.shared().findMatch(for: matchRequest, withCompletionHandler: " function and the eventual call to the "delegate.matchStarted()" indicating gameplay should start.If (2) is TRUE then my code ensures all Game Center match data is cleaned up properly. After the current match processing is cleaned up, then I present the Invite View Controller so the player can join the game they are being invited into.** A third type collision can occur, although quite rare, which I am not going to handle. This is when the player accepts an invite from another player and then receives another invite, which they also accept, while the first invite is still being processed. In this case, we must cancel the first match when the first invte "didFind match" is called. In my opinion, this would not be worth the effort to track such an occurence as this would be an incredibly rare scenario.
Feb ’20
Reply to After Invite is clicked then how to launch view controller from didAccept?
>>I assume that if the player taps on the notification (rather than swipes it up) they want to accept the invite.Yeah I thought about this as well and decided to re-write my code logic. Now, if the player taps on the invite notification (ie: accepts the invite) then I will remove the player from the current game being played (if existing) and then display the didAccept invite view controller to the player.>>I have a different issue, I am concerned that in a two player game in which there is a disconnect both players could try to invite the other playerIf both players try to invite each other at the same time, then each other's application will have their didAccept function called. Both players will present the didAccept invite view controller to themselves. At this point, I will let Game Center figure out what to do. At worse, nothing really happens and the presented view controller just keeps spinning and spinning. The two players have to know they invited each other so they will most likely press the "cancel" link in the top-left of the didAcceptInvite view controller to exit. They will then text each other and determine who will send the invite instead. As a result, I am not too worried about this happening. Anyway, I do not think there is anything we can do about it anyway.
Feb ’20