How to Use Various IDs

Strix uses various IDs. Some of them are for use in Strix applications, and some others are primarily used by Strix internally. This how-to explains major ones and shows some example usages.

IDs explained

The following list summarizes major IDs available in Strix Unreal SDK.

  • Application ID (type: String struct)

    • An application ID identifies an application (a game title). Usually, a Strix game client takes care of exactly one application ID.

    • Strix servers and clients use application ID to ensure that they are talking to appropriate peers.

      Note

      Application ID is like a password. Don’t expose your application ID to the public.

    • When using Strix Cloud, an application ID is automatically generated and presented on the Application Dashboard.

    • In Strix Unreal SDK, your game program supplies an application ID that matches your servers’ through Initialize Strix Network function.

  • UID (type: abstract class UID)

    • UID stands for unique identifier. It identifies various objects, and they are unique over network (within a cluster’s domain).

      Note

      UID does not stand for user id. Although each user (player) has their own UID associated with them, a UID may identify an object that is unrelated to a user.

    • In Strix Unreal SDK, UIDs are primarily used internally in Strix, and your Blueprint scripts will rarely handle them. However, if you use some lower layer functionalities through Strix C++ API, you may see UIDs more often.

  • Type ID (type: Integer)

    • A Type ID identifies a type of an Actor that a StrixReplicator is attached to.

    • A Type ID value is assigned to each of such Actors in Unreal Editor during development.

    • Type ID is primarily for internal use by Strix. It is available as Type Id property of StrixReplicator component.

    • See Type ID for details.

    • Type ID is also called object type.

  • Network Object ID (type: see below)

    • A network object ID identifies an instance of an Actor that a StrixReplicator component is attached to, equating replicas with their original.

    • All replicas of a same Actor, as well as the original Actor, share the same network object ID. On the other hand, if you instantiate a same Actor twice, the two replicas created on a client will have separate network object IDs, because they are replicas of two separate objects.

    • Network object ID is primarily for internal use by Strix, but you can use it as an identifier of Actors in your Blueprint scripts, especially when making RPC calls. (See Network Object Functions.)

    • Network object ID is primarily for internal use by Strix, and its native data type is 64-bit integer (Integer64). When a Network object ID is exposed to Blueprint scripts, however, it has a data type of Strix Network Id struct. The struct has one Blueprint-visible member StringId that holds a string representation of the ID. (You can use C++ to access to the raw int64 value if required.)

    • Network Object ID is also called Network instance ID or just Network ID.

    A single Actor instantiated twice and replicated
  • Primary Key (type: see below)

    • Primary key is an identifier with that a server identifies an object among those of same kind. Primary keys for objects of different kinds are unrelated. It is like a primary key of a database table in that the role of a primary key is common but what it identifies vary for different tables.

    • Strix Unreal SDK provides primary keys for the following important objects through members of name Id:

      • a node (a room server) as a Strix Node struct

      • a room as a Strix Room struct

      • a node room as a Strix Node Room struct

      • a room member as a Strix Room Member struct

      Primary keys are also available as properties of name primaryKey in conditions and orders when making a search.

    • Primary keys have a data type of 64-bit integer (Integer64) internally. However, when exposed to Blueprint scripts as Id member variable, its data type is Integer (a 32-bit integer).

    • Behind the scenes, Strix assigns primary keys for more objects, and you can access to them by C++ GetPrimaryKey member function available in some lower layer API. Some objects may even have SetPrimaryKey member function that sets a primary key, but they are strictly for Strix’s internal use, and you are not expected to use them even when using lower layer C++ API.

    • If you are to use a primary key, please be reminded that primary keys for unrelated objects of different kinds may coincidentally have a same value. You can compare two primary keys only if they are of same kind.

  • Room ID (type: see below)

    • A room ID identifies a room within a single room server. It is actually a primary key of the room object on the room server.

    • Room IDs of rooms on different room servers are unrelated, and they may coincidentally have a same value.

    • A room ID is a 64-bit integer (Integer64) internally, but Room Id member variable is Integer.

  • Channel ID (type: Integer)

    • A channel ID identifies a communication channel (a connection) to a room server.

    • Unlike other IDs listed here, the actual value for a channel ID is not determined by Strix; your script defines the channel ID value for each channel your game uses.

      For example, you can define like:

      • Channel ID 0 is for Actor replication and synchronization

      • Channel ID 1 is for temporary use during match making

      • Channel ID 2 is for the guild text chat that is always open

      Note

      It is recommended to use relatively small values for channel IDs, such as 0, 1, or 2, because it is slightly more efficient than a big value such as 2000000000, but they don’t need to be contiguous. You can use 0, 2, and 5 for a while, then stop using 2 and start using 4 and 10, (and never use other values like 1, 3, or 6-9,) for example.