Consider following situation. In a game you can perform crafting: i.e. create new items from existing ones (like in Minecraft). I have following game entities (simplified):
- item: atomic part;
- recipe: a list of items resulting in other list of items.
what would be best structure to store all the recipes in a game? In general I consider would be using SQLite database for storing it. However game is not a general type application, so, would it be better to use XML + in-memory structures for storing it?
Database have some major advantage to me, it's much more DRYer in my opinion. You also can query it. But I have big doubt if direct database performance in sufficient for smooth gameplay. On the other hand you can use say, XML to store all of the recipes and use im-memory storage and query it with LINQ. If finally it all results in in-memory structures then database seems to have much overhead, since it's used just as a storage. Or is it still better to use DB?
Solution:
For now I've dicided to stick with XML as storage for recipes. One more advantages it gives, and it's a major for me — final solution is more portable to other platforms, since XML is available, like, everywhere.