HabitRPG / habitica

A habit tracker app which treats your goals like a Role Playing Game.
https://habitica.com
Other
11.89k stars 4.06k forks source link

feature: Character backups #2826

Closed snicker closed 8 years ago

snicker commented 10 years ago

While I was going through tickets related to unexpected death and character value restores this morning, I came up with a crazy idea: character backups.

Most multiplayer RPGs have at least one backup save for character that either a GM can restore or use to investigate something that may have happened (Did the player have item X yesterday as they claimed and it disappeared? Did they die unexpectedly? etc).

This would certainly provide an opportunity for people who have experienced a bug, or could not get internet access, etc, to restore a character after something happens.

I see a couple ways of implementing this:

  1. Server side backups of the character at cron for only the past day. This could get expensive on the space side, but perhaps they could be compressed as they'd only need to be accessed during a restore.
  2. Client side manual backups that players can click and download. This would essentially be the same JSON export that comes out right now. A restore would only replace certain values back into the server database.
  3. Client side backups in local storage. This takes the manual thought of a backup out of the users' hands and also negates the concern for server-side data storage.

The problem with #2 is it gives an opportunity for "cheating", which Habit does a good job of discouraging since there is no real reward here other than personal progress and "feel good"-ness.

Solution #3 would have an issue with restoring only what the last character sync was on whatever client they were on, which could negate any damage from boss battles etc.

With solution #1, obviously we are talking about a huge increase in the size of the database, though we could probably get very good compression ratios considering the characters are nothing but text. Backups would only take place on active users and would only stick around until the next cron or the user doesn't log in for X amount of days.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

snicker commented 10 years ago

Node has built in compression:

http://nodejs.org/api/zlib.html#zlib_examples

We could compress the entire user object and store the backup as another field on the user.

snicker commented 10 years ago

I'll run some tests later to get an idea of filesizes

lemoness commented 10 years ago

Ryan mentioned in tavern that this could be combined with a showcase, which I would love. I've been really debating what to do when my character hits level 100 because I can't bear the thought of losing my stuff, but I know the game won't be as fun. A showcase would help combat this.

deilann commented 10 years ago

half asleep addition:

purchase "save states"

each save state can have 1 showcase & latest one can function as a backup

caveman1337 commented 10 years ago

In my opinion, 1 would probably be the best option. 3 is definitely a no-go, as the users information could be easily accidentally wiped by when they delete history/cookies/etc. 2 is a nice option to have, however I wouldn't want that to be the only means of backup. The cheating isn't as much a concern to me. I'd rather see some people cheat and ruin it for themselves than see someone lose a large record of their progress and personal growth because of a bug.

1 seems like a good idea because people tend not to learn to backup their work until after they've lost it. I would suggest keeping the option to import and export your own data, especially if people aren't able to always have internet, but still want to keep track of their progress. However, often times there can be bugs or oversight that end up wiping or corrupting user data. If anyone's ever played Kingdom of Loathing, there was a time when Jick ended up accidentally losing about a month and a half of user data. If backups are to be done, they should be done with some redundancy.

I know that it is the more expensive option, however it is beneficial for both the user and the website managers to keep external backups of user data. If something happens that trashes the website, it will lose at most a day of data with regular backups. Without regular backups, you could end up losing months worth of data. (or all of it depending on what happens)

To keep costs down, I would suggest only keeping a limited amount of backup data for each user; possibly keeping a bit more data for contributors. Possibly save a snapshot of every user's information whenever they log in for the first time in a day and only keep 10-20 snapshots at a time. This would give each user plenty of time to notice something wrong with their account before the records were overwritten by new ones. Even if someone left for a year and logged in at a later time, they would still have 9-19 snapshots left from before they left to look back to if something happened in that time.

deilann commented 10 years ago

I like an alternative of 1 combined with 2 -- server side backups that you save yourself. So they're hosted on the server, but not automatic. Then, have automatic updates-- level up triggers a save, frex.

On Fri, Feb 14, 2014 at 9:53 AM, caveman1337 notifications@github.comwrote:

In my opinion, 1 would probably be the best option. 3 is definitely a no-go, as the users information could be easily accidentally wiped by when they delete history/cookies/etc. 2 is a nice option to have, however I wouldn't want that to be the only means of backup. The cheating isn't as much a concern to me. I'd rather see some people cheat and ruin it for themselves than see someone lose a large record of their progress and personal growth because of a bug.

1 seems like a good idea because people tend not to learn to backup their work until after they've lost it. I would suggest keeping the option to import and export your own data, especially if people aren't able to always have internet, but still want to keep track of their progress. However, often times there can be bugs or oversight that end up wiping or corrupting user data. If anyone's ever played Kingdom of Loathing, there was a time when Jick ended up accidentally losing about a month and a half of user data. If backups are to be done, they should be done with some redundancy.

I know that it is the more expensive option, however it is beneficial for both the user and the website managers to keep external backups of user data. If something happens that trashes the website, it will lose at most a day of data with regular backups. Without regular backups, you could end up losing months worth of data. (or all of it depending on what happens)

To keep costs down, I would suggest only keeping a limited amount of backup data for each user; possibly keeping a bit more data for contributors. Possibly save a snapshot of every user's information whenever they log in for the first time in a day and only keep 10-20 snapshots at a time. This would give each user plenty of time to notice something wrong with their account before the records were overwritten by new ones. Even if someone left for a year and logged in at a later time, they would still have 9-19 snapshots left from before they left to look back to if something happened in that time.

Reply to this email directly or view it on GitHubhttps://github.com/HabitRPG/habitrpg/issues/2826#issuecomment-35107481 .

paglias commented 8 years ago

Can this be moved to Trello?

Alys commented 8 years ago

I've placed a note about this issue in this Trello card: https://trello.com/c/wYKm5cS5/98-reports-statistics-history-log-enhanced-graphs-meta-data

I'm closing this now since we primarily use GitHub for bugs rather than feature requests.