Database For Text Game
Hello everyone, I am currently making a text based adventure game. The game has now got so big, that it can't be completed in one sitting. So, I need to store the Player's data and make it accessible through accounts. However the problem is that there are way too many things that I can do, but I am still a beginner. What Should I use to store the Player's data and accounts?
Here's some ways that I have brainstormed:
**Please tell me if these ways are efficient or not **
- Pickle a file with the data and accounts. To load the game, I would have to unpickle it.
- Store the data on some sort of database like sqlite3.
*PS. I have store the player's variables inside a class so that it's easier *
Any help would be appreciated.
Also try repl.it-DB (turn on explorer mode)
Docs https://pypi.org/project/replit/
I think JSON is a great option as well.
@Coder100 Yeah, but the players could use other's accounts as well.
why? @Jackbaklava
@Coder100 Because of json's readibility, players could open the file while logging into their account and try all the possible accounts.
Anyways, your current solutions are great!
@Coder100 Thanks, but a problem is that these ways store data on a a file. So, I think it might be possible for the viewer to view the file and try other people's accounts. Is there any way to store data on the web and not on a file?
@Jackbaklava Sure, use something like firebase.
But for these things like passwords, you should be hashing them. @Jackbaklava
@Coder100 Yeah, that's right. I though of doing that earlier, thanks for your help. I think I might be pickling the player's data and storing the accounts using a hash table (dictionary in pyhton). Let me know what you think about it.
no problem :D @Jackbaklava
nice idea btw @Jackbaklava