<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Ftopologies</id>
	<title>Unity.Multiplayer/articles/topologies - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mindattic.com/wiki/docs/index.php?action=history&amp;feed=atom&amp;title=Unity.Multiplayer%2Farticles%2Ftopologies"/>
	<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/topologies&amp;action=history"/>
	<updated>2026-12-05T11:07:29Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.3</generator>
	<entry>
		<id>https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/topologies&amp;diff=937&amp;oldid=prev</id>
		<title>Docs Sync: md2wiki: sync from MindAttic.Docs</title>
		<link rel="alternate" type="text/html" href="https://mindattic.com/wiki/docs/index.php?title=Unity.Multiplayer/articles/topologies&amp;diff=937&amp;oldid=prev"/>
		<updated>2026-11-29T20:37:14Z</updated>

		<summary type="html">&lt;p&gt;md2wiki: sync from MindAttic.Docs&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Topologies =&lt;br /&gt;
&lt;br /&gt;
The same game code runs three ways. The topology is configuration (&amp;lt;code&amp;gt;NetConfig.Topology&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;Topology&amp;lt;/code&amp;gt;), never a code fork — BIBLE&amp;#039;s product promise (UM-§2).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;public enum Topology&lt;br /&gt;
{&lt;br /&gt;
    Host,   // this process is the server and a player&lt;br /&gt;
    Server, // this process is the server only (headless)&lt;br /&gt;
    Client, // this process joins someone else&amp;#039;s server&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Listen server (Host) ==&lt;br /&gt;
&lt;br /&gt;
One player&amp;#039;s game is also the server: &amp;lt;code&amp;gt;NetSession.StartHost()&amp;lt;/code&amp;gt; (or &amp;lt;code&amp;gt;NetBootstrap.StartHost()&amp;lt;/code&amp;gt;). Simplest to run (no separate process, no hosting account), but the host&amp;#039;s own frame rate, connection and crashes affect everyone. Good for small co-op sessions and for &amp;lt;code&amp;gt;Topology.Host&amp;lt;/code&amp;gt; in the Minimal sample.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;bootstrap.StartHost();&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The default join-code provider for a Host is &amp;lt;strong&amp;gt;Unity Relay&amp;lt;/strong&amp;gt; (see [[Unity.Multiplayer/articles/join-codes|Join codes]]): it gets through a home router&amp;#039;s NAT with no port forwarding, which a listen server playing over the internet needs.&lt;br /&gt;
&lt;br /&gt;
== Dedicated server (Server) ==&lt;br /&gt;
&lt;br /&gt;
A headless build that only serves; every player, including whoever started it, joins as a client.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;bootstrap.StartServer();     // in-process&lt;br /&gt;
// or, from a built player:&lt;br /&gt;
// Game.x86_64 -batchmode -nographics -mode server -port 7777 -transport udp&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;NetCommandLine&amp;lt;/code&amp;gt; reads &amp;lt;code&amp;gt;-mode host&amp;amp;#124;server&amp;amp;#124;client&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-address&amp;lt;/code&amp;gt;/&amp;lt;code&amp;gt;-ip&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-port&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-transport&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-tickrate&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-maxplayers&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-name&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;-password&amp;lt;/code&amp;gt;; &amp;lt;code&amp;gt;NetLaunch&amp;lt;/code&amp;gt; decides what actually starts: an explicit &amp;lt;code&amp;gt;-mode&amp;lt;/code&amp;gt; wins, else a headless process (&amp;lt;code&amp;gt;-batchmode&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-nographics&amp;lt;/code&amp;gt;, or a Dedicated Server build) serves by itself, else &amp;lt;code&amp;gt;NetBootstrap&amp;lt;/code&amp;gt;&amp;#039;s &amp;lt;strong&amp;gt;Auto Start&amp;lt;/strong&amp;gt; applies. The headless bootstrap also turns off vsync and sets &amp;lt;code&amp;gt;targetFrameRate&amp;lt;/code&amp;gt; to the configured tick rate, since nothing is rendering.&lt;br /&gt;
&lt;br /&gt;
The settings come in three layers, each overriding the one before: &amp;lt;code&amp;gt;NetBootstrap&amp;lt;/code&amp;gt;&amp;#039;s Inspector fields (or &amp;lt;code&amp;gt;NetBootstrap.Configure(NetConfig)&amp;lt;/code&amp;gt; from code, before the session starts; see [[Unity.Multiplayer/articles/getting-started#Settings in code|Settings in code]]), then the environment (&amp;lt;code&amp;gt;MINDATTIC_*&amp;lt;/code&amp;gt;), then the command line.&lt;br /&gt;
&lt;br /&gt;
The default join-code provider for a Server is the &amp;lt;strong&amp;gt;rendezvous service&amp;lt;/strong&amp;gt; (self-hosted; see [[Unity.Multiplayer/articles/join-codes|Join codes]]), since Relay isn&amp;#039;t needed when the server already has a reachable address.&lt;br /&gt;
&lt;br /&gt;
=== Building the Linux player ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;MindAttic &amp;gt; Multiplayer &amp;gt; Build Dedicated Server (Linux)&amp;lt;/strong&amp;gt; validates every network prefab first (see [[Unity.Multiplayer/articles/attributes#Generator diagnostics|Attributes reference]] and the [[Unity.Multiplayer/articles/troubleshooting|Troubleshooting]] guide for what that catches) and stops on errors. It then builds the open scene&amp;#039;s enabled Build Settings scenes as a headless Linux x86_64 Dedicated Server into &amp;lt;code&amp;gt;Builds/LinuxServer/&amp;lt;/code&amp;gt;, and writes a &amp;lt;code&amp;gt;Dockerfile&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;.dockerignore&amp;lt;/code&amp;gt; beside it:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-bash&amp;quot;&amp;gt;cd Builds/LinuxServer&lt;br /&gt;
docker build -t game-server .&lt;br /&gt;
docker run --rm -p 7777:7777/udp -e MINDATTIC_RENDEZVOUS_SECRET=&amp;amp;lt;secret&amp;gt; game-server -rendezvous https&amp;amp;#58;//rendezvous.example.com&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Arguments after the image name are appended to the server&amp;#039;s command line. CI builds the same way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-bash&amp;quot;&amp;gt;Unity -batchmode -quit -projectPath &amp;amp;lt;game&amp;gt; -executeMethod Unity.Multiplayer.Editor.DedicatedServerBuild.BuildFromCommandLine&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
with the optional &amp;lt;code&amp;gt;-serverOutput &amp;amp;lt;dir&amp;gt; -port &amp;amp;lt;n&amp;gt; -transport udp&amp;amp;#124;websocket -serverBackend mono&amp;amp;#124;il2cpp -serverDevelopment&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Packaging for a host ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;strong&amp;gt;MindAttic &amp;gt; Multiplayer &amp;gt; Build Server Package &amp;gt; GenericVps (default)&amp;lt;/strong&amp;gt; or &amp;lt;strong&amp;gt;&amp;gt; RunPod&amp;lt;/strong&amp;gt; builds the same Linux server plus everything a hosting provider needs (&amp;lt;code&amp;gt;server.json&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;start.sh&amp;lt;/code&amp;gt;, a health endpoint, logs and saves directories, a Dockerfile) into &amp;lt;code&amp;gt;Builds/ServerPackage/&amp;amp;lt;profile&amp;gt;/&amp;lt;/code&amp;gt;. See [[Unity.Multiplayer/articles/hosting|Hosting]] for the full provider table and how &amp;lt;code&amp;gt;mp-host&amp;lt;/code&amp;gt; deploys a package.&lt;br /&gt;
&lt;br /&gt;
== Client ==&lt;br /&gt;
&lt;br /&gt;
Joins someone else&amp;#039;s Host or Server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre class=&amp;quot;md-code lang-csharp&amp;quot;&amp;gt;bootstrap.JoinByAddress(&amp;quot;203.0.113.10&amp;quot;, 7777);&lt;br /&gt;
// or&lt;br /&gt;
await bootstrap.JoinByCode(&amp;quot;ABC-DEF-GHJ&amp;quot;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A Client never writes shared game state directly — it calls &amp;lt;code&amp;gt;[ToServer]&amp;lt;/code&amp;gt; methods and reads &amp;lt;code&amp;gt;[Synced]&amp;lt;/code&amp;gt; state the server already wrote (UM-LAW-1; see [[Unity.Multiplayer/articles/attributes|Attributes reference]]). The generator and analyzers reject code that writes a &amp;lt;code&amp;gt;[Synced]&amp;lt;/code&amp;gt; field from anywhere but the server, so a mistake here is a compile error, not a runtime bug.&lt;br /&gt;
&lt;br /&gt;
== Picking one ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! You want&lt;br /&gt;
! Topology&lt;br /&gt;
|-&lt;br /&gt;
| Quick co-op session, no extra process to run&lt;br /&gt;
| Host (listen server)&lt;br /&gt;
|-&lt;br /&gt;
| A server that outlives any one player, or that you rent on a host&lt;br /&gt;
| Server (dedicated)&lt;br /&gt;
|-&lt;br /&gt;
| Playing someone else&amp;#039;s game&lt;br /&gt;
| Client&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;NetSession&amp;lt;/code&amp;gt; exposes &amp;lt;code&amp;gt;IsHost&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;IsServer&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;IsClient&amp;lt;/code&amp;gt; so game UI (like &amp;lt;code&amp;gt;MinimalMenu&amp;lt;/code&amp;gt;) can read which one is live without re-deriving it from &amp;lt;code&amp;gt;Topology&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Testing a bad connection ==&lt;br /&gt;
&lt;br /&gt;
Every topology can simulate latency, jitter and packet loss on its own link: &amp;lt;code&amp;gt;NetConfig.Conditions&amp;lt;/code&amp;gt; (or the &amp;lt;code&amp;gt;NetBootstrap&amp;lt;/code&amp;gt; Inspector fields, or &amp;lt;code&amp;gt;-netsim&amp;lt;/code&amp;gt;) sets a profile — &amp;lt;code&amp;gt;Broadband&amp;lt;/code&amp;gt; (20 ms), &amp;lt;code&amp;gt;Mobile4G&amp;lt;/code&amp;gt; (60 ms, 1% loss), &amp;lt;code&amp;gt;Mobile3G&amp;lt;/code&amp;gt; (200 ms, 3% loss), &amp;lt;code&amp;gt;Lossy&amp;lt;/code&amp;gt; (150 ms, 5% loss) or &amp;lt;code&amp;gt;Custom&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;-latency 150 -jitter 10 -loss 5&amp;lt;/code&amp;gt;). It only works in the editor and development builds, and &amp;lt;code&amp;gt;NetSession.SetConditions&amp;lt;/code&amp;gt; can change it while the game runs. See [[Unity.Multiplayer/articles/testing|Testing]] for the PlayMode suite that exercises this (&amp;lt;code&amp;gt;LossyNetworkTests&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-crumb&amp;quot;&amp;gt;Part of [[Unity.Multiplayer]].&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;md2wiki-source&amp;quot;&amp;gt;From [https://github.com/mindattic/Unity.Multiplayer/blob/main/docs/articles/topologies.md Unity.Multiplayer/docs/articles/topologies.md] via MindAttic.Docs; synced automatically, so edit the repo, not this page.&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Unity.Multiplayer]]&lt;/div&gt;</summary>
		<author><name>Docs Sync</name></author>
	</entry>
</feed>