Data Types
A list of data types you might find mentioned in various places and what they mean.
These types are associated with C# or VRage in particular, while some apply to other programming fields they should not be assumed the same when using a different programming language or engine.
Formats
HSVOffset or KeenHSV
HSVOffset is a color format that is slightly different than the commonly known HSV.
Has hue from 0.0 to 1.0 then saturation and value from -1.0 to 1.0.
Additionally, after converting from regular HSV (which usually has larger scale numbers) to HSVOffset, you'll also need to offset some numbers[1].
HSV to HSVOffset: Saturation minus 0.8 and Value minus 0.45. Converting the other way would be to add the numbers.
Numbers
Float or Single
A number that allows decimal point. It's 32bit and sometimes called single because of its single precision as opposed to double precision of the 64bit float called double.
Valid range between -3.4028235E+38 and 3.4028235E+38. This format of scientific notation can be used in SBC files too.
Double
A number that allows decimal point. It's 64bit and called double because of its double precision compared to the 32bit float/single.
Valid range between -1.7976931348623157E+308 and 1.7976931348623157E+308, and yes that is 308 zeroes. This format of scientific notation can be used in SBC files too.
Both of the above numbers are floating-point which means they can go way higher than what their bit depth can normally support but at a loss of precision.
Int16 or short
A full number of 16 bits, with perfect precision between the valid values. Going past the valid numbers will usually create an error, or in rare cases where the programmer chose to, it can wrap around.
Valid range between -32768 and 32767
UInt16 or unsigned short
This is identical to the 16bit integer except the range of values starts from 0 and ends at double the max, specifically from 0 to 65535.
Int32 or int
The most common number type used, a full number of 32 bits, with perfect precision between the valid values. Going past the valid numbers will usually create an error, or in rare cases where the programmer chose to, it can wrap around.
Valid range between -2147483648 and 2147483647.
UInt32 or unsigned integer
This is identical to the 32bit integer except the range of values starts from 0 and ends at double the max, specifically from 0 to 4294967295.
Int64 or long
A full number of 64 bits, with perfect precision between the valid values. Going past the valid numbers will usually create an error, or in rare cases where the programmer chose to, it can wrap around.
Valid range between -9223372036854775808 and 9223372036854775807
UInt64 or unsigned long
This is identical to the 64 bit integer except the range of values starts from 0 and ends at double the max, specifically from 0 to 18446744073709551615.
Byte
An unsigned number of 8 bits.
Valid range between 0 and 255
SByte
The signed version of byte that changes the range to -128 to 127.
MyFixedPoint
Keen's struct for fixed point number represented as a 64-bit integer with 6 decimal places (one millionths).
Valid range between -9223372036854.775808 and 9223372036854.775807
Other structs
bool or Boolean
A value that can be either true or false.
Fun fact: this occupies 1 byte (8bits) in memory instead of 1 bit in C# because it is faster to address it as such.
enums in general
These are effectively named integers and the object name and values can be anything.
Some might even have values going by power of 2 which results in each value being a single bit, allowing the enum to be flags where each value can be a toggle.
It's basically impossible to tell from just looking at the name if it's an enum or a custom object, or even if it's values are meant to have flags (unless it contains Enum or Flags). That's where the SBC documentation comes in to show how to use it.
Some examples of enums in VRage: MyCubeSize, MyBlockTopology, MyAutorotateMode, MySymmetryAxisEnum.
Vectors
Contain more than one number. Useful for storing coordinates (x,y,z).
The Serializable prefix simply means it supports being written to file in various formats, be it XML or binary. However it being a different struct in the code means it can have a different format when entered in SBC/XML, so do not use them interchangeably.
The gist of the vector names is the number defines how many numbers it contains and the suffix defines the data type.
Vector3I and SerializableVector3I
A vector made of 3 numbers, each a 32bit integer.
Vector3 and SerializableVector3
A vector made of 3 numbers, each a 32bit float.
Vector3D and SerializableVector3D
A vector made of 3 numbers, each a 64bit float.
Vector2 and SerializableVector2
A vector made of 2 numbers, each a 32bit float.
Objects
String
Just text.
The max characters enforced by the language is 2147483647 characters (or possibly 2GB), however some things might have special length limits, which will be mentioned where applicable.
Because it's an object it can also be null, in SBC/XML that would be defined as <TheElementName xsi:nil="true" />.
SerializableDefinitionId or MyDefinitionId or MyItemType
These are all representing the same thing: a TypeId + SubtypeId pair.
All definitions in this game have a definition id which defines the object type (which generally has to be one of the types declared in the game, mods usually can't invent new ones) and a subtype that can be any made up unique name (and only needs to be unique per-type, it not globally unique).
The different object does impact the format it can use in SBC/XML, so do not stray from the given example formats wherever you see these mentioned.
The Nullable<T> wrapper
The T here is stand-in for any type name.
This allows the wrapped type to default or be set to null.
For example while a bool only has true or false, a Nullable<bool> has 3 values it can be, null, true and false.
In SBC/XML one can intentionally set an element as null by using <TheElementName xsi:nil="true" />, but it will give errors if the type does not support null.
The T[] suffix or List<T> wrapper
The T here is a stand-in for any type name.
These are arrays and lists, meaning the type given can be entered multiple times.
For interacting with them in SBC/XML they function the same.
Dictionary<K,V> wrapper
The K and V here represent type names: the key type and the value type respectively.
Similar to a list, except each entry has a key and a value. The benefit of a dictionary is fast lookup by key, but in an SBC context it's not very useful or practical.
- ↑ Source
MyColorPickerConstants.HSVOffsetToHSV()andHSVToHSVOffset()