I am creating a game where players can make vehicles. I would like to enable players to access each others creations like steam users can using the Steam Workshop. For instance, in games like Besiege and Stormworks, users can share and access their creations via the Steam Workshop.
I do not know how I can store and read data that is game-related and not necessarily user-related. Is this even possible?
One possible solution that I thought of is to run a server that keeps track of all the data in a database and accessing it using the HttpService. However this would cost money and might have a very limited capacity.
This is perfectly possible using Roblox DataStores, you just need to be very efficient about it.
When users save their builds, you need to serialise all their parts into a specific format (eg a table/JSON) which you can then save into a data store. Make sure to all the necessary properties, such as part colour, relative position, size etc.
Once you have done this, you can just save it into a data store:
local DataStoreService = game:GetService('DataStoreService')
local Workshop = DataStoreService:GetDataStore('Workshop')
function SerializeModel(Model)
end
local Data = SerializeModel(MySampleVehicle)
Workshop:SetAsync('Vehicle_1', Data)
When you need to load back in the model, just read through the data you saved and remake the model using all the properties
The main thing I would worry about is how much space each model would take (Iām not exactly sure about this - it might just be fine as a simple table).
1 Like
I am not familiar with the DataStoreService. I checked your solution on the Developer site and this seems like the way to go. Thanks!