- Home /
Best way to store large quantities of information
What's the best way to store large quantities of data?
Not too sure if this is beyond beginner skill but whatever...
My project consists of a A LOT of skills, and hard-coding each of them individually is getting a little frustrating. Basically, what i'm look for is a more efficient way to create, store and call the many variables that make up each individual skill. Something like a xls file where I can just input the information onto a spreadsheet, have my project "Search" for the skills and populate or update the "list" or array in the scripts. Kinda like synchronizing between script and spreadsheet... anyway...
At the moment i'm just using enums and creating skills for each enum with the base variables, but the hard coding is tedious and is only going to get worse as the list of skills is potentially huge.
If you could recommend me to any tutorials as well that will cover the topic, I would appreciate that.
Thanks
have you searched for tuts on using a database? X$$anonymous$$L?
Answer by SarperS · Sep 12, 2015 at 07:40 PM
You can actually use xls files, here are some top results from a 2 seconds search
https://github.com/kimsama/Unity-QuickSheet https://www.assetstore.unity3d.com/en/#!/search/excel
Looking into X$$anonymous$$L coding, it will be the best method, i think, for what I want to achieve.
What I want to do is to be able to add skills to the document, and have Unity automatically update the skill list to be accessed by the character/player with little hard coding of the actual variables that make up the skills. Naturally the skills will be an array of sorts, but what would the best method be to achieving this? Using dictionaries/lists, or what would your suggestion be?
Answer by Serdan · Sep 13, 2015 at 06:44 PM
Use ScriptableObject. It's Unity's built-in method for handling that kind of data. You can easily make a custom editor in Unity to create and edit these objects and Unity will automatically save changes when you save the project.
https://unity3d.com/learn/tutorials/modules/beginner/live-training-archive/scriptable-objects
Can scriptable objects be instanced? It isn't just the player that will be accessing this, NPC's will as well, so it's vital that the script can be instanced to multiple parties.
You can actually save your own scriptable objects as asset files and reuse them, reference to them from any other class you have in your game. Take a look at this http://wiki.unity3d.com/index.php/CreateScriptableObjectAsset2
Would I still use an X$$anonymous$$L file with it?