Hi guys!
Basically the question is in the title:
What is the best way to store game data if:
- It is levels data
- Items data
- Initial game settings
- Player profiles
- Social data cache
and
- Data should be updatable via network (new levels, new items)
- There should be some kind of pro-level editor for this database.
- There should be way to link (somehow) game resources to DB items. For example new level prefabs and item textures should be easily linked to DB fields.
-
It’s mobile project (iOS/Android)
Any ideas or even may be live examples
Hi Artfabrique,
It depends a lot on how flexible you want it, what platform and what scale.
-
PlayerPrefs are very fast, native and easy to use, they just save some values, strings or such along with the game, but they are not very database alike, but it works well for things like ‘remember my username’ on login screens for example. Also on web-player they are limited in size.
-
XML is written out as a text document, not quite the database yet, but it is easy to implement, and easy to import/export values to, there’s an example of the wiki just google xml + unity, there’s both a js and c example you can backwards engeneer. XML is good for configuration files, that you can change outside of the game, in a slightly good way. Json is slightly the same as this though there are some native differences. Also XML can be tricky on phone, you need to use some xml-lite libs, but it’s do-able.
-
SQL is the online, real database solution. But it require a lot more work to implement, and it require you to actually know what you’re doing, there’s no easy drag n drop solution. But for large databases, it is the best of these options, and it is good for lookups.