How To Efficiently Use Data Persistence: Difference between revisions

From Legacy Roblox Wiki
Jump to navigationJump to search
>Blocco
Why isn't the code example working?
Added category
 
(14 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{NonStandard|reason=Data persistence was added in 2011 and requires the launcher or revival to support it.}}
== Introduction ==
== Introduction ==
If you're a regular Roblox user, wondering how you can save precious space while saving your data, this is for you!  This page will talk about how data is stored and how to cut down on the amount of space being used, allowing you to save more data.
If you're a regular Roblox user, wondering how you can save precious space while saving your data, this is for you!  This page will talk about how data is stored and how to cut down on the amount of space being used, allowing you to save more data.
__TOC__
== So Just How Is This Data Stored? ==
== So Just How Is This Data Stored? ==
Roblox Data Persistence data is stored as XML, with Key, Value and Table tags.  Each "key" links to a "value," which holds your data.  The bulk of this XML would be this:
Roblox [[Data Persistence]] data is stored as <abbr title="Extensible Markup Language">XML</abbr>, with Key, Value and Table tags.  Each "key" links to a "value," which holds your data.  The bulk of this <abbr title="Extensible Markup Language">XML</abbr> would be this:
{{CodeExample|
<!--  I forgot what the XML was like, exactly.  Can a dev fill me in?  I didn't get the details right, I can tell. -->
<pre>
<Table>
<Table>
<Key>
<Entry>
x
<Key>String1</Key>
</Key>
<Value type="string">Rawr</Value>
<Value key{{=}}"x" type{{=}}"String">
</Entry>
y
<Entry>
</Value>
<Key>MyInt</Key>
<Value type="number">251</Value>
</Entry>
</Table>
</Table>
}}
</pre>
As you can see, this already takes up a lot of space.  Using Roblox Objects (which are already stored in an XML format) would use up even more characters.
As you can see, this already takes up a lot of space.  Using Roblox Objects (which are already stored in an <abbr title="Extensible Markup Language">XML</abbr> format) would use up even more characters.
== How To Regulate Character Amount ==
== How To Regulate Character Amount ==
Coming soon!
Roblox objects take up much of your 45000 byte limit, so to cut down on the amount of space being stored, it is wise to use strings more often than using Roblox objects.  For example, it takes less space to use a string than to use a string value.  Remember that you have the ability to save strings, numbers and booleans if need be.
<!-- about using strings and then parsing them in-game to reduce character space in the document -->
[[Category:Scripting Tutorials]]

Latest revision as of 03:00, 17 May 2024

Ouch!
The following article, How To Efficiently Use Data Persistence, mentions a feature exclusive to certain versions of the client.
Specifically: Data persistence was added in 2011 and requires the launcher or revival to support it.


Introduction

If you're a regular Roblox user, wondering how you can save precious space while saving your data, this is for you! This page will talk about how data is stored and how to cut down on the amount of space being used, allowing you to save more data.

So Just How Is This Data Stored?

Roblox Data Persistence data is stored as XML, with Key, Value and Table tags. Each "key" links to a "value," which holds your data. The bulk of this XML would be this:

<Table>
	<Entry>
		<Key>String1</Key>
		<Value type="string">Rawr</Value>
	</Entry>
	<Entry>
		<Key>MyInt</Key>
		<Value type="number">251</Value>
	</Entry>
</Table>

As you can see, this already takes up a lot of space. Using Roblox Objects (which are already stored in an XML format) would use up even more characters.

How To Regulate Character Amount

Roblox objects take up much of your 45000 byte limit, so to cut down on the amount of space being stored, it is wise to use strings more often than using Roblox objects. For example, it takes less space to use a string than to use a string value. Remember that you have the ability to save strings, numbers and booleans if need be.