Best way to store lots of data

I want to know the best, easiest way to store lots of data. For example, a game can have lots of items, each item would have an item type, some would have damage, some would have durability, most would have a recipe but then the recipe would also contain item names and how many of each material is required, not to mention the level required for crafting, speed at which it carries out its function, image for the item etc.

I am currently using folders and string/int values because its an absalute pain dealing with tables full of quotes, curly brackets, square brackets, tables within tables, then dealing with how to indent it all so it’s readable. Suerly this isn’t how people do it? Suerly there’s another method, a friendlier interface or something? But I feel like it may create lag having so many int/strings, and cloning/editing folders/values is also becomming a pain. I just want to make a template i can easily read and add/tweak/remove values, and if need be add additional properties to items, and easily reference from anywhere.

Do people really program 100s of lines of this:
image
and are able to easily read it?

I’ve tried searching for solutions but they don’t answer this level of complexity.

The part where you say, “People actually program 100s of lines of this”

I do this, but in a [Module], for example, storing over 500 items, very organized and very well identified each Item_

It will make the process of dealing with Data very easy, if you understand what you’re doing, of course…

1 Like

Coding 100s of lines is much more efficient than using instances since your game now has significantly less instances. Also, you can just Ctrl+F and you can find the value to change if you need to change any values for a future update.

The first thing you need to know about this method is that you must use module scripts. You don’t want hundreds of lines of this kind of code in a server script, and it will make your workflow much more easier.

Secondly, if you have experience with a spreadsheet software such as Google Sheets or Excel, you can put your data in a table and use formulas to format your data so it can go into an array.

If you don’t have experience with Google Sheets or Excel, you can just copy the format of your table and paste it as many times as you need so all you need to do is enter the values.

3 Likes

Yes, perhaps not 100’s but here’s an excerpt from my code:

type basicValue = {name :string, type: string, default: any, datanumber :string, catagory: string}

local m = {}

local types = {
    number = "NumberValue",
    bool = "BoolValue",
    string = "StringValue"
}
m.Types = types

local defaultBanReasion = "For being a monkie"
m.Info = {
    [0] = { name="LastJoined", type=types.number, default=0 },
    [10] = { name="FirstJoined", type=types.number, default=0 },
    [11] = { name="TimesJoined", type=types.number, default=0},
    [20] = { name="TimeSpentInGame", type=types.number, default=0},

    [30] = { name="Banned", type=types.number, default=0}, --time when ban/mute expires
    [31] = { name="BannedReasion", type=types.string, default=defaultBanReasion},
    [40] = { name="Muted", type=types.number, default=0},
    [41] = { name="MutedReasion", type=types.string, default=defaultBanReasion},
    [50] = { name="CreateTeamBanned", type=types.number, default = 0},
    [51] = { name="CreateTeamBannedReasion", type = types.string, default=""};
}

type settingValue = basicValue & {help :string?}
m.Settings = {
    [1000] = { name="Music On", type=types.bool, default=true , help="Toggles background music."};
    [1010] = { name="Music Volume", type=types.number, default=0.1 , help="Changes background music volume."};
}
1 Like