# Sdk Unreal Plugin

**Version: v0.9 (Beta)**

> All v1.0 features are complete and ready for integration and use. Customer iteration will determine any final changes before labelling as v1.0.

***

The current version of `i3D.net` ONE Game Hosting SDK code used in this plugin is referenced [here](https://github.com/i3D-net/ONE-GameHosting-SDK-Unreal/blob/master/docs/sdk_version_4.27.md).

## Overview

The plugin provides Unreal Engine game servers with the ability to communicate over TCP with the i3D.net ONE Platform, for easy and efficient scaling of game servers.

* [Integration guide](#integration-guide) - How to integrate the plugin into a game server.
* [Plugin package](#plugin-package) - How to package the plugin.

The i3D.net Game Hosting SDK works on Windows and Linux. If you used the guide and you are having problems with the installation, please [file an issue](https://github.com/i3D-net/ONE-GameHosting-SDK-Unreal/issues).

Supported platforms:

```
- Windows 10 Pro
- Ubuntu 18.04
```

## Requirements <a href="#requirements" id="requirements"></a>

1. Minimum compatible Unreal version: 4.25
2. Native SDK libraries require C++ Redistributable 2015 to be installed on Windows. Download the installer and follow its instructions:
   * [x64 and x86](https://www.microsoft.com/en-US/download/details.aspx?id=48145)

## Integration guide <a href="#integration-guide" id="integration-guide"></a>

1. Download the `ONE Game Hosting Plugin` from the Unreal Marketplace.
2. Copy the plugin folder into `C:\Program Files\Epic Games\UE_4.26\Engine\Plugins`.
3. In Unreal Engine Editor, go to *Edit > Plugins* menu.
4. Select the plugin from step 1 and click *Enable*.
5. Relaunch the Unreal Editor and open your game.
6. Click *Add New > Blueprint Class* and search for class `One Arcus Server`.
7. Drag in the new `One Arcus Server` into a persistent level, so that the `One Arcus Server` persist during the whole game life cycle.
8. Follow the next task: **How to test** below.

## How to test <a href="#how-to-test" id="how-to-test"></a>

There are two ways to test a Game Server that is running an `One Arcus Server`:

1. The SDK contains a Fake Agent that can connect and simulate a real deployment. Build and run instructions can be found [here](https://www.i3d.net/docs/one/odp/Game-Integration/Fake_Agent/).
2. The Game Server can be uploaded to a live One Development Platform Deployment.

> Testing can be performed either in Unreal Engine Editor or on a build running in headless mode.

## Package export <a href="#plugin-package" id="plugin-package"></a>

*This is an optional step for developers that need to locally build and package the plugin.*

### Windows

1. Add `C:\Program Files\Epic Games\UE_4.26\Engine\Build\BatchFiles` in the `PATH` environment variable
2. Build the Arcus plugin:

   a. The `one-gamehosting-sdk-unreal` repository is cloned in the folder `%USERPROFILE%/source/repos/one-gamehosting-sdk-unreal`

   b. Run the following command to build the sdk plugin: *(Where ... is the working directory where you want to copy the plugin.)*

   ```
   RunUAT.bat BuildPlugin -plugin="%USERPROFILE%/source/repos/one-gamehosting-sdk-unreal/4.26/ONEGameHostingPlugin/ONEGameHostingPlugin.uplugin" -package="%USERPROFILE%/.../Plugins/ONEGameHostingPlugin"
   ```

   c. Copy the `ONEGameHostingPlugin` into Unreal Engine plugin directory: **C:\Program Files\Epic Games\UE\_4.26\Engine\Plugins\One**, since it cannot be set directly through their toolchain.

### Linux

1. Follow the [Linux Quick Start](https://docs.unrealengine.com/en-US/SharingAndReleasing/Linux/BeginnerLinuxDeveloper/SettingUpAnUnrealWorkflow/index.html) for instructions on how to build the Unreal Engine locally.
2. For the following steps: the `UnrealEngine` is cloned in the folder `~/src/UnrealEngine/` and the `one-gamehosting-sdk-unreal` is cloned in the folder `~/src/one-gamehosting-sdk-unreal`. Make sure that the folder is created `~/src/One`.
3. Build the Arcus plugin and run the following command:

   ```
   ~/src/UnrealEngine/Engine/Build/BatchFiles/RunUAT.sh BuildPlugin -plugin=../one-gamehosting-sdk-unreal/4.26/ONEGameHostingPlugin/ONEGameHostingPlugin.uplugin -package=../One/ONEGameHostingPlugin -TargetPlatform=Linux
   ```
4. Copy the folder `~/src/One/ONEGameHostingPlugin` in `~/src/UnrealEngine/Engine/Plugin/One/ONEGameHostingPlugin`

## For developers using this plugin

Optional - The target audience is software developers that want to build the plugin locally without using pre-built plugin from the Unreal Engine marketplace.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.i3d.net/game-hosting/game-integration/sdk-overview/sdk-unreal-plugin.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
