Integration requirements
Learn the requirements your game server must meet to integrate with Multiplay Hosting.
Read time 5 minutesLast updated 3 days ago
Your game must meet specific requirements to ensure that you can use the Multiplay Hosting service to host and scale your game. The following guidelines describe how to prepare your game for Multiplay Hosting. Most of the requirements are about your build or, more specifically, your build executable file. Your build encapsulates all the files necessary to run your game. Your build executable file is the executable file within your build. You must specify the build executable file when you create a build.
General requirements
This section covers the general requirements your build must meet to use Multiplay Hosting. Refer to the following requirements to learn more:- Operating system
- Parameterized values
- Start-up conditions
- Network adapter binding
- Dynamic Port number
- Log directory
- Query protocol
- Post-allocation cleanup
Operating system
Your build executable file must support running on Ubuntu Linux 22.04. If you want to run your build executable file on Ubuntu 24.04, contact your Unity representative or refer to Unity Support.Parameterized values
Your build must support using information from parameterized values. Multiplay Hosting manages parameterized values through configuration variables, theserver.json fileserver.jsonserver.jsonStart-up conditions
Builds must support both starting with and without an allocation UUID populated in theserver.jsonallocatedUUID""Network adapter binding
Builds must bind to0.0.0.0Dynamic port number
Builds must support using a dynamic port number for game data transmission. Multiplay Hosting generates port numbers per server instance, with an offset to ensure there is no port conflict on server startup.
Your build executable file must use the
$$port$$$$port$$-port $$port$$
Logs directory
The logs directory requirement is optional. If you don't set up a log directory, you won't have any way of accessing logs and crash dumps through the Unity Dashboard. Multiplay Hosting displays server logs through the Unity Dashboard, where you can view, search, and download logs. You can control where your build saves log files through a launch parameter and configuration variable. For example, you can use-logFile$$log_dir$$The logs directory requirement is optional. If you don’t set up a log directory, you won’t have any way of accessing logs and crash dumps through the Unity Dashboard.-logFile $$log_dir$$/engine.log
Query protocol
While it’s not a requirement, it’s best practice for builds to support responding to queries from a server query protocol, such as SQP. A server query protocol is a protocol that facilitates querying information from a server instance, such as the server state and the number of allocated players. Typically, the response has static variables with dynamic (continuously updated) values. Multiplay Hosting relies on query protocol responses to decide server instances' health. If your build doesn’t support a query protocol or if you set up your query protocol incorrectly, Multiplay Hosting might decide your server instances are unresponsive. Additionally, the query protocol lets Multiplay Hosting report and watch real-time data about each server, such as concurrently connected users (CCU), active allocations, failed allocations, connected players per platform, and server events.Post-allocation cleanup
Builds must support some form of post-allocation (post-session) cleanup to prepare the game server for the next allocation. You have a couple of options:- You can return to a lobby or a ready state after a game session concludes.
- You can exit the process gracefully (for example, exit code 0).
Container build requirements
When you create a Multiplay Hosting build, you have several options for uploading your build file. One option is to use Docker and the Multiplay Hosting container registry to upload a containerized version of your build. Your build container must meet specific requirements (in addition to the General requirements) before you can use a container build.Create a container build with the base image
The linux-build-image template container takes care of most of the additional requirements of using a container build. In most cases, use the base image. You can use it by adding the following line to the top of your Dockerfile:ReplaceFROM unitymultiplay/linux-base-image:<tag>
<tag>Create a container build from scratch
If you prefer to create your Dockerfile from scratch, it’s your responsibility to ensure your container meets the following requirements.| Requirement | Description |
| Your container must use |
| Your container must have an |
# ======================================================== ## Unity base image stuff ## ======================================================== #FROM ubuntu:22.04 AS mpukRUN addgroup --gid 2000 mpukgame && \ useradd -g 2000 -u 2000 -ms /bin/sh mpukgame && \ mkdir /game && \ chown mpukgame:mpukgame /game && \ apt update && \ apt upgrade && \ apt install -y ca-certificatesUSER mpukgame# ======================================================== ## Custom game stuff ## ======================================================== #FROM mpuk AS game# copy game files here# for example:WORKDIR /gameCOPY --chown=mpukgame . .# set your game binary as the entrypointENTRYPOINT [ "./gamebinary" ]