StaySpy
|
  |
| Joined: 04 Jan 2009 |
| Total Posts: 2311 |
|
|
| 20 Oct 2016 05:07 PM |
I'm writing a code that saves an instance with Data Store, and basically, the table that is to be saved looks like this:
table = { part(Name) = { -- every part name is 4-5 characters long part[1](Relevant Info) -- is a string, contains 12 characters {X, Y, Z}(Position) {X, Y, Z}(Rotation) {X, Y, Z}(Size) } }
So, we know that Data Stores can store up to 256 kibibytes(262144 bytes) per instance. My question here is, how many bytes would it take for one part and/or the table? I'm trying to figure out how many parts can be saved at once. |
|
|
| Report Abuse |
|
|
StaySpy
|
  |
| Joined: 04 Jan 2009 |
| Total Posts: 2311 |
|
|
| 20 Oct 2016 05:09 PM |
| Or if you can figure out a way to reduce the size for each part, that would be great. |
|
|
| Report Abuse |
|
|
Wowgnomes
|
  |
| Joined: 27 Sep 2009 |
| Total Posts: 26255 |
|
|
| 20 Oct 2016 05:15 PM |
use http service convert to json save json then convert back
|
|
|
| Report Abuse |
|
|
StaySpy
|
  |
| Joined: 04 Jan 2009 |
| Total Posts: 2311 |
|
|
| 20 Oct 2016 05:16 PM |
Whoa wait what
I didn't get any of that. More in-depth please? |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2016 05:18 PM |
| the maximum length of the JSON data is 2^18 characters |
|
|
| Report Abuse |
|
|
|
| 20 Oct 2016 05:19 PM |
| print(string.len( httpservice:JSONEncode(table) ) ) |
|
|
| Report Abuse |
|
|
StaySpy
|
  |
| Joined: 04 Jan 2009 |
| Total Posts: 2311 |
|
|
| 20 Oct 2016 05:20 PM |
| Yeah, that is 262144 characters/bytes. Figured that out, thanks tho |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 20 Oct 2016 05:30 PM |
| Store the CFrame, not the Position and Rotation. |
|
|
| Report Abuse |
|
|
StaySpy
|
  |
| Joined: 04 Jan 2009 |
| Total Posts: 2311 |
|
|
| 20 Oct 2016 05:39 PM |
Aggressive, thanks a lot. This helps.
^ Can you actually store CFrame values using Data Stores? Either way, I'll end up storing the 6 values(3vel, 3rot). |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 20 Oct 2016 05:42 PM |
CFrames consist of 12 values, 3 for position 9 for rotation.
http://wiki.roblox.com/index.php?title=CFrame#components |
|
|
| Report Abuse |
|
|
Crimsonal
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1795 |
|
|
| 20 Oct 2016 05:45 PM |
| https://www.roblox.com/library/517716505/SaveInstance-BETA-RELEASE |
|
|
| Report Abuse |
|
|