Allow access to filesystem

Problem

As a Roblox developer, it is currently too hard to load or update large amounts of data into a game’s data store. If a large amount of data such as tabulated text data needs to be transferred into a datastore, currently the only way to accomplish this is to use external tools to convert the data into an LUA table, then performing a copy/paste operation into a script in Studio and then running it. By writing a script within studio to directly access the text file and read in line by line, this step can be averted which will allow large amounts of data to be loaded or updated and bypass the LUA file size limit of 200KB.

Use Cases

The following use cases are presented.

Use Case 1

One such common set of data to be loaded would be verses from religious texts. Since there are a number of games which depict a church/synagogue/mosque in which text is broadcasted to the players of the game, having an online database of the text for quick access would be advantageous since only one copy of the text is needed (in the data store) which is shared by all instances of the game. This will significantly reduce the memory footprint of each server instance since multiple tables to hold the data will not be required.

Use Case 2

Another use involves role playing game which has a large number of items. By loading the item database into the datastore for quick access which is shared by all places of the game, and all server instances, this would allow quick access to the data for a specific item according to the item number. This would be preferable, when also using an item cache to reduce calls to the data store, to just having each place have the entire item database. This would also save on server memory as well. Especially if the zones of the RPG are in separate places. Each place would require it’s own item list, which would be a significant burden on server memory as well as complicating updates to the item list if/when necessary.

Additional Information

Given the 200KB limit of LUA files within Roblox, for large amounts of data, multiple files will be required and can either exceed the table size limit or overflow the server memory. By having the ability to automatically load the data (which in both use cases above is largely read only) from a text file, data can be loaded in more efficiently and in a more automated fashion.

Due to security concerns, this would be available only in Studio and only for servers. It would not be available to the client at all, or on a live server.

Conclusion

If Roblox is able to address this issue, it would improve my development experience because it would automate the monotonous and tedious task of loading/updating static data that is available across the entire experience.

This is stupid cuz luau is samdboxed. Maybe Roblox can add a feature where you can drag and drop text files into studio and it will be converted into and instance. Rojo already does this btw

Does StudioService:PromptImportFile / StudioService:PromptImportFiles not cover what you need? It might be tedious since you’d have to re-import everytime you change the files, but it’s still read-only FS access which seems to be what you want.

(how would you read a file on a game server anyway?)

1 Like

Your use cases (writing to datastores from external) seem to better fit with Open Cloud, rather than trying to do this within Luau code running in the engine.

You can see the datastores Open Cloud API here: DataStore | Documentation - Roblox Creator Hub

You would create an API key with datastore permissions for your experience, and then write a small script in another language that sends web requests to the Open Cloud API with that API key. This would allow you to insert values in the datastore from a file. You would run this script from your local device (outside of Roblox environment).

If you need support, please post your questions in #help-and-feedback:cloud-apps

1 Like

That is very interesting. I was not aware of that service. But then again, I don’t write plugins. If you go back and reread what I wrote, it would only be accessible in studio. In other environments, I would write a program to load things into a database (usually using PHP since it’s simpler to connect to MySQL than using C++) from a text file. I actually have a program to do that for a web server where I can upload a text file of data and run that program on it to load it into the database. I can also run it locally on the server from the command line too. I was hoping for a similar solution within Roblox Studio.

@Hooksmith That would do it, but the reason why I wanted to run this from inside the Roblox environment was due to simplicity since everything is right there. I didn’t want to write a whole other program to launch network requests for web access because that would require the use of CURL or something similar.

1 Like