Do I need a database for my game?

1.7k views Asked by At

I will develop a game in java which is about chemistry experiments that include quizzes and lessons . I need to store only two things in my game which is

  1. Score of the quiz
  2. the experiments that the user finished in order to put some sign or change color or whatever to indicate that this one you have already finished it in the experiments menu

Do I need a database ? I read about XML and it used to store simple things . But as I far as I know that XML work with web and my game is offline, how am I going to use it in my case ? Also , someone told that I can use simple text-based format . But how ?

2

There are 2 answers

3
McAden On

XML should work fine and would probably be my approach to this problem. It's not tied specifically to the web. It's an extensible format for data that has many existing libraries in many different languages including java.

You also have other options like CSV files.

You can use a file-based local database like SQLite but it sounds like overkill for what you've described.

1
halileohalilei On

If you're not planning on making the game online, then you don't 'need' to use a database. You can use an XML (which can be used offline as well as online), or you can use SQLite.

On the text based format thing, it might seem easier to use, but it will cause you trouble on the long run. My suggestion would be to go with XML.

You can learn about XML here as well as how to parse them.