-2

I searched all around Google and YouTube and I could not find a definite answer to my question.

Should I use PlayerPrefs or XML files to save the all the data that is in Version 1 of my game? Or is their any other format of saving that you prefer?

My game does not have much data that will be saved onto it, but it is not very minimal either. The things that I will save in my game are: Options Menu (Sound FX on or off, game music on or off, and the 10 second Story Animation on or off), Scores for the distance you go in my game (around 10 scores, kinda like a billboard), and a very simple store where you can unlock two more characters after you have achieved a certain distance in the game. Their is not much right now but I am going to be releasing updates in my game and it will continue to grow and expand, so I would like the savings option that can be expanded upon the best. I tried my best to explain my unique scenario, if you need more information just let me know and I will add it. Thank you! :)

Stephen George
  • 27
  • 1
  • 11
  • funnily enough someone just asked this ... – Fattie May 13 '16 at 20:56
  • Possible duplicate of [How to read and write a xml file into the same location?](http://stackoverflow.com/questions/37216851/how-to-read-and-write-a-xml-file-into-the-same-location) – Fattie May 13 '16 at 20:56
  • It is close but not exact! The only thing that is the same about my question and the other one is that they are already using XML files to save, I am asking for other people's insight on what they think I should use, either PlayerPrefs or XML file. :) @JoeBlow – Stephen George May 13 '16 at 21:04
  • @StephenGeorge You have **NEVER** unaccepted answers in your questions and most of them actually solved your problem. I suggest you go to back to all of them and accept the ones that solved your problem. Here is an image on how to do that http://i.stack.imgur.com/uqJeW.png – Programmer May 13 '16 at 23:02
  • 1
    hi @StephenGeorge Indeed I urge you to go back to the two questions you have not "TICKED", and be sure to "TICK" any reasonable answer. You don't have to worry about whether the answer is "perfect". You need to "TICK" to get points and avoid moderation. Secondly it is the social norm - it's impolite to forget to TICK an answer. If your question has been there for awhile it's time to TICK. – Fattie May 14 '16 at 12:53

1 Answers1

1

I searched all around Google and YouTube and I could not find a definite answer to my question.

That's because both of them will accomplish the work. It doesn't really matter which one you use. They both can save your game data.

Now, In my own opinion, you should use XML for portability reasons.

When you save your game data with PlayerPrefs, you will be stuck with it on that platform. For example, PlayerPrefs is saved as .xml on Android and .plist on iOS and Mac OS, .dat on Windows App Store and as a registry key on HKCU\Software\[company name]\[product name] key on Windows. These are not interchangeable.

  • Assuming you want to allow players to transfer all player settings from one platform to another, that would be a problem. By using xml, your game will be able to use it on any platform you want. So a player can take their settings from their Android phone and use it on their PC or Mac without problems.

  • When you want to change your game engine from Unity to another such as UDK, you will have a hard time using the player's old data. I've seen a question about transferring player's data from Unity to another game engine. If this person used xml, that wouldn't be a problem at all. You will get negative feedback if your players lose their data due to game engine change. If you think that you never have to change game engine, remember that you are not the founder or the CEO of Unity Technologies SF. They make their own decisions and any other competitor can buy them anytime and shut them down. This happens all the time. Stick with xml if you really care about PlayerPrefs vs Xml.

Programmer
  • 121,791
  • 22
  • 236
  • 328