Sign In Register

How can we help you today?

Start a new topic

Turn-based Challenge - How to notify players about specific action

Heya,


currently working on a turn-based card game with Unity and Gamesparks (thanks for the Hearthstone tutorials, they help quite a bit).


I'm using LogChallengeEventRequests to perform certain actions (drawing card, playing card, using items) which triggers the ChallengeTurnTaken message. This is good because it tells every other player that something has changes.


However, i need to know exactly what each player did so i can simulate it in Unity (visually play the card, trigger an effect, etc). 


So i'm wondering what's the best way to tell other players what exact action has been performed? As examples, any of these could have happened:


- Player drawn cards

- Player played a specific card

- Player activated a specific item

- Player played a spell and targeted a specific opponent card


I had two ideas how to do this: 

  • Use Spark.message inside each of those logchallengeevents to send extra information to every player. I am not sure how fast/efficient this is (it's only a 1v1 game), plus it means i have to check multiple areas on the Unity side (listen to the scriptmessages and the challengeturntaken stuff). 
  • Add some temporary challenge scriptData of the last performed action, and check for it in the logchallengeeventresponse. Probably would require a timestamp to make sure i only perform the latest actions and don't repeat some. This could be the Spark scriptdata from each logchallengeevent that i copy to the challenge scriptdata. 

So i'm wondering if any of these two options is what i should be going for, or if there is a more elegant way to do this? 

Cheers,
Sven


2 people have this question
Login to post a comment