extreme-carpaccio icon indicating copy to clipboard operation
extreme-carpaccio copied to clipboard

Persist game state

Open jak78 opened this issue 6 years ago • 3 comments

I would like the game state to be persisted when the game server stops.

Use-cases:

  • manage a server crash
  • split the game on 2 different days
  • manage a laptop shutdown because of low battery 😆

Every game iteration, the game state is saved into a LevelDB local database. On server startup, the game state is rebuilt from the state stored in LevelDB.

I have a pull request almost ready to submit.

WDYT?

jak78 avatar Apr 23 '18 15:04 jak78

Sounds exciting!

Here's my understanding:

Scenario: Reload existing state after stop
Given I am the facilitator I have started a session
And for some reason I had to stop the server
When I start the server again on the same machine
Then the state of the game until the moment the server was stopped should be loaded
And the game should resume from that point on

Scenario: Reload existing state after crash
Given I am the facilitator I have started a session
And for some reason the server has crashed
When I start the server again on the same machine
Then the state of the game until the moment the server crashed should be loaded
And the game should resume from that point on

And I wonder about:

Scenario: Start over after a previous session
Given I am the facilitator I have started a session
And for some reason I stopped the server
And I want to start a new session without the previous state
When <what should happen here?>
Then server should start with a clean state

dlresende avatar Apr 23 '18 16:04 dlresende

That’s correct. Last scenario :

Scenario: Start over after a previous session Given I am the facilitator I have started a session And for some reason I stopped the server And I want to start a new session without the previous state When the facilitator deletes the data directory Then server should start with a clean state

That’s how it works in my branch.

jak78 avatar Apr 25 '18 15:04 jak78

Cool!

Let's just make sure we make these instructions available in the README.

That said, very excited about this feature.

dlresende avatar Apr 25 '18 17:04 dlresende