What format should i use for text files ?

Hello, what document format should i use: XML,JSON, or maybe any other?
I want achive a multi language quiz game, so quiz questions, answers, will be read from a file, also text for multi languages will be read from files, but idk what format should i use, XML,JSON or maybe a other(there will be alot of text, becuase it’s a quiz game) ?

JSON is seemingly becoming the new standard for good reasons; it’s the easiest to read and cheap to parse. Unity even has support for it built in(it is quite lacking though, so you’ll do well to make your own).

Format isn’t too important unless you wish to manually write by hand(keyboard?).

1 Like

I second the JSON for this as well. XML is great too but the problem becomes with headers and formatting is more expensive memory wise. JSON is human legible true but its also formatted and thats expensive too but it is cross platform. binary files can also be great especially with your quiz questions because of the fact that you DON’T want it to be human legible so in a way its semi-secured as you can’t just change the data. You can still read it though but it takes some work but not much. If you care about memory, I’d say bin and JSON. I you don’t care so much about memory and you want the files to be formated to work on the web aswell XML might be better as you can use CSS and HTML with XML without the need of JavaScript.

1 Like

Don’t neglect the good old csv. Makes moving in and out of spreadsheets a breeze. Ideal if your data can be presented as a table and there is no length variation between lines.

I would assume the capabilities of JsonUtility would be enough for reading in simple quiz questions, though. I doubt he’ll need any features that Unity’s JSON support doesn’t cover for what he outlined.