- History of each battle must be stored so battle statistics can be calculated. At the moment this would simply be for determing win/loss count.
- The current state of battle must always be available (a user should be allowed to close the app and resume play by choice or by push notification).
- Must be efficient and have as minimal database requests as possible. Potentially there could be many requests per second with a larger client base so the less requests the better!
[color=#000000][font=Arial,]The general game flow:[/font]
- Player selects another player to battle and a turn-timeout value, then waits for confirmation.
- After confirmation succeeds the initiating player must take their turn. Taking a turn simply means selecting an attack/move to do.
- The damage dealt etc is calculated by the player taking their turn and propagated to the database. A push notification is then sent to notify other player it is their turn.
- Process is repeated until a win condition is met (most likely when a particular players health is at a certain level or if their turn times out).
[color=#000000][font=Arial,]Can anyone suggest ways to incorporate this efficiently into a database?[/font]