GS2-Realtime API Reference

Real-time communication feature

Enables competitive and cooperative play functionality.

When you create a room, three pieces of information, IP address port encryption key will be issued. To join a room, connect to the issued IP address port via WebSocket. The communication is done using the issued encryption key.

While GS2 services are generally charged per API request, this service is charged based on the game server’s uptime and the volume of communication. The number of messages exchanged does not incur a charge.

Room Lifecycle

Created

GS2-Realtime starts the server after receiving a room creation request. If the number of available rooms falls below a certain threshold, GS2-Realtime starts additional rooms in bulk to serve as hot standby rooms.

This means that there is a difference in the time between a cold start', when the server is started after receiving a request, and a warm start’, when a room on hot standby is used.

The estimated waiting time for a cold start is 40 to 60 seconds. Estimated waiting time for a warm start is 1 to 3 seconds.

Exit

The activated room will be terminated if no one comes to connect for 5 minutes after it is created. This termination process also applies to rooms on hot standby, but the hot standby startup time is not added to the usage fee.

A room will be automatically terminated after one minute of no communication from all players participating in the room.

The maximum startup time for a room is 3 hours. Rooms are automatically terminated after 3 hours of creation.

Cold Start Occurrence Conditions

  • A start request is issued faster than a hot standby server can be prepared
  • The game server is upgraded to a new version
  • No hot standby is prepared because start requests are infrequent

Use in your game

Game Engine

Specifications of models and API references for GS2-Realtime SDK for Game Engine

SDK

Specification of models and API references for GS2-Realtime SDK for various programming languages

Configuration and integrations

Deploy/CDK

The template format used when creating stacks with GS2-Deploy, and implementation examples of template output in various languages using CDK

Related documentation

Server Types and How to Choose

The differences between relay, sync, and stateMachine, how to choose, and the development workflow

Tutorial: Object Sync

Steps to sync each player’s character position and RPCs in Unity without writing rules

Tutorial: Rollback Sync

Steps to have the server calculate character positions from inputs while your own character moves without delay through prediction

Tutorial: Server-Side Logic

Steps to write room rules in C# and let multiple players attack the same enemy in Unity

Godot Client

Nodes and settings for displaying and operating shared objects in Godot

How Object Sync Works

How objects are synced in sync and stateMachine rooms, and who can modify what

Unity Client

Components and settings for displaying and operating shared objects in Unity

Room Definition Reference

How to write rules that run in stateMachine rooms, the Room API, execution rules, and limits

Writing Rules in GDScript

How to write the rules for stateMachine rooms in GDScript, and generate and register them from Godot

Migrating from Photon

Steps and mapping tables for moving multiplayer built with Photon (PUN2) to GS2-Realtime sync / stateMachine