Hi ,
I will develop a game in unity which is about chemistry experiments that include quizzes and lessons . I need to store only two things in my game which is
- Score of the quiz
- 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 , how am I going to use it in my case ?
1 Answer
1
There is no need for a database for this - that would be overkill, in fact. XML is just a format which, while often used online, is by no means restricted to web usage. You can store your game data in XML just fine, if you like.
.Net has a very rich set of classes for loading and working with XML. For instance, loading the document from disk is as simple as:
XmlDocument yourDoc = new XmlDocument();
yourDoc.Load(pathOnDisk);
In fact, if your data is small enough, you can skip the XML format altogether and store it in some simple text-based format you invent yourself, e.g. comma-separated.
For small amounts of data, you could also consider PlayerPrefs, which is a builtin way in Unity to store and load data.