Best way to integrate a database for a Educational Quiz game

Hey everyone.

Long time reader, first-time caller. Thanks for your help!

I’m programming my first full-fledged game, and I need advice on how to construct the backend database.

Basically, the game is a language learning app, and will have a database of vocabulary to test.

I used to program in Flash, and for backend stuff, I would use a SQL database and a php script that exported an XML into the flash app.

Another way was just to hard code the database information as a giant array in the game, so no need to import anything, but the flexibility is lower there.

I would appreciate some advice as I am drawing up the programming blueprint, on what’s the best way to incorporate a flexible database into a Unity game. I see in the asset store there are sql, xml and database assets. And I’d like some help in planning what’s a versatile backend so I can keep reusing the engine for the future.

For this language game, it’s for learning Japanese Kanji, and a basic database would be the Word, The Pronounciation, and the Definition, etc. So I need to make a class that is a question set etc.

Right now, I keep use an Excel spreadsheet as my database. Is there a convenient way to export that into Unity C# the easiest?

Thanks, I really appreciate your help.

Curtis

You have many options. Some of which i’d consider viable are sqlite, xml or a custom ScriptableObject-Asset that serves as basically a fancy editable array. I think the easiest is the the scriptableObject approach. But depending on the features you plan to add, sql or xml might be more suitable (runtime edits if needed).

Can you recommend any sql/ xml assets or programs I can use to integrate with Unity?

Sqlite with any client you want to use for example http://sqlitebrowser.org/ (first google result). There are a lot of .net libraries you can use with unity, for example GitHub - robertohuertasm/SQLite4Unity3d: SQLite made easy for Unity3d (first google result)

For the type of data you’re creating, Excel is the best choice. ScriptableObjects can be a pain to edit in the inspector unless you put a lot of work into a custom editor. SQLite and XML are awkward for this type of data.

There are some open source libraries for reading Excel files, such as ExcelDataReader.

2 Likes

Creating a decent editor does not take more than a few minutes though (with basic create, edit, delete, maybe sort and filter functionality)

If you’re working with language, you’ll want spell check, possibly grammar check, the ability to move rows up and down, etc.