SerialBit V2 - Save player-made creations with ease

This is the BETTER and more EFFICIENT version of SerialBit V1 which is below:

V2 compared to V1

image
SerialBit V2 is 2.3x faster AND 2.3x more efficient in size!
Model used for this benchmark was this treehouse

Ever wanted to save a player build? Worrying about performance or storage use? SerialBit has you covered!


(You can play this demo here)

There are 2 main functions in this module, both of which are extremely easy to use (your grandma could probably use it!)

SerialBit.serialize(Instance: Instance, Options: Options): string

Serializes an instance and returns a string.

Example usage:

local SerializedString = SerialBit.serialize(workspace.Treehouse, {
   CompressionLevel = 9 -- 0 is no compression, defaults 9 (max compression, lower if you want less lag spikes when saving large models)
   Encode = true -- defaults true (reccomended if you want to store it)
})

SerialBit.reconstruct(SerializedString: string): {Instance}

Reconstruct instance(s) from serialization string. Returns an array of root objects (objects that were unable to be parented so must be a root object)

Example usage:

local Objects = SerialBit.reconstruct(SerializedString)
for _, Object in Objects do -- reconstruct returning an array may change in the future
   Object.Parent = workspace
end

Here’s a large map to benchmark:


Results:
image

V1 doing this test

17 seconds seems a bit much, but that’s 11K instances! Not to mention, it takes 1 second to load back in!

If you have suggestions, constructive criticism, or any questions, feel free to DM me or send a post!

You can get the asset here:

h̶t̶t̶p̶s̶:̶/̶/̶c̶r̶e̶a̶t̶e̶.̶r̶o̶b̶l̶o̶x̶.̶c̶o̶m̶/̶s̶t̶o̶r̶e̶/̶a̶s̶s̶e̶t̶/̶1̶7̶7̶8̶3̶0̶0̶2̶2̶5̶8̶
Roblox decided to take down my model and deny appeals. So, here’s the rbxm instead.
SerialBit2.rbxm (212.3 KB)

29 Likes

Looks awesome! But where can we download it?

2 Likes

Ah, sorry, that was such a stupid mistake, I forgot to add it :sob:

I’ve updated the post with the link at the bottom, you can get it there.

HOWEVER, right now, it has been taken down by roblox. I’m appealing it right now so you’ll have to wait 5 minutes. Roblox is really destroying their devs with this new moderation, I can barely upload anything.

So yeah, I forgot to add the link to the post, and now I’m checking it and I’ve noticed that Roblox has taken it down. (classic roblox moment)

(check post below)

3 Likes

And… yeah, what the **** roblox.

Seems like we’re gonna be using downloads! Fun times. Thank you Roblox for screwing me over! And not for the first time!

Ill be updating the post with an rbxm.

2 Likes

Yes, the last few months the chat filter was super good, and now it’s filtering everything wrong again. Also the AI of roblox has become sh*t and no chat is translated anymore.

1 Like

V2.0.1 Optimization Patch

Redid the way instance properties are handled when serialization, and implemented better caching in the API dump, leading to a whopping 3.4x serialization speed boost on a 10k object model.

You can find the latest version on the post.

1 Like

when I try to serialize a folder with parts: ServerScriptService.SerialBit:113: attempt to index null with 'Compress' (in the previous version it was working)

Sorry, this should be fixed now.

1 Like

how would you suggest i save meshparts? i know roblox made meshid readonly in meshparts for whatever reason, but a lot of my game uses meshes and i want to be able to load that.

Roblox recently added CreateMeshPartAsync, however, it was added after SB V2 was made and I don’t really touch this anymore