Re: Game Center Multi-Player Question


Dave
 

I’m wondering if " anonymousGuestPlayerWithIdentifier:” might work for what I want to do, but I can’t seem to find much information about it.

Has anyone used this feature?

All the Best
Dave

On 18 Jul 2017, at 11:37, Dave <dave@...> wrote:

Hi,

Thanks for the advice.

I would associate a small number of AI with each player.
This way, if a player quits, only a few AIs are killed.
I’m not quite sure how I would go about implementing the AI’s though, this is a turn based board game and as far as I can see, only “Real” players get a Move, so

If you have:

Dave, Sue, John Human
HAL, Marvin, R2D2 AI

Then how would it know that it was the turn of an AI Player?

I can see I may have to have two modes, single player and multi player and only support Human Players in Multi Player mode.

All the Best
Dave

On 17 Jul 2017, at 19:54, Pascal Bourguignon <pjb@...> wrote:


On 17 Jul 2017, at 19:40, Quincey Morris <quinceymorris@...> wrote:

On Jul 17, 2017, at 07:21 , Dave <dave@...> wrote:

As far as I can see, this approach won’t work with Game Centre, does anyone know if this is correct?
That’s correct. Game Center doesn’t provide any kind of “server side” logic, which is how you’d naturally want to implement AI players.

The only thing you can do with a Game Center game (other than implement your own server elsewhere, of course), is to put the “server” logic in a device or devices. You can, for example, elect one of the real player devices to supply the logic of all of the AI players. Or, you can replicate the logic in all devices (by using a seeded pseudo-random-number generator and deterministic behavior) so that each real device knows what all AI players will “do”. Something like that.

The downsides are that this is not terribly secure (a determined hacker can at least find out what the AI players will do in advance), and it complicates matchmaking. (It may also make your app bigger and slower, if the AI computations are significant.)
I would associate a small number of AI with each player.
This way, if a player quits, only a few AIs are killed.


--
__Pascal J. Bourguignon__


Join {cocoa@apple-dev.groups.io to automatically receive all group messages.