Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist games #253

Open
nirs opened this issue Oct 27, 2017 · 1 comment
Open

Persist games #253

nirs opened this issue Oct 27, 2017 · 1 comment

Comments

@nirs
Copy link
Member

nirs commented Oct 27, 2017

Currently when a game is played, the server generate a new game state on each cycle, and send the new state to all clients. Clients process the new state and send updates to the server. When the game is completed, the game history is lost.

If we would keep the game state, we could enable these use cases:

  • Debugging a driver module, by playing back the game, possibly by moving forward or backward frame by frame.
  • Keeping scoreboard with the best drivers ever played, and watching the games later
  • Creating a competition management system, selecting players for games, selecting the winners for the next step, and so on.
  • Having a playback UI, we can create a web demo, see Web demo #177

The simplest way to persist the game state is to keep a list of states on the server, and persist the list as json text when the game is completed. To playback a game, the web interface can load the game state list from the server, and playback the game.

We probably need additional metadata, we will work on it later.

Possible implementation:

  1. Add sqlite database to the server
  2. Add rose/server/db.py to access the database
  3. Keep game history list in rose/server/game.py. Once a game is started, append the game state once per game tick.
  4. When a game completes, create json text from the history list, and store in the database.
@nirs
Copy link
Member Author

nirs commented Oct 27, 2017

@rollandf can you review this proposal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants