All Data Types
Selecting the proper data type is important in order to ensure that data is correctly and efficiently stored and used in the game. Each data type has its own specific purpose and characteristics, which should be considered when choosing the appropriate type for a given property.
For example, if a property needs to store a text value, the Text data type would be appropriate. If the text needs to be translated into multiple languages, the LocalizedText data type would be the best choice.
Similarly, if a property needs to store a numeric value, the Number or Integer data types would be appropriate depending on the type of number being stored.
The PickList and MultiPickList data types are useful for properties that have a limited set of values, such as a list of game items or character classes.
The Document and DocumentCollection data types are useful for storing complex data that may contain multiple fields or properties.
Ultimately, selecting the proper data type ensures that game data is properly structured, and helps to prevent errors and inconsistencies in the game.
Table with example
Data Type |
Description |
Example |
A single line of text. |
“Hello, world!” |
|
A single line of localized text. |
{“en-US”: “Hello”, “fr-FR”: “Bonjour”} |
|
A true/false value. |
True |
|
A time span. |
“1.00:00:00” |
|
A specific date. |
“2017-12-27T00:00:00.000Z” |
|
A decimal number. |
3.14 |
|
A whole number. |
42 |
|
A list of pre-defined values. |
“Red” |
|
A list of pre-defined values that can have multiple selections. |
“Apple, Banana, Cherry” |
|
An embedded document. |
{ “Id”: “Sword”, “Name”: “Rusty Sword” } |
|
A collection of embedded documents. |
[{ “Id”: “Sword”, “Name”: “Rusty Sword” }] |
|
A reference to another document. |
{ “Id”: “Sword”} |
|
A collection of references to other documents. |
[{ “Id”: “Sword” }] |
|
A C# expression used to calculate something |
“target.HP < 100” |