Sign In Register

How can we help you today?

Start a new topic
Answered

How to do back and forth?

 Hi,

I've seen the tutorial on doing custom server code that I faced a question.

What I know so far is that I have to change the Execute code which is in JavaScript and put my logic code there. Question is, my logic code is not that simple. It's a TCG (Trading Card Game) and requires back and forth between the other player and just a single exectution of a function won't work.

It goes like this, player1 does some logic code, player2 sees the result, does something in return, then server does some calculations and finds the winner of that turn. And game consists of 5 of these turns.

How can I break such logic into the server code?

Thanks.


Best Answer

Aidin,


Our standard Challenges functionality will fully support your requirement for this Trading Card Game.  Another member of our customer services team will assist you further to implement the best pattern.


With respect to PlayFab, we are in no way connected to them. PlayFab is an alternative product that does not offer as complete a solution as GameSparks. PlayFab relies on Photon for its multiplayer functionality. GameSparks provides a more comprehensive set of features than either of these offerings.


Kind regards,


John.


Thanks for the reply.

Yes I'm using Unity. I've seen the tutorial but can't get my head around how to adapt it to this TCG game. Would you please show me the big steps that I have to make?

Also, I've noticed you are now joined with PlayFab, which services are not currently presented by GameSparks and one would need to use PlayFab for?

Thanks again.

 

Answer

Aidin,


Our standard Challenges functionality will fully support your requirement for this Trading Card Game.  Another member of our customer services team will assist you further to implement the best pattern.


With respect to PlayFab, we are in no way connected to them. PlayFab is an alternative product that does not offer as complete a solution as GameSparks. PlayFab relies on Photon for its multiplayer functionality. GameSparks provides a more comprehensive set of features than either of these offerings.


Kind regards,


John.

Thanks John, much appreciated as we're under a very tight schedule.

Best.

Hi Aidin,


What you are talking about sounds like it would be easily handled by our Challenge system.

Are you using Unity?

We have a fairly in depth tutorial on this matter available here.


Essentially, you could create a challenge that takes 5 turns.
You can then check in cloud code if the turns have been taken, and either calculate per turn or once all 5 turns are over.
GameSparks can send a socket/push notification to a player to update them that it's their turn or whatever you need.


Thanks,

Oisin

Login to post a comment