Skip to content

Integration Guide

The SDK contains multiple separate components providing specific functionality. This integration guide will provide information of how to integrate the Arcus and Ping components.

  • Arcus Component: For communication between Game Server and the ONE Game Hosting Platform.
  • Ping Component: For obtaining available servers and pings from the game's Player code.

Integration Guide - Arcus Component

The goal of the integration is for the game server to host an Arcus Server over TCP, allowing the ONE Platform to connect to the server to send and receive Arcus messages.

Adding the library to the Game

The one/arcus folder must be copied to the project and configured for building.

Alternatively, to integrate binaries and headers:

  1. Build the repository.
  2. Copy the static lib found in build/one/arcus/one_arcus.lib/a.

Either way, the following headers must be included in the game server: - one/arcus/c_api.h - one/arcus/c_error.h - one/arcus/c_platform.h

Using the API

For C++ game engines, the additional C++ code in one/fake/arcus/game is can be used in your integration to wrap the C API and provide easy-to-use C++ interfaces for the game engine.

The ONE Server Wrapper, defined in one/fake/arcus/game/one_server_wrapper.cpp, is the core of this sample. It is a C++ header/cpp wrapper around the ONE Arcus Server API that does the following actions:

  • Isolates the ONE API from the rest of the game code.
  • Contains in-source code comments explaining the motivation and purpose of the API calls from the user's perspective.
  • Can be directly copied and used as a head-start for developers integrating the library into their own engines.

See the Fake Game readme for details.

Testing and Deploying

While developing the integration, the Game Server may be tested by building and running the Fake Agent. The Fake Agent can connect to a running instance of the game server, to test the basics of the integration without needing to deploy to the remote ONE Platform.

Once the integration is complete, the Game Server must be deployed to the ONE Platform for final testing. This consists of the following steps:

  1. Setup an application on the ONE Platform.
  2. Deploy the Game Server with the Arcus integration to the ONE Platform.
  3. Use the platform dashboard and tools to confirm the Agent is successfully connected with the server and that all messages are functioning as expected.

Network Activity

The One Arcus API has relatively low network activity. It's rare for messages to be sent and received. The most common messages will be small keep-alive packets sent and received several times a minute.

Integration Guide - Ping Component

The goal of the integration is to obtain network ping latency values from the player to the game server locations.

Adding the library to the Game

The one/ping folder must be copied to the project and configured for building.

Alternatively, to integrate binaries and headers: 1. Build the repository. 2. Copy the binaries found in build/one/ping.

Either way, the following headers must be included in the game server: - one/ping/c_api.h - one/ping/c_error.h - one/ping/c_platform.h

Using the API

For C++ game engines, the additional C++ code in one/fake/ping can be used in your integration to wrap the C API and provide easy-to-use C++ interfaces for the game engine.

The sites and pingers wrappers, located at one/fake/ping/i3d_sites_getter_wrapper.cpp and one/fake/ping/i3d_pingers_wrapper.cpp, are the core of the sample integration. They are C++ header/cpp wrappers around the i3d Ping C API that:

  • isolates the ONE API from the rest of the game code
  • contains in-source code comments explaining the motivation and purpose of the API calls from the user's perspective
  • can be directly copied and used as a head-start for developers integrating the library into their own engines

See the Fake Game readme for details.

Testing

No special testing configuration is needed. Integrate the ping component into your game and inspect the results for correctness.

Performance

The library performs HTTP calls (through your engine's own solution), decodes JSON, and makes outgoing TCP ping calls. The frequency of this activity can be controlled directly by your integration.