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

Text

A single line of text.

“Hello, world!”

LocalizedText

A single line of localized text.

{“en-US”: “Hello”, “fr-FR”: “Bonjour”}

Logical

A true/false value.

True

Time

A time span.

“1.00:00:00”

Date

A specific date.

“2017-12-27T00:00:00.000Z”

Number

A decimal number.

3.14

Integer

A whole number.

42

PickList

A list of pre-defined values.

“Red”

MultiPickList

A list of pre-defined values that can have multiple selections.

“Apple, Banana, Cherry”

Document

An embedded document.

{ “Id”: “Sword”, “Name”: “Rusty Sword” }

DocumentCollection

A collection of embedded documents.

[{ “Id”: “Sword”, “Name”: “Rusty Sword” }]

Reference

A reference to another document.

{ “Id”: “Sword”}

ReferenceCollection

A collection of references to other documents.

[{ “Id”: “Sword” }]

Formula

A C# expression used to calculate something

“target.HP < 100”