62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 29 Oct 2015 05:21 PM |
I don't want to exceed it.. I'm not done adding stuff to the table below.. Do you think Datastores will be able to save all of it? I'm gonna keep adding more tables for more buildings. It'd be good to know beforehand how much more space I'd have left. Tell me if it won't be able to save this, or save many more values.
local list = { LastLogin = os.time(), BoomCannon1 = {}, BoomCannon2 = {}, BoomCannon3 = {}, BoomCannon4 = {}, BoomCannon5 = {}, MachineGun1 = {}, MachineGun2 = {}, MachineGun3 = {}, MachineGun4 = {}, MachineGun5 = {}, Cannon1 = {}, Cannon2 = {}, Cannon3 = {}, Cannon4 = {}, Cannon5 = {}, Cannon6 = {}, Flamethrower1 = {}, Flamethrower2 = {}, Flamethrower3 = {}, Flamethrower4 = {}, Mortar1 = {}, Mortar2 = {}, Mortar3 = {}, Mortar4 = {}, RPG1 = {}, RPG2 = {}, RPG3 = {}, Shock1 = {}, Shock2 = {}, Sniper1 = {}, Sniper2 = {}, Sniper3 = {}, Sniper4 = {}, Sniper5 = {}, Sniper6 = {}, } |
|
|
| Report Abuse |
|
|
Locard
|
  |
| Joined: 13 Apr 2014 |
| Total Posts: 3516 |
|
|
| 29 Oct 2015 05:22 PM |
| Look to see if it can be saved in JSON. If it can, it can be saved. |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2015 05:23 PM |
| http://wiki.roblox.com/index.php/Data_store#Data_limit |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 29 Oct 2015 05:24 PM |
| Post an example please? I've never tried saving in JSON. Though I've heard of it, and seen it, in rare moments. |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 29 Oct 2015 05:27 PM |
I don't even understand what that article states, cody.. >__<
|
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 29 Oct 2015 05:30 PM |
I look a quick peak at JSON. I understand it now, though could take some practice. If I used JSON to encode this huge table, then save the new format to Datastores, would that increase my data limit? I need to add many more tables!
Reason why? Yes.
For every structure you place, it gathers all the data. Aka:
BoomCannon1 = {Upgrading=true (or false),0--upgrade time would go here, 2 --level}
And then when the table is loaded a loop gets all the data and loads all the structures. Like in Boom Beach or CoC. |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2015 05:33 PM |
@OP That is a pretty strange way to save data. Only include data you are going to save first off, not empty stuff. Since you are using only a string-key + table, I would just have the string and the table in two separate indexes rather than string key then value.
Example:
{"BoomCannon", {Level = 5}}
When you iterate over it, it will make much more sense.
|
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 29 Oct 2015 06:20 PM |
| You did make some good points, however, a close-to-maxxed-out player is going to come around and all those tables are going to be necessary for each building. Is JSON required? Or is Datastores good enough to save this on it's own. |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 29 Oct 2015 06:32 PM |
Storing a table will take up the same amount of space as converting the table to a JSON string and storing that.
You should look into data compression. |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2015 06:44 PM |
| Woah, how much could you actually store with this? |
|
|
| Report Abuse |
|
|
iSymon
|
  |
| Joined: 19 Nov 2011 |
| Total Posts: 1023 |
|
|
| 29 Oct 2015 06:48 PM |
You cannot save any data which data size is more than 64 kibibytes, which equals 2 ^ 16 string characters.
Along as your data don't exceed 64,000 something you should be able to save it. If you're wanting to know when you retrieve this data from an datastore it won't effect your request limits for all I know due to you encoding it. |
|
|
| Report Abuse |
|
|
|
| 29 Oct 2015 06:54 PM |
nice so you could store like EVERYTHING in one save
65536 characters? wow nice |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 30 Oct 2015 11:36 AM |
| Is 65536 the string limit? If I convert it to JSON, if the string number is under that limit it would save? Is that right? |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2015 11:43 AM |
if http:JSONEncode(list):len() < (2^16) then
i make u math.sqrt() |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 30 Oct 2015 11:57 AM |
If JSON converts a table to a string, then what is Datastore's string limit?
In an actual number, please? Is the 'Data' value listed on the Datastores wiki page apply for strings? If that's so, it shouldn't interfere with anything. Though I would use JSON. |
|
|
| Report Abuse |
|
|
Cuyler
|
  |
| Joined: 27 Feb 2006 |
| Total Posts: 3784 |
|
|
| 30 Oct 2015 11:59 AM |
| It's 65535 characters (2^16) |
|
|
| Report Abuse |
|
|
62GB
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 4157 |
|
|
| 30 Oct 2015 12:18 PM |
What is 2^16 even mean? I've never seen that symbol before. :P
Alright so, if I convert it to JSON and it's under the character limit, I'm good? Last question ;P |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2015 12:20 PM |
2 to the power of 16
2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2 * 2
By the way Im pretty sure you cant combine value types when saving tables, so you cant do something like this;
local savedTable = { val1 = 5, val2 = "yoyo" }
Instance.new("BodyVelocity",SenseiWarrior).velocity = CFrame.new(SenseiWarrior.Torso.Position,YourGirlsDMs.Position).lookVector * 10 |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2015 12:36 PM |
| it's only making it a string. it probably can |
|
|
| Report Abuse |
|
|
|
| 30 Oct 2015 02:12 PM |
ffs it's 2^16 characters
i dont understand how u cant understand this
i make u math.sqrt() |
|
|
| Report Abuse |
|
|