Open Zomis opened 4 years ago
Use a stack-based system with various tasks/effects/thingies.
Then use a Consensus-thing which is not resolved until, well, everyone has either agreed (automatically or not) or someone challenges.
For games like Coup or Exploding Kitten, if someone says "I want more time" and then directly continues again, the system should basically reset so that everyone again gets the chance to say "I want more time" or "Approve/Reject/etc."
The same can be applied in Avalon when voting for a team or performing a mission, only that the end condition is a bit different or that there is no automatic response. This would allow players to change their vote for example.
Should all such interactions include the steps when changing your mind be recorded as actions in the database, or only the most recent one? For simplicity it's easier with recording it probably, the only negative thing is that it's possible to spam the database that way (which is already possible in a bunch of other ways...)
For Coup, an interesting scenario that can happen is that two people can say that they want to challenge this, but then later both change their minds and neither player actually performs the challenge. How to model that in a consensus approach?
End consensus step once all players have chosen (automatically or not) and at most one player has challenged might not be enough as two people might want to switch from "Challenge" to "Approve" at the same time.
Alternatively, end consensus step as soon as at least one player has challenged claim and the one who clicks first has to just suit themselves?
Some games can be time-based, such as Ricochet Robots, where you have a limited amount of time to do an action.
Other games are bluff-calling games, or games where you can respond to someone else's action. Such as Coup (counteract / challenge) or Exploding Kittens (Nope-card). It would be annoying to ask each player "Do you want to challenge/counteract or do you accept the current action?" so it would be preferably to have a timeout where after 5-10 or so seconds you automatically accept (unless you click a button to ask for more time)
In time-limited games, server can save timestamp of when actions are performed (this can be handled in the same way as "random" state).
For games where you can respond to other people's actions, it would probably be best if the client handled it somehow. For example, if you don't do anything for 10 seconds, then send that action. Could be specified in
supportedGames.js
and handled by the DSL Game Vuex Store?