Making my first game. I have finally managed to get both JSON and binary de/serialization working to save/read the data needed to generate a level. Level data is mainly arrays of ints and bools with two structs. (An average level is 1.500 kB in binary and 10kB in JSON)
My game will hopefully have upwards of 500 small puzzle levels. Let’s say 100 levels in each 5 catergory of very easy through very hard. What is the best way to store all this data? Do i make a file for each level and load the required level from file. Should i divide the files into directories for each category? Should I put all the level data into an array of levels and save that big array to file? Or something else completely.
What is considered best practise or good/bad practice?
Note the data is only level initialising data. I don’t need to save any progress level data other then level completed/incomplete which I can do in player prefs.
Hi @whocaresitsmeokay :
As far as i know i would like to use one file and all levels in it because if you made too may “json” files unity will create too many “mata” file for them and also for you it will be difficult to manage (from management i mean searching file, updating file, finding errors etc ). But if their is just one file it will be easy to do update and finding errors. and also loading data form exterior file is little slow so if you have many files each for single level then you have to load data for each level form exterior file which will make your game slow. so if you have one file then you just have to load it one time may be at game start or some where else and use it. Also in future if want another level to add in game then you just have to update your levels file and you done.
Their another option called “Scriptable Objects” you can use them if want. Seem pretty good for your situation.
Unity Connect
Might this help… good luck. 