quiz data strategy

I’m writing a quiz game with a lot of textual data. It looks like the TextAsset class is appropriate for placing the data in the game.

I’m looking for database-like functionality to load the data into tables, records, and fields. I can probably use the Array class in Javascript or ArrayList in C# to store the data into a database-like format, but what about helper functions to parse the lines of raw text data, parse tabs, etc.? Is this kind of functionality available somewhere or do I need to write it myself?

Also, what about using external files? Is this possible for a desktop game only, or also for iPhone web games?

Thanks,

Brian

you could make it for webplayers and standalones by using a mysql database for the questions and answers then modify the server highscores scripts for that. You would need a website along with php mysql access though.

Hello mythic,

You should look into the documentation on the string class on MSDN or Mono’s sites. They include various helper functions such as Split(), ParseInt(), etc. With those you’ll be able to separate the fields in your tab delineated string with relative ease.

Also, as you mentioned arrays in your OP. The split function returns an array. I use it myself to separate out tab delimited fields in a high score table.

var splitScores = new Array();
splitScores = scoreData.data.Split("\t" [0]);

Thanks for the help. I’ll probably take this approach. One thing I’d like to do though is build an SQL API that would be generalised to work either with local or internet based data. Local data could include external files or embedded .txt files.

– Brian

I was thinking about using Unity to make a quiz game as well, how is that coming along?