Thursday, 2 August 2018

Simplest way to save json backup data (flat files? db?)

I have a few ideas for using Node for simple web games where most or all of game state is kept in memory... but i want to have it backed up so that the node server can safely be restarted and the game state can be reloaded.What is a simple way to do this? I considered MySql and other database options, but don't want to bother making concrete tables and fields. I'd like to keep the dependencies low and the level of complexity low so this setup can be used in game jams.My intial idea is to have the game's state converted into a big json object, then written out to a json file at regular intervals (maybe 30 seconds), discarding any backups after a certain time. Are there any pitfalls with this idea? Any framework that does this?

Submitted August 02, 2018 at 06:57PM by Morphray

No comments:

Post a Comment