Skip to content

Worked examples of challenging games

Alex Komoroske edited this page Feb 23, 2017 · 6 revisions

This page is for worked examples of the state and policy objects necessary for very complex games to make sure the general policy design is general enough.

Mysterium


type GameState struct {
  //The count on the clock
  Round int
  
  //Whether we're in the round where we all guess from one of the numPlayer hypothesis or not.
  FinalRound bool
  UsedVoteTokens GrowableStack("VoteTokens")
  `{GroupGuesser: PolicyZeroValue}`
  UnusedCrowTokens GrowableStack("Crows")
  UsedCrowTokens GrowableStack("Crows")


  `{GroupAll: PolicyLen}`
  UnusedAnswerCards GrowableStack("AnswerCards")

  `{GroupAll: PolicyZeroValue, GroupGhost: PolicyLen}`
  ClueCardDraw GrowableStack("ClueCards")
  ClueCardsDiscard GrowableStack("ClueCards") 

  //These are where the cards the users are guessing from during normal rounds go
  RoomCards SizedStack("LargeCards", numPlayers + 2)
  PersonCards SizedStack("LargeCards", numPlayers + 2)
  WeaponCards SizedStack("LargeCards", numPlayers + 2)

  //FinalCards are in the final round the numPlayers sets of room/weapon/person tracks everyone is guessing between
  FinalRoomCards SizedStack("LargeCards", numPlayers)
  FinalPersonCards SizedStack("LargeCards", numPlayers)
  FinalWeaponCards SizedStack("LargeCards", numPlayers)
}

type UserState struct {
  IsGhost bool
  //Hand of clue cards that we're considering, if we're the ghost.
  `{GroupGuesser: PolicyZeroVAlue}`
  GhostHand GrowableStack("ClueCards", 7)
  //Cards that we've been given by the ghost this round as clues
  ClueCards GrowableStack("ClueCards")
  //Whether the ClueCard has been given this round. Once this is true for all players (who don't have all three cards captured) then we're in the count down phase.
  ClueCardGiven bool 
  
  Color color
  ClairvoancyScore int
  //During normal rounds, the card in the track (e.g. Person, Weapon, Room) that we've voted on. In the final round, which track we've voted on
  Vote int
  //Where the final vote goes before we reveal everyone's vote.
  `{GroupOther: PolicyZeroValue}`
  FinalHiddenVote int
  //The tokens from OTHER players who have voted for or against our Guess
  OtherVoteTokens GrowableStack("VoteTokens")
  //CapturedCards are when we correctly guessed our card. When all three are captured, we just wait for other players to catch up.
  CapturedPersonCard GrowableStack("LargeCards", 1)
  CapturedRoomCard GrowableStack("LargeCards", 1)
  CapturedWeaponCard GrowableStack("LargeCards", 1)
  UnusedVoteTokens GrowableStack("VoteTokens")

  //The cards the ghost is trying to get this user to guess.
  `{GroupGuesser: PolicyZeroValue}`
  AnswerPersonCard SizedStack("AnswerCards",1) 
  AnswerRoomCard SizedStack("AnswerCards", 1)
  AnswerWeaponCard SizedStack("AnswerCards", 1)
}

##Secret Hitler

`{GroupNonFascist: PolicyLen}`
//Note: in games where hitler can't see other fascists, hitler wouldn't be in this list.
GroupFascist []int

type GameState struct {
  UnusedPlacards GrowableStack("Placards", 2)

  PlayedLiberalPolicies GrowableStack("Policies", 5)
  PlayedFascistPolicies GrowableStack("Policies", 5)
  
  FailedGovernmentCounter int

  `{GroupAll: PolicyLen}`
  PolicyDrawStack
  PolicyDiscardStack
}

type UserState struct {
  `{GroupNonFascist: PolicyZeroValue, GroupSelf: PolicyVisible}`
  RoleCard GrowableStack("RoleCard", 1)
  `{GroupNonFascist: PolicyZeroValue, GroupSelf: PolicyVisible}`
  MembershipCard GrowableStack("MembershipCard", 1)
  //Could be Chancellor Placard, or President Placard, or nil
  Placard GrowableStack("Placards", 1)
}