Game Center Multi-Player Question


Dave
 

Hi All,

I’m developing a game and want to use Game Centre, the game is for 2 to 9 Human or AI players, by AI I mean that that program itself makes a move on behalf of one or more AI Players.

So, in a 5 player game, the user could set it up as so:

Player 1 “Local User” [Human]
Player 2 HAL9000 [AI]
Player 3 Joe [Human]
Player 4 Marvin [AI]
Player 5 Sandra [Human]

As far as I can see, this approach won’t work with Game Centre, does anyone know if this is correct? And how to set it up if it is possible.

All the Best
Dave


Quincey Morris
 

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.)


Pascal Bourguignon
 


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__




Dave
 

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__





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__



Quincey Morris
 

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

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

You could have each real player device calculate the following AI move(s), and pass multiple moves to the next real player. Or, if you have a single “server” device, the turn can bounce back to that device whenever it’s the AI’s turn to play.