of     1   

ImFarley
#183415660Friday, February 12, 2016 4:03 AM GMT

I've been working on storing and loading "furniture" for a game I'm doing. Currently, the system offers customization for item, rotation, position, and color. What I've found is that I am VERY quickly exceeding the request limit, and thus stuff is breaking. So, I was wondering if you guys could share what you've found to be the best way of doing this? Specifically, please. I'm no beginner to data stores considering the many hours I've struggled doing them over the years, so something like "Use a table" isn't helpful, since 1. I already am, and 2. That method doesn't work since I still have to reference the data store every time I call a member of the table (I have to several times) I've considered copying the data store table over to a different table when it's loaded, but when a player's home is populated fully, this won't work, since there could be anywhere upwards of 30 items in there, each having 5-8 members of their own tables. Thanks in advance. I really hate data stores since they bug so much, so any help is appreciated. Much love -GO
f00fc7c8_fox
#183416057Friday, February 12, 2016 4:10 AM GMT

by request limit, are you talking about calling the datastore api too much?
ImFarley
#183416142Friday, February 12, 2016 4:12 AM GMT

Yes. I initialize a table "data" to ds:getasync(asynckey) and then I just call data[whatever] every time I am loading a new "property" of the model such as rot, pos, etc. The problem is that the obviously still calls getasync every time, and as stated, if I were to try and copy it to a new table, it would just overflow the request limit during the copying. Much love -GO
Zawie
#183416284Friday, February 12, 2016 4:15 AM GMT

convert tables to strings so you can basically save the entire house in one table
ImFarley
#183416345Friday, February 12, 2016 4:16 AM GMT

The entire house is saved in one table. That table then holds many other tables for each piece of furniture. That doesn't change the fact that any time I called any member of the table, string or not, it would have to request to the datastore. Much love -GO
Zawie
#183416639Friday, February 12, 2016 4:21 AM GMT

turn entire house table into string save string into datastore load string decode the string store that decoded string in a varible one call to save and load
ImFarley
#183416718Friday, February 12, 2016 4:23 AM GMT

"turn entire house table into string" "decode the string" This is beyond me. Can you elaborate on how? Much love -GO
Zawie
#183416813Friday, February 12, 2016 4:25 AM GMT

hmmm I think i created a module a while ago basically you iterate through the table and concat it to a string there are some free encoding modules
f00fc7c8_fox
#183416863Friday, February 12, 2016 4:27 AM GMT

try to pack the properties into one string/binary token to greatly lower the requests
Zawie
#183416919Friday, February 12, 2016 4:28 AM GMT

^^^
ImFarley
#183416951Friday, February 12, 2016 4:29 AM GMT

What's the max amount of characters in a string that can be stored? Much love -GO
Hedr0n
#183417001Friday, February 12, 2016 4:30 AM GMT

String limit caps at like 62k
Hedr0n
#183417033Friday, February 12, 2016 4:31 AM GMT

This repo has a lot of good stuff for what you're doing. https://github.com/Checkplate/AtomEngine
128Gigabytes
#183417037Friday, February 12, 2016 4:31 AM GMT

'The problem is that the obviously still calls getasync every time, and as stated, if I were to try and copy it to a new table, it would just overflow the request limit during the copying.' It doesn't, it only sends one request when you do local data = getAsync(blah) And then data becomes a copy of whatever you got Then you just save over the old table with 'data' whenever you need to save.
ImFarley
#183417174Friday, February 12, 2016 4:34 AM GMT

@128 There's no logical reason for me to be getting request overflow if that's true. Much love -GO
128Gigabytes
#183417416Friday, February 12, 2016 4:40 AM GMT

Well it is true so something else is wrong.
128Gigabytes
#183417540Friday, February 12, 2016 4:43 AM GMT

It wouldn't make any logical sense for it to work like you describe. Imagine when you save a number to the dataStore, and load it local x = getAsync("key") x is now a variable to what in this example is a number Its not a special number linked to the data store, its just a number. Same thing with string Same thing with tables (Tables are actually saved as a string and then loaded back into a table before being returned by a request for the data.) The values aren't linked to the datastore in any way.
ImFarley
#183417602Friday, February 12, 2016 4:45 AM GMT

Well, I concede. Just tried the game again after taking about an hour to cool down, and it worked flawlessly the first time without me changing anything. I don't even know anymore. Anyways, thanks guys. All around educational stuff. Much love -GO
Thane_1
#183420219Friday, February 12, 2016 6:05 AM GMT

Actually, they increased the byte limit. It's now 4 times larger. ~ Who's awesome, you're awesome ~

    of     1