question

luka@fajlworks.com avatar image
luka@fajlworks.com asked

Turn duration for Turn Based games?

Hi, I was wondering: is adding turn duration possible with Playfab using Photon Turn based?

Basically, game is a mix of real-time and turn based, where game state is updated whenever a user makes a move. Game is structured that one player is server and the other is client. Since I want the game to be fast paced, I implemented that the server player controls turn duration, when the next player should take turn in order to prevent people taking their turns more than 3 minutes.

But I would like to manage turn duration on cloud if possible, because server could potentially disconnect, or hack/modify turn duration on his computer, putting the client player in a disadvantage.

Is something like that possible currently, or could it be implemented somehow? Can I use CloudScript to track time for each match, so I can reference the cloud when a turn should be passed to next player?

Thank you in advance,

Luka

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

For a game that's as fast-paced as you describe, and given that you're using Photon Turnbased, you could have any active client which is connected trigger a call, and use the EmptyRoomTTL in Photon to indicate the time after the room is empty at which the room will close, causing a webhook to fire into PlayFab (RoomClosed). That would ensure that a Cloud Script call is made one way or the other, after your timer expires.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.