Basic Spec
OverviewThe game will be an asynchronous digital card game. Players will download the client. From there they play the game, which actually takes place on a server. The state of a players game is saved until the game ends, either with a victory or with a player conceding. If both players are connected, it will seem as if the game occurs in real time - though like most card games players take discrete turns, each of which is made up of a series of ordered actions. However, if you connect to a game that you are involved with but had been disconnected, you will see a replay of what happened while you are gone, and can resume your turn.
The client will be written in Kivy. Currently I can build something that works well for OSX or ios. I'm still working on android support - for some reason the build I have has a terrible lag for the touch inputs that really won't fly. I also should be able to do windows pretty easy - just haven't given it a shot yet.
- Menu for how to get into a game
- Apply model to graphical interface
- Animate model state changes into interface
- Send commands to server based on player input to the interface according to model
The server must handle a series of ongoing games, user accounts, and then state transitions for each game. Since there is no actual synchronous play (it is all discrete state changes) I intend to use a lightweight REST server like hug to manage the networking. The general algorithm looks something like this:
- Client sends an action command - this is tied to a specific way to change the model
- Server checks if the player in this state is authorized to make that move
- Server updates the model
- Server returns an acknowledgement or an error along with the new model state
- Clients will also periodically poll for whether the state has updated, and get the new state
The client and server are somewhat dumb in this sense, where the model has the guts of the actual game implemented.
- Contains some information about the Players involved
- Contains a Game definition
- Contains Spaces - these are places that Things can go. Those Things have a Position defined by the Space
- Spaces contain Things. Things are elements like cards or tokens. Things contain both Static properties and Dynamic properties
- Each type of object (player, game, space, thing) includes Triggers and Actions
- Calling an Action is the only way to cause the model to transform. An action results in an updated model, or an error state
(log in to comment)
ikanreed on 2018/10/14 03:47:
Ambitious. Is everything on the server synchronous? Are you transmitting entire gamestate every change?