2

In my multiplayer iOS game, one player has to be the "host" and decide on certain game settings. When he invites friends via GC, it's clear that he is in the driver's seat, however when people are brought together by automatch, I need to do a draw-straw procedure to bring just one to the dialog of making the choices. Right now I have no clue how I can tell an automatched connection from a setup that was initiated clearly by one side. Any ideas whether it can be deducted from certain API behaviours? I thought that the didFindMatch call always comes back with at least one invited player already if it was not purely automatched (that is at least an observation), however the documentation does not clearly confirm that and states that it maybe initially empty.

habitoti
  • 229
  • 2
  • 15
  • So, this is quite an old an yet unanswered question, but now with latest iOS, it happened what I always feared: didFindMatch now returns with all players connected already, so I can no longer tell automatch from invitation-initiated game. Anyone else having a clue how to solve this? Is there some way to find out who entered first into an automatch effort? It would also be possible to put the first who entered automatching into the drivers seat, but I have no clue how to implement that in a stable manner w/o the gamecenter providing a sequence information or centrally gemnerated timestamp. – habitoti Sep 15 '12 at 06:35

1 Answers1

0

I had this same question and have eventually concluded that the only way was to track and message this myself.

In my case, the initiator side tracks how the game was started, and sends that information as part of the initial messaging sequence that is used to setup the game.

It is a shame that the API doesn't appear to provide this information as it seems to be useful and should be readily available to Game Center.

  • Joining an automatch means either hosting or joining one, and you can't tell in what "mode" you joined unless you make an explicit choice of it ("Join existing game" vs. "Host a match", which would drastically reduce the available partners). – habitoti Oct 06 '12 at 07:17
  • I solved it now by using the NSDate "seconds since 1972" timestamp (which is globally valid and not timezone-adjusted) to decide who is in the "drivers seat" when automatch partners are joined. The one who initiated the game first is chosen as host. This works pretty well, and you can assume all clocks worldwide to be reasonably well adjusted for network attached devices (at least this is not rocket science, but just a game ;-) – habitoti Oct 06 '12 at 07:21
  • Nuts. I thought that was a brilliant idea to use the time stamp, but it appears that it isn't very reliable after all. I just tested it with my iphone 4 and my ipod and the iphone seemed to have the earliest time stamp no matter what I tried. – PWiggin Sep 03 '13 at 21:45