As a Roblox developer, it is currently too hard to work with DataStores. Not because they are complex, but because they are too limited. a few MB per player is NOT good for me, and the place has a DataStore limit.
We need a basic FIleSystem support.
- Player joins the game, game warns them that the game uses localized File System.
- If they go ahead, the game will create or use the existing folder that is relative to the GAME they are playing. For instance, if I am to call a function like
-- LocalScript
game.CreateFolder()
It will create a folder in the Roblox folder that corresponds to the game. The game can ONLY access its own folder. It will be named as the game ID.
- Functions could look like
game.CreateFolder()
local FileSystem = game:GetService("FileSystem")
FileSystem.mkdir("/Folder") -- / Represents the game folder.
local fref = FileSystem.open("/Folder/file.txt", "w") --[[
Create file and open if it doesn't exist.
Open file only if it does.
]]
fref.read() -- Get string data
fref.write("Hello world") -- Write "Hello world" to the file
fref.append(" -- Another hello world") -- File will now contain "Hello world -- Another hello world"
-
More security:
â Make sure this file system only works in the game foler.
â Only give users RW (Read Write) and no X (Execution).
â No permission to create .exe files -
Use cases:
â Save data locally. Much less limits. Much faster reading/writing data.
â Create drivers. If your game is a car game, you could create a small driver that people can download for their steering wheel written in something like C++ that writes data to that folder that our game can read and use.
â Output. A game may be detective based and it may output a file that the user can open and see what it is.
It would benefit me in the OS simulation I am developing. Having to save peopleâs data on my cloud servers feels like too much and too unsafe. Saving it on their own device, instead, makes it much better.