How can I store things with Unity?

Hello!

My question is: how can I store things in Unity? For example, I want to save the game or save position of things. How it is possible?

I read, that is possible to use MySQL somehow. I’m a little bit familiar with MySQL and I know PHP. How can I store things in a MySQL database with Unity, then read it out?

Can I use other method for saving / loading informations?

I was thinking about a block engine (like Minecraft has), but with limited size, like 2000x2000x128 blocks. I don’t have idea, how to store the blocks position / type. I was thinking about the MySQL database which should be OK for multiplayer. Also, I calculated the size, and without compression that previously mentioned map size should be close to half gigabytes.
That is not so good.

If you know any possibility of storage, please tell me.

Thanks in advance!

I know that someone on youtube called Burgzergarcade has done some videos about this.

One of them:

there are about 9 videos about it and Im not sure if this is exactly what you’re looking for, but you might want to start looking here

That’s all I know, but I hope it helps :wink:

For small things, use PlayerPrefs. For large data sets, it’s most efficient to save binary data with System.IO, such as WriteAllBytes, preferably using some kind of compression. Using simple run-length encoding would help a lot; you can zip/unzip things but that requires finding and using some managed code zip libraries, since there currently is no built-in zip support.

–Eric