Forum Multiplayer Turn Based board game with unity

Discussion and help relating to the PlayerIO Multiplayer API.

Turn Based board game with unity

Postby indieboystudio » February 26th, 2020, 12:36 am

Hi every one. I'm a newbie in playerio and I want to update my 2D board game into a multiplayer game which is made 2 years ago.
In my game, there are ONLY 2 players in each room and I want to changed their turn after 30 seconds. I'm using AddTimer() function to handle time on the server but I am confusing and do not know how to manage player turn and I cant found any tutorial in unity.
I have read the documentation and found to use GameRequests to approach this.
Can anyone help me please?
Thanks.
indieboystudio
 
Posts: 1
Joined: October 14th, 2019, 9:46 am

Re: Turn Based board game with unity

Postby sovep58165 » September 11th, 2020, 3:25 pm

indieboystudio wrote:Hi every one. I'm a newbie in playerio and I want to update my 2D board game into a multiplayer game which is made 2 years ago.
In my game, there are ONLY 2 players in each room and I want to changed their turn after 30 seconds. I'm using AddTimer() function to handle time on the server but I am confusing and do not know how to manage player turn and I cant found any tutorial in unity.
I have read the documentation and found to use GameRequests to approach this.
Can anyone help me please?
Thanks.


Hi buddy, even I am trying the same, did you get any way out yet to this.?

Regards,
Joshua Genin
sovep58165
 
Posts: 1
Joined: September 11th, 2020, 3:24 pm

Re: Turn Based board game with unity

Postby Henrik » September 16th, 2020, 7:12 pm

Just wanted to chime in that GameRequests is 100% the wrong feature to use for this!

When a player makes a move, you flip a variable indicating which player's move it is, and you use ScheduleCallback to setup a callback 30 seconds into the future. If the current player hasn't made a move when it fires, control goes back to the other player. If the current player makes a move, cancel the callback, flip the indicator, and setup a new callback 30 seconds from now.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm


Return to Multiplayer