Voting mechanics

Game development with Board Game Arena Studio
Post Reply
User avatar
Benoit314
Posts: 82
Joined: 02 April 2020, 22:12

Voting mechanics

Post by Benoit314 »

I would like some advice to implement the voting mechanics of Hellapagos. My question is about the states to implements, do they make sense or is it too much? I'm asking this question because obviously, I get the notification about my state.inc.php file being too long in the validator. The voting mechanic is not the main part of the game, so there are other game states for the rest of the game.

So, from the rules:
Votes are necessary in the event of a water or food shortage(or if the players must leave the island, but do not have enough seats on the raft). The first player of the round counts to 3, and everyone simultaneously votes against another player by pointing at that player. Whichever player has the most votes against him is eliminated. You are welcome to debate before voting in order to agree on a strategy. The first player decides when to end the debate.
A player eliminated by a vote due to a shortage can save their skin by playing a card of the missing resource. In this case, the castaway survives, and there is no need to re-vote. They could also shoot another player (if they have a gun and a bullet) to reduce the amount of castaways that need food and water.
If several players receive the most votes, the player with the First Player card chooses which player is eliminated. The First player always gets to choose, even if he himself is one of the players tied for elimination
Couple of cards affecting the votes:
  • Club: gives 2 votes instead of one
  • Crystal ball: votes in last, after seeing the results of everyone else
  • First player: decides who to exclude if there is a tie
  • Conch: player is immune to a vote
So my general understanding would be to do different server states:
  • Debate (activeplayer == first player)
  • Vote 1 player to exclude (multipleactiveplayer, everyone alive excluding Crystall ball owner)
  • Vote in last (activeplayer == Crystall ball owner)
  • Break tie (activeplayer == first player)
  • Save your skin (activeplayer == player with most votes)
What is your opinion about this? Do I use a single multipleactiveplayer states or 5 different ones?
User avatar
apollo1001
Posts: 191
Joined: 21 July 2015, 10:41

Re: Voting mechanics

Post by apollo1001 »

Based on the rules you have given, I would have set it up as 2 player states with an intermediate game state:

voting (multiactiveplayer) (actions: placeVote)
votingtransition (game)
resolution (activeplayer) (possible actions: placevote, saveBacon, resolveTie)

The transition state can handle setting the correct player to be active for the resolution actions as required.
User avatar
Benoit314
Posts: 82
Joined: 02 April 2020, 22:12

Re: Voting mechanics

Post by Benoit314 »

Yeah, looks good. So you include the debate in the first vote as I understand. Seems fine to skip it.

For the "descriptionmyturn" and "description" in state.inc.php, how would you handle it for the resolution state since the action to perform is different? (Voting versus playing a card)

Is it possible to change the text server-side, or I would need to do it in js?

Thanks!
User avatar
apollo1001
Posts: 191
Joined: 21 July 2015, 10:41

Re: Voting mechanics

Post by apollo1001 »

You could pass an args variable from the server which states which type it is and then update the label to the correct one client side
Post Reply

Return to “Developers”