Datastore error: "Too many requests"

We don’t really know the use case why there’s a need to load all the maps, but I suppose it’s just a world where players probably do have their own personal space where they can build, so the use case could be just filling the world with these maps.
Loading these maps periodically could really help the datastore limits since every second a credit is added back to the budget. So a coroutine could help with that.

If the use case is for example an FPS game with different maps, then there’s no use in loading all the maps or even caching them, but load them just in time.

Basically, people can create their own maps and publish them, change the name, change imageID.
And well if the list doesnt entirely load people can’t play custom made maps, nor could creators edit them as their map key couldn’t load in.

So what ur saying is that I should save people’s maps on their player data, and create a orderedDataStore to get each player’s map data? (All maps have a specific map number ID, and in OrderedDataStores u can save numbers, so should work to get the data somehow?)

It’s pretty complicated but I’m sure it has to work somehow, as other games have it too, where people can like, load other people’s creations. The building update already released before I knew of this bug, so I should be fixing it as soon as possible, otherwise people can’t play/edit maps.

Also if that OrderedDataStore idea works, how can I possible go above 100? As there are more maps than 100 for sure.

And if none of this actually works I might aswell just have to create a single key where all the maps get saved on.

Well, create a single key where you’re gonna store a list of map ids and names, or the necessary data needed to be displayed before loading such map. Eventually if you somehow go over the 4M limit, you can make multiple similar keys and chain load them.
But OrderedDataStore could work good, I suppose you’re gonna have a list of maps in the game, so if the player scrolls over 100 keys, you can load the next 100 keys. I expect this input to take at minimum one minute for the player to scroll down, and minute is enough time to reset the datastore budget.

1 Like

How would I load the next 100?

Also for if your wondering, this is the string that saves, the more objects, how longer the string becomes

Block,Shapes,0.984314, 0.992157, 0.980392,Enum.Material.Plastic,223.94873046875,259.4474792480469,-478.5215759277344,0,0,0,4,20.20000457763672,0.6999999284744263|Door,Furniture,205.61904907226562,252.8476104736328,-488.6012268066406,0,-7.156000137329102,0|Endpart,Important,0.337255, 0.258824, 0.211765,Enum.Material.Plastic,219.29766845703125,255.19752502441406,-478.38641357421875,0,180,0,5.929605484008789,11.900009155273438,0.498809814453125|Block,Shapes,0.639216, 0.635294, 0.647059,Enum.Material.Plastic,229.0191192626953,252.8476104736328,-476.3744201660156,0,0,0,4,1,2|```

That’s good question, didn’t do much of a research on this, so I made a mistake. GetSortedAsync has some pagination parameters, something could be made from this, but don’t know how trustworthy it could be.

1 Like

This should be optimized as well. Do not insert all the names of things, but rather try to make an enumerator which will be later translated into a number.
Block = 0, Sphere = 1
Enum.Material.Plastic = 256 as defined here
Your numbers lower than 1 could trim out the 0 in it so 0.984314 = .984314
This will save lot of space

1 Like

Ohh, that’s something I could do yea

I’d have to use If statements then, because now I’m using FindFirstChild(“”…example…“”) to get the Category

But yea I’ll see what works I guess

Everything works now btw! Managed to do it with just one datastore key. And I can always add more keys if needed

1 Like

Yeah. You may want to implement “Sharding” in the future.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.