Hiding cards from players

Game development with Board Game Arena Studio
Post Reply
User avatar
Hornir91
Posts: 38
Joined: 15 October 2018, 06:39

Hiding cards from players

Post by Hornir91 »

Hi.

I'm a developer of Dungeon Lords and recently went into a problem with cards. In one of the states players are placing their cards with face side down, to hide it from the other players. So in a holder div on player board I have a card div with background-image of card's back side, which will be changed to corresponding face side when the card will be revealed.

And there is a problem, because when you inspect non-revealed yet card you can see in dev mode (F12) id of card, which can give the inspector an information which card is currently chosen before revealing it in a next state.

So I thought of something to hide the information in the dev mode by placing in a holder div an empty div with background-image of the card's back side and then when the card needs to be revealed just take the info from DB and create the card with corresponding bg-image.

Is that the way it should be done here, on BGA? Or you have some better ways to do it?
User avatar
RavingWanderer
Posts: 83
Joined: 12 May 2020, 16:08

Re: Hiding cards from players

Post by RavingWanderer »

You shouldn't send the id of the card to other players until it is revealed to them. This could be either in a notification or via state args. (E.g. in first state, you send notification "Player X plays a card face down in front of them", then in second state you send notification "Player X turns card over, revealing NAME_OF_CARD". Other players' browsers only find out from the second notice what the card actually is.
User avatar
tchobello
Posts: 694
Joined: 18 March 2012, 13:19

Re: Hiding cards from players

Post by tchobello »

hi

the problem is : an id always corresponds to the same card.
try to shuffle cards first...
User avatar
Hornir91
Posts: 38
Joined: 15 October 2018, 06:39

Re: Hiding cards from players

Post by Hornir91 »

tchobello wrote: 02 January 2021, 20:13 hi

the problem is : an id always corresponds to the same card.
try to shuffle cards first...
Thanks. After shuffling cards before inserting into DB they have now different id's in every game.
Post Reply

Return to “Developers”