Overview of Reactor

Summary

This is an overview of common terms, services, and capabilities of the Reactor mulitplayer game system. This tutorial covers installation and basic usage of Reactor. It contains information on setting up, project structure, and the common keyboard commands.

What is Reactor

Reactor is a multiplayer system that allows developers to quickly program, publish and manage mulitplayer game servers. A developer starts by downloading the Reactor unity package and importing it into an existing or new Unity project. The package includes:

Requirements

Setup

Reactor is distributed as a tarball file which requires the Unity package manager. See https://docs.unity3d.com/Manual/upm-ui-tarball.html

Project Layout

Server scripts and common scripts (shared by the client and server) must be in a server or common folder. You can use the default common and server folders, or create your own common and server folders. To create a common or server folder, first create the folder. Then right-click in that folder in the project browser and select 'Create->Assembly Defintion Reference'. In the inspector for the assembly reference, set 'Assembly Defintion' to 'KSScripts-Common' for a common folder and 'KSScripts-Server' for a server folder. All scripts placed in this folder or any subfolders will be common or server scripts. If a subfolder contains another assembly definition or assembly reference for a different assembly, scripts in that folder will not be common or server scripts.

Note that server scripts and common scripts cannot contain any Unity references.

Terms

Server

A remote application that accepts client connections and runs game logic.

Client

A local application that connects to a server and renders game state for a user.

Room

A set of configurations and scripts associated with a scene that controls multiplayer game logic.

Entity

A mulitplayer object that syncs its state from the server to connected clients.

Player

An instance of a client connected to a server.

Scene

An environment containing entity data that forms the basis for a room.

Image

A collection of published rooms and scenes files containing server logic used by a server instance.

Instance

A game server running a room and scene using scripts loaded from a published image.

Cluster

A group of running instances that have the ability to message and share property state with each other.

Sever Runtime

An assembly compiled by Reactor during publishing that includes all scripts required to launch instances.

Server Room Script

A script component attached to a room whose behaviours are only run on the server.

Server Entity Script

A script component attached to entities whose behaviours are only run on the server.

Server Player Script

A script component attached to players whose behaviours are only run on the server.

Client Room Script

A script component attached to a room whose behaviours are only run on clients.

Client Entity Script

A script component attached to entities whose behaviours are only run on clients.

Player Controller

A script that interprets user inputs to control an entity.

Remote Procedure Call (RPC)

A function that can be invoked on a remote server or client.

Property (Entity / Room / Player)

A piece of data that is associated with an entity, room, or player and is synced from servers to clients.

Transform (Entity)

A collection of data that represents an entity's position, orientation and scale in the game and is synced from servers to clients.

Unity UI

Settings

Reactor settings can be accessed from the 'Menu Bar->Reactor->Settings' menu and can be changed in the inspector. The 'Server' section defines the build rules for the server runtime.

The 'Build' section contains configuration data for the published image which the Reactor client code uses to find and connect to instances of the same image.

The 'Debug' section contains debug settings for Reactor entities

Collision Groups allows you to assign names to the collision groups used by collision filter scripts.

Building

This tutorial requires you to publish or build your project after making changes to server scripts or configurations. You can also find these under the 'Menu Bar->Reactor' menu. The shortcut keys are provided.