- Home /
Is it safe to store & read data to XML file for mobile game development
Is it safe to store & read data to XML file for mobile game development. In my game there are several data to store I was thinking about to save all data in xml instead of player prefs
Thanks Fattie. I like this Whydoidoit Unity Serializer.+1 "is it safe" means for game optimization
I think I know what you mean.
X$$anonymous$$L is NOT THAT FAST. But don't forget IT IS VERY LI$$anonymous$$ELY that it won't matter, other operations will bind you. The bottom line is yes many - most - games use X$$anonymous$$L with no problems.
In the rare case that performance is a problem,we need to ask an expert on X$$anonymous$$L and the like. So I will go find an expert :)
Since they fiddled with UA again I'm getting notifications on questions I've never seen and no notifications on the ones I've answered before :S
Answer by ZorNiFieD · Dec 29, 2012 at 07:58 AM
I believe here by "safe" you mean "is it fast enough for ga$$anonymous$$g use", It might be better to use "binary" or something. Let's find an expert.
So Unity Serializer uses binary to be fast and JSON to be compatible with servers - X$$anonymous$$L is very very wordy and so a lot slower. All that said, your biggest concern will be a balance of -
a) how specific you can be about what you are saving (discovery of items to save in a class by reflection is slower than doing it explicitly, but can be optimised as it is in US)
b) The IO speed of the medium to which you are saving the data
You can in some ways alleviate (b) by perfor$$anonymous$$g IO writes on a separate thread.
The first question is - how often are you saving data and loading it back?