I’m making a browser-based card game (think Magic: The Gathering) and looking to use Nakama, but there’s one part I’m not sure about.
A player’s library, where they draw cards from to their hand, has to be “secret” – to prevent cheating the player(s) cannot know what the next card will be until they draw it. This of course means that piece of game state cannot be stored on the client side, but when they draw it there needs to be little or no latency in revealing the card so as to have a smooth play experience.
So while most of the freely viewable shared state of the game (the cards in play) is shared equivalently to all players, a player’s library only exists server-side and can only be accessed through an API call so that whenever a player looks at their library, all players know that they looked because the API call will also update the little log of actions taken by players. So in this way the players cannot secretly cheat without anyone knowing.
My initial effort to build this was with firebase, and the latency was too much – calls to their cloud functions API had around 0.5s - 1.5s delay. It felt clumsy.
Will I be able to accomplish this with nakama in a latency-free way? In short, will I be able to make parts of game state only accessible through dedicated API calls, and when those API calls update game state, will client state update fast enough that nobody will notice a delay?
(Also if anyone thinks of a better way of accomplishing this I’m by all means open to suggestions!)