Rooms Overview

In order for any two clients to communicate in Strix, they must join the same room.

Rooms

A room is a group of players playing a game together in a specific environment. This definition is flexible as rooms can be one map with two teams of players fighting over it, a section of a wider world in which players can interact, or a chat room allowing communication with players not currently in-game or outside a reasonable range to synchronize their actions.

A room is created on a room server and is joinable after connecting to the room server (or after connecting to the master server through a NodeRoom function; see below). Details on room operation are covered later in this documentation.

A room is represented in the Strix Unreal SDK by the Strix Room struct, which is a container for its properties.

A Strix Room struct, as a model of room properties, are not used for the synchronization of objects in the room. Rather, they represent the identifying characteristics of a room, such as the name, number of players, map name etc. that the server should keep track of.

Room Properties

Rooms contain several properties. They include properties set by the server, properties editable by the client, and properties that you may use for customization purposes. You can also define your own set of custom properties on-the-fly.

Name

Type

Description

Variable Name

Edit

Search

primaryKey

Integer

The primary key (a unique ID)

Id

No

*

capacity

Integer

The number of players allowed in the room

Capacity

Yes

Yes

memberCount

Integer

The current number of players

Member Count

No

Yes

isJoinable

Boolean

If the room is joinable

Is Joinable

Yes

Yes

state

Integer

Customizable

State

Yes

Yes

name

String

The name of the room

Name

Yes

Yes

password

String

The password for the room

Password

Yes

Yes

key1

Float

Customizable

Key 1

Yes

Yes

key2

Float

Customizable

Key 2

Yes

Yes

key3

Float

Customizable

Key 3

Yes

Yes

key4

Float

Customizable

Key 4

Yes

Yes

key5

Float

Customizable

Key 5

Yes

Yes

key6

Float

Customizable

Key 6

Yes

Yes

key7

Float

Customizable

Key 7

Yes

Yes

key8

Float

Customizable

Key 8

Yes

Yes

stringKey

String

Customizable

String Key

Yes

Yes

properties

Strix Property Map struct

Set of User defined custom properties

Properties

Yes

No

  • Name: The logical name of the room property as managed on the server. This is used in a property map when creating a room or in search constructs, for example.

  • Type: The data type of the room property as exposed to Blueprint scripts.

  • Variable name: The name of the corresponding member variable in Strix Room struct as exposed to Blueprint scripts.

  • Edit: Whether you can edit the property value by calling SetRoom function or can specify the value when creating a new room. If you try to edit a non-editable property, the operation may create a custom property of that name in properties rather than reporting an error.

  • Search: Whether you can use the room property in a condition construct or an ordering specification when searching for rooms.

Note

In Strix Unreal SDK, you sometimes need to specify a room property by its name as a string. To prevent hard-to-find bugs, please remember that property names are case sensitive. Also please remember that the names (listed on the Name column) are different from the display names (listed on the Variable Name column) that are shown on Blueprint scripts for member variables in a Strix Room (or Strix Node Room) struct.

For example, if you specify “Capacity” in a Strix Property Map when creating a new room, it will not set a value of the capacity property (to define the number of allowed players) but will set a custom property to be stored in properties, because “Capacity” and “capacity” are considered two different property names by a case-sensitive comparison.

Another note is that each room property in Strix has an associated data type. Strix APIs that receive a name of a property as a string accept any data type for its value, but values of two different data types are considered different in general. That is, a String value “1” is always considered different from an Integer value 1, and an Integer value 1 is usually (though not always) considered different from a Float value 1.0.

For example, if you use SetRoom function to try to set an Integer value for a String property name or a String value “1.0” for a Float property key1, your request will fail on the server.

At the same time, to reduce the chance of breaking your game scripts, Strix tries to accept values of different data types where possible, and the SetRoom function does allow setting an Integer value for a Float property. For example, if you set an Integer value 1 to a Float property key2, key2 property will have a Float value 1.0.

Please don’t rely on Strix’s generosity on data type handling, however, and always try to specify the exact data type in your Blueprint scripts.

See the Rooms in the Game Loop for information on how to get, use and set these properties.

Node Rooms

Strix allows multiple room servers for scaling out. For a game client to access to a room, it needs to know which room server a particular room is on. It is sometimes cumbersome to keep track of the room server in association with a room.

On the other hand, Strix’s master server maintains an up-to-date list of all rooms on all connected room servers. This makes it easier to operate on these rooms, as clients may skip the step of finding and connecting to a room server.

The model of rooms stored on the master server is known as NodeRoom, that is represented by the Strix Node Room struct and has a couple of additional properties to those of a Strix Room struct:

Name

Type

Description

Variable Name

Edit

Search

primaryKey

Integer

The primary key (unique ID) of this room and node combination

Id

No

*

roomId

Integer

The primary key (unique ID) of the room

Room Id

No

*

isPasswordProtected

Boolean

True if the room has a password

Is Password Protected

No

Yes

You can think that a NodeRoom is a combination of a Room metadata plus its room server identification. Most of the functions that operate on a room come with two flavors; a Room version and a NodeRoom version that you can choose one from.

Note

Room passwords are not stored on the master server for security reasons, so NodeRoom has no password property. Instead, it has isPasswordProtected property to indicate whether the room has a password.

Note

primaryKey property of a room, and primaryKey and roomId properties of NodeRoom are of Integer64 data type on the servers. Strix supports searches by them. To do so, you need to specify Integer64 values but Integer values in search conditions, but Strix Unreal SDK has no Blueprint functions to handle Integer64 values. You need to use C++ to specify such conditions.