Category:Type: Difference between revisions

Category page
started with the plan to just fix the description of what types actually are, hopefully kept it understandable for non-scientists, definitely failed to avoid spending hours in researching the Resonite data model
added basic information about sub-typing
Line 20: Line 20:
| [[:Category:Type:Value|Value Type]] || [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types Value Type] || The value is stored directly within the variable/property.
| [[:Category:Type:Value|Value Type]] || [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types Value Type] || The value is stored directly within the variable/property.
|+
|+
| Object Type || [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types Reference Type] || The value exists somewhere in memory. Variables/properties contain a reference to the memory location.
| Object Type || [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/reference-types Reference Type] || The value exists somewhere in memory. Variables/properties contain a reference to the memory location. <br/> Object types also form a hierarchy where an instance of a ''sub-type'' will always be an instance of a ''super-type''. This allows a general concept (i.e. [[Type:ICollider|a collider]]) to be implemented in different ways. ([[Component:BoxCollider|BoxCollider]], [[Component:SphereCollider|SphereCollider]] etc.)
|}
|}



Revision as of 23:46, 13 April 2024

A type describes a range of possible values. This includes numbers or other primitive types, but also more abstract concepts ranging from text, users, join requests up to just “parts of a world”.

Categorization

Types can be split into different categories. In many situations there is some kind of distinction between “simple” and “complex” types.

The specifics are dependent on the context you are talking about.

ProtoFlux

Execution of ProtoFlux is a local phenomenon that runs on the computer that started it. In fact the ProtoFlux implementation has been designed to be independent of FrooxEngine.[Citation needed]


In summary it stays close to the underlying C# standards. C# differentiates types based on where the value is stored:

Category (ProtoFlux) Category (C#) Description
Value Type Value Type The value is stored directly within the variable/property.
Object Type Reference Type The value exists somewhere in memory. Variables/properties contain a reference to the memory location.
Object types also form a hierarchy where an instance of a sub-type will always be an instance of a super-type. This allows a general concept (i.e. a collider) to be implemented in different ways. (BoxCollider, SphereCollider etc.)

Also see: Enums, a subcategory of value types.

World Model

The world model of Resonite needs to be kept consistent for multiple users. Where a value is stored locally is far less important than how it is communicated across the network.

In effect this means that when dealing with components and their properties one has to differentiate among the following categories:

Category All Types Description
Values Value Types, strings, URIs, Nullable and IEncodable The value will be written into and read from a network message as-is.
References IWorldElement and all its derivatives (e.g. Slot) The referenced object can be uniquely identified by a RefID which will be sent via the network. The receiver will then do a lookup to determine their own instance of that object.
Types Type Types aren't just used in properties. They are also very important internally to inform other users of newly created components. Therefore they are preferrably encoded as a simple number to avoid wasting network traffic. If such a shorthand is not yet available the full type name will be transmitted instead.
As of 2024.4.3.1170 the shorthand is lazily and asynchronously generated by the host. There is one lookup-table per Session.
(Speculation: The requirement of session information may be the reason why this has a separate implementation to values.)
Delegates WorldDelegate Delegates reference a method of a specific object instance. The network message contains the RefID to identify the instance and the name/declaring type of the method.
Be aware that strings, URIs and Nullable are objects in ProtoFlux but values for the world model!

This is especially visible when working with Dynamic Variables.

Subcategories

This category has the following 2 subcategories, out of 2 total.

E

V

Pages in category "Type"

The following 200 pages are in this category, out of 211 total.

(previous page) (next page)
(previous page) (next page)