0

I am making a simple 2D java game following a set of tutorials from youtube. I am trying to figure out what to use as a database to store user accounts, each users inventory, etc, because it makes sense not to trust the users inventory file. But to do this should I create my own text based database and have it call that each time a user logs in, and amend it each time a user find a new item or gains additional currency? Or should I invest time in learning SQL or some other database? And are databases commonly used for a 2d tile based game for a players location? Or is that just stored in memory?

Bob T.
  • 3
  • 2

1 Answers1

0

The proper solution is definitely to use a database. Here are three good SE questions that will explain many of the benefits:

https://softwareengineering.stackexchange.com/questions/190482/why-use-a-database-instead-of-just-saving-your-data-to-disk

database vs. flat files

https://softwareengineering.stackexchange.com/questions/209123/when-should-use-of-database-be-preferred-over-parsing-data-from-a-text-file

These principals apply to any application that needs to store data (requires a persistence layer), whether is a 2D game, a web-site or whatever.

Having said that, its possible that using a database is in fact not the best option for you. Basically if you need to build this game quickly and you are not overly concerned about its integrity, learning how to integrate a database into your application may be overkill. However, if you want any data driven application to be high quality and scalable in the long term, you should use a database.

Community
  • 1
  • 1
lockstock
  • 2,359
  • 3
  • 23
  • 39