Whats the best option for an item database for a single player game

I was going to use SQL as I know how to use it and that it can do everything I’d want it to do but I read online that you need an internet connection and to connect to a server for it to work which if true rules SQL out as I want this to be an offline game.

I need the item database to be able to be filtered through, i.e. if an Ice enemy is killed I want them to only drop an item which has the “Ice” element or if a “gunner” is killed I’ll want them to only drop a gun and/or a ice gunner dropping only items which have both the “ice” and “gun” attributes.

I would also need it in separate tables/ lists so that columns which aren’t applicable to different items aren’t assigned a value to them. I.E. I might want in a table for bombs a column for the blast radius of the bomb, whereas obviously a helmet wouldn’t have a variable for a blast radius. So it would make sense having them both in separate tables to be more efficient.


Should I use SQL, XML, JSON or other format to create my item database for an offline game in which the database can be filtered through by one or multiple different criteria to return a specific item and can be split into different tables relating to the different objects. I.E. if bombs need a blast radius variable and helmets don’t, and there are 100 different helmets, it seems pointless and a waste of data writing out that each helmet has 0 blast radius.

You may want to take a read through this:

if its offline you can store all sorts of things there instead.

I know this is old but SteenPetersen’s answer is really incorrect. You want an item database. How on earth do you suggest effectively storing that in PlayerPrefs? PlayerPrefs is good for single values. Hell, you could serialize an entire class into it as I have done before, but it’s not super effective and it’s single threaded. Storing a huge item database in there is a terrible idea.

I’ve done an offline game and have used SQLite and had great success. You treat it like a database and can query it like one but it’s all offline.

Check out: