新增FishNet文档

This commit is contained in:
2026-09-20 15:53:11 +08:00
parent c403145db9
commit 179c282405
431 changed files with 15476 additions and 0 deletions
@@ -0,0 +1,13 @@
---
description: Hosting is a way for players to access your game and play together.
---
# Server Hosting
## What does server hosting entail?
Server hosting involves renting or utilizing a server to host your game's files and services. A server host is essential for game deployment because it provides the infrastructure and resources necessary to manage server loads, enable online gameplay, and ensure the game is accessible to players around the world. It also facilitates updates, balances traffic, and maintains security, which are crucial for a smooth gaming experience.
FishNet supports any server hosting you choose, and you can also manage it completely yourself, including letting your players host servers themselves or act as a host.
<table data-card-size="large" data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><i class="fa-book-open">:book-open:</i></td><td><strong>Terminology</strong></td><td>Overview of key server hosting terms, comparing session-based vs persistent architectures, and outlining the roles of relays and dedicated servers.</td><td><a href="terminology.md">terminology.md</a></td></tr><tr><td><i class="fa-users">:users:</i></td><td><strong>Services</strong></td><td>A comparison of third-party hosting and relay services compatible with FishNet, including our recommended providers.</td><td><a href="services/">services</a></td></tr></tbody></table>
@@ -0,0 +1,39 @@
---
description: >-
A comparison of third-party hosting and relay services compatible with
FishNet, including our recommended providers.
---
# Services
{% hint style="warning" %}
We strongly recommend reviewing our [Server Hosting](../) page for terminology as well the Pros/Cons of services mentioned on this page.
{% endhint %}
This information is updated to the best of our knowledge. If you are interested in a service listed below — to better understand their platform — please visit the provided links to their official website.
## Our recommended service
**PlayFlow Cloud**, a company we've had the pleasure of working with firsthand, is recommended as our top-pick for a hosting service. Their outstanding support, reliable service, and superior pricing have consistently impressed our staff and community.
<table data-card-size="large" data-view="cards" data-full-width="false"><thead><tr><th></th><th data-type="rating" data-max="5"></th><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>PlayFlow Cloud</strong></td><td>5</td><td><p><img src="../../../.gitbook/assets/attach_money_24dp_FFFFFF_FILL0_wght400_GRAD0_opsz24.png" alt="">Generous free tier with better pricing than competitors.</p><p><img src="../../../.gitbook/assets/group_24dp_FFFFFF_FILL0_wght400_GRAD0_opsz24.png" alt=""> Lobby &#x26; Matchmaking, with an included SDK handling the work.</p><p><img src="../../../.gitbook/assets/public_24dp_FFFFFF_FILL0_wght400_GRAD0_opsz24.png" alt=""> Worldwide Dedicated and instanced servers.</p><p><img src="../../../.gitbook/assets/graph_5_24dp_FFFFFF_FILL0_wght400_GRAD0_opsz24.png" alt=""> User-friendly control panel, metrics, support, and more.</p></td><td><a href="../../../.gitbook/assets/playflow-card.png">playflow-card.png</a></td><td><a href="playflow-cloud/">playflow-cloud</a></td></tr></tbody></table>
***
## Other services
Here is a non-extensive selection of other hosting services that work well with FishNet.
### Dedicated servers
These hosts offer session-based servers, as well persistent servers. Relay services may be available as well.
<table data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><ul><li>Pay-per-use pricing.</li></ul><ul><li>Session-based servers available.</li></ul><ul><li>Persistent servers available.</li></ul><ul><li>Relay servers available.</li></ul><ul><li>Match Making / Lobbies.</li></ul></td><td><a href="../../../.gitbook/assets/hathora-card.png">hathora-card.png</a></td><td><a href="https://hathora.dev/">https://hathora.dev/</a></td></tr><tr><td><ul><li>Pay-per-use pricing.</li></ul><ul><li>Session-based servers available.</li></ul><ul><li>Persistent servers available.</li></ul><ul><li>Relay servers available.</li></ul><ul><li>Match Making / Lobbies.</li></ul></td><td><a href="../../../.gitbook/assets/edgegap-card.png">edgegap-card.png</a></td><td><a href="https://edgegap.com/">https://edgegap.com/</a></td></tr><tr><td><p>AWS is a bit more difficult to setup and manage. We generally only recommend AWS to experienced developers.</p><ul><li>Pay-per-use pricing — a little more complex.</li><li>Session-based servers available.</li><li>Persistent servers available.</li><li>Relay servers available.</li><li>Match Making / Lobbies.</li></ul><p>We have a community guide for AWS: <a href="getting-started-with-aws.md" class="button primary" data-icon="book-open">Community Guide</a></p></td><td><a href="../../../.gitbook/assets/aws-card.png">aws-card.png</a></td><td><a href="https://aws.amazon.com/">https://aws.amazon.com/</a></td></tr></tbody></table>
***
### Relays only
These are relay only services.
<table data-card-size="large" data-view="cards"><thead><tr><th></th><th data-hidden data-card-cover data-type="files"></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><p><i class="fa-steam">:steam:</i> <strong>Steam</strong> relays are offered free when you launch your game on steam; there is a percentage of sales, as well initial fee when using Steam.</p><p>We have an official FishNet transport for Steam, and there are third-party Unity assets available as well to help utilize Steam Relays. A popular asset is <a href="https://github.com/heathen-engineering/Toolkit-for-Steamworks-Foundation">Toolkit for Steamworks Foundation by Heathen Engineering</a>.</p><ul><li>Free for games launched using Steam.</li><li>Session-based relays.</li><li>Match Making / Lobbies.</li><li>Friends list (Steam).</li></ul></td><td><a href="../../../.gitbook/assets/steam-card.png">steam-card.png</a></td><td><a href="https://partner.steamgames.com/doc/features/multiplayer/steamdatagramrelay">https://partner.steamgames.com/doc/features/multiplayer/steamdatagramrelay</a></td></tr><tr><td><p><strong>EOS</strong> provides a number of features for free. The API and documentation is a bit more complex, which may be difficult to beginners. A vetted third-party <a href="../../../fishnet-building-blocks/transports/fishyeos-epic-online-services.md">EOS transport</a> is available for FishNet, which may help with some of those hurdles.</p><p>A cross-platform friends list is possible with EOS but at the cost of complexity; eg: you will not be able to directly access your Steam friends via the EOS platform. With this in mind, match making with friends may be more difficult.</p><ul><li>Free to all developers.</li><li>Session-based relays.</li><li>*Match Making / Lobbies.</li><li>*Friends list.</li></ul></td><td><a href="../../../.gitbook/assets/eos-card.png">eos-card.png</a></td><td><a href="https://onlineservices.epicgames.com/en-US/services">https://onlineservices.epicgames.com/en-US/services</a></td></tr></tbody></table>
@@ -0,0 +1,114 @@
---
description: A community-made guide for using AWS to host a FishNet server.
cover: ../../../.gitbook/assets/aws-cover.png
coverY: 0
---
# Getting Started with AWS
_This tutorial was kindly provided by haseebzahid413#2226._
## Verify permissions for AWS account
1. Go to AWS Management Console
2. Launch a Virtual Machine
3. Select any free-tier Linux machine
4. Select any free-tier instance type
5. Edit Security Groups
6.
1. Add Rule
2. Custom TCP Rule - port 7770 (or whatever you want to choose for your game)
3. set Source to anywhere
4. Add Rule
5. UDP rule - port 7770 (or whatever you want to choose for your game)
6. set Source to anywhere
7. Press “Review and Launch”
7. Create a new Key Pair
8.
1. Give it a name
2. download keypair
3. Press “Launch Instance”
9. Download Putty
10. Download WinSCP
11. Open PuttyGen
12.
1. Conversions > Import Key
2. Select the downloaded key
3. Set the right Key Type as you set while creating the key above
4. Save Private Key
5. Close Window
6. This file of type ppk will be used later
13. Open Putty
14.
1. Copy IPV4 DNS address for the instance we created above from AWS EC2 Instances window
2. Putty Configuration > Session > Host Name set this hostname to follows
3.
1. ec2-user@ followed by the DNS address copied above
4. Keep port at 22
5. Connection Type SSH
6. Go to Connection > SSH > Auth
7.
1. Provide the ppk generated above here in “Browse”
8. Go back to Session
9.
1. Provide a name in Saved Sessions to be save this session
2. Press Save
10. Now double click this name in session to open this session
11. Our Putty terminal is up and running on the Linux machine
15. Open WinSCP
16.
1. When asked opt for single window with 2 panels option
2. Login > New Site
3.
1. File Protocol > SCP
2. Paste the same hostname pasted in Putty, or copied from AWS EC2 Instances Console
3. Username > ec2-user
4. Advanced > SSH > Authentication > Private Key File
5.
1. Provide the private key file here
2. Press Okay
6. Press Save
7. Provide a name to this new Login
4. Double click on the login created
5. It will connect to our Linux Server
6. We will use this Window to transfer replace or delete build on our Linux server
## Configuring Fish-Networking
1. Add TugBoat component on Network Manager
2.
1. Set IPV4 server bind address to 127.0.0.1, or leave **empty**.
2. Set port to 7770 (or whatever you want to specify but should be allowed in EC2 instance network incoming traffic conditions)
3. Set client address to EC2 instance public IPV4 DNS address
4. Save scene
3. In Build Settings
4.
1. Set target platform to Linux
2. Keep architecture to x86\_64
3. Enable ServerBuild (to keep headless)
4. Make sure the server scene is added and enabled in build settings
5. Build and save in a folder
6. Wait for the build process to complete
## Deploying
1. WinSCP
1. Navigate left panel to the unity server build folder
2. Right click and upload that to the linux server
3. It will take some time to upload
4. Once upload complete
2. Putty terminal
1. Go the the Putty terminal window
2. Using standard commands navigate inside the build folder
3. Run commands
4.
1. chmod +x “executable file name of type .x86\_64”
2. ./“executable file name of type .x86\_64”
3. Server is up and running
5. Go back to Unity for Client editor testing or build
## Connecting a client
1. Run in unity
2. Press Client
3. It should run perfectly fine
@@ -0,0 +1,100 @@
---
description: >-
PlayFlow handles the server hosting, matchmaking, & lobbies so you can focus
on your game.
cover: ../../../../.gitbook/assets/playflow-cover.png
coverY: 0
layout:
width: default
cover:
visible: true
size: full
title:
visible: false
description:
visible: false
tableOfContents:
visible: true
outline:
visible: false
pagination:
visible: true
metadata:
visible: false
---
# PlayFlow Cloud (Recommended)
<div align="center" data-full-width="false"><figure><img src="../../../../.gitbook/assets/animated-server-signals.webp" alt="" width="250"><figcaption></figcaption></figure></div>
<p align="center"><strong>PlayFlow</strong> is the <mark style="color:$primary;">easiest</mark> way to <strong>build</strong>, <strong>deploy</strong>, and <strong>scale</strong> multiplayer games globally, it's a fantastic tool for any multiplayer games that might have need of dedicated servers. Their outstanding support, reliable service, and competitive pricing make PlayFlow our personal recommendation. They have a powerful API with many useful features that make them stand-out. </p>
<p align="center"><mark style="color:$info;">Deploy your first server in under 30 seconds for free. No credit card required.</mark></p>
<div align="center" data-full-width="false"><figure><img src="../../../../.gitbook/assets/animated-down-arrow.webp" alt=""><figcaption></figcaption></figure></div>
<h2 align="center"><strong>Instant scaling with global deployment</strong></h2>
<p align="center"><mark style="color:$info;">Effortlessly scale in real time with no surprise costs during traffic surges, and deploy worldwide in seconds using Unity, containers, or your control panel.</mark></p>
<table data-view="cards" data-full-width="false"><thead><tr><th align="center"></th><th align="center"></th></tr></thead><tbody><tr><td align="center"><strong>15+</strong></td><td align="center">Global Regions</td></tr><tr><td align="center"><strong>&#x3C;20ms</strong></td><td align="center">Average Latency</td></tr><tr><td align="center"><strong>1M+</strong></td><td align="center">Players Served</td></tr></tbody></table>
***
<h3 align="center">More key benefits of PlayFlow</h3>
<p align="center"><mark style="color:$info;">The PlayFlow Unity SDK provides a powerful and convenient way to manage your game servers, lobbies, and matchmaking directly within the Unity Editor and your game’s C# scripts.</mark></p>
<p align="center"><mark style="color:$info;">Find out more about PlayFlow's robust features below!</mark></p>
***
<h2 align="center"><i class="fa-square-dollar">:square-dollar:</i></h2>
<h2 align="center"><strong>Better pricing than the competition</strong></h2>
<p align="center"><mark style="color:$info;">No hidden fees. Transparent pricing — paying only for what you use. You can use their cost estimator to get an idea of what running your game might cost you directly from their website. Check out their full pricing page</mark> <a href="https://www.playflowcloud.com/#pricing"><mark style="color:$primary;">here</mark></a><mark style="color:$info;">.</mark></p>
***
<h2 align="center"><i class="fa-users">:users:</i></h2>
<h2 align="center"><strong>Matchmaking &#x26; lobby system</strong></h2>
<p align="center"><mark style="color:$info;">Complete game lobby system and matchmaking included so you can match-up your players by skill, region, or your own rules.</mark></p>
***
<h2 align="center"><i class="fa-comments-question-check">:comments-question-check:</i></h2>
<h2 align="center"><strong>Generous free tier &#x26; support that listens</strong></h2>
<p align="center"><mark style="color:$info;">Build fast, playtest often. All without pulling out your credit card. <strong>PlayFlow</strong> offers the quickest way to test your game online, directly from the Unity editor, and you can do so for free!</mark> </p>
<p align="center"><mark style="color:$info;">Get help from real people with fast replies, and feedback that actually shapes the platform.</mark></p>
***
<h2 align="center"><i class="fa-arrow-up-right-dots">:arrow-up-right-dots:</i></h2>
<h2 align="center">Real-time metrics &#x26; <strong>powerful control panel</strong></h2>
<p align="center"><mark style="color:$info;">Experience seamless monitoring with the advanced dashboard for complete visibility. Instantly track server health, player counts, CPU/memory usage, and network traffic. Features include real-time performance tracking, customizable alerts, log aggregation, and player activity monitoring for optimal performance.</mark></p>
***
<h2 align="center"><i class="fa-list">:list:</i></h2>
<h2 align="center">And still more!</h2>
<p align="center"><mark style="color:$info;">Yet more compelling features,</mark> <strong>including</strong><mark style="color:$info;">...</mark></p>
<table data-view="cards"><thead><tr><th align="center"></th><th align="center"></th><th align="center"></th><th data-hidden data-card-cover data-type="image"></th></tr></thead><tbody><tr><td align="center"><i class="fa-timer">:timer:</i></td><td align="center">&#x3C;5min</td><td align="center">Getting Started Time</td><td></td></tr><tr><td align="center"><i class="fa-chart-column">:chart-column:</i></td><td align="center"><strong>Auto-Scaling</strong></td><td align="center">Intelligent demand-based scaling</td><td></td></tr><tr><td align="center"><i class="fa-circle-dollar-to-slot">:circle-dollar-to-slot:</i></td><td align="center"><strong>Online Cost Estimator</strong></td><td align="center">Instantly Forecast Project Costs</td><td></td></tr></tbody></table>
<p align="center"><i class="fa-browser">:browser:</i> <a href="https://www.playflowcloud.com/">Website</a> <i class="fa-rocket-launch">:rocket-launch:</i> <a href="https://documentation.playflowcloud.com/quickstart">Quick Start</a> <i class="fa-book-open">:book-open:</i> <a href="https://documentation.playflowcloud.com/quickstart">Documentation</a> <i class="fa-unity">:unity:</i> <a href="https://documentation.playflowcloud.com/unity">PlayFlow SDK</a> <i class="fa-gear-complex">:gear-complex:</i> <a href="https://documentation.playflowcloud.com/api-reference/servers/list-game-servers">API Reference</a></p>
@@ -0,0 +1,99 @@
---
description: >-
Simple tutorial showing how easy PlayFlow makes it to host a server for your
WebGL game.
---
# Easy WebGL hosting with PlayFlow
## How PlayFlow makes WebGL hosting easy
For seamless WebGL gaming experiences in web browsers, secure WebSocket connections are crucial, but configuring them can be complex. Often, developers end up managing certificates and networking issues, which can be time-consuming. **With PlayFlow,** however, you only need to enable a simple option to handle these concerns effortlessly.
## Before we begin...
This tutorial assumes you've read the [getting-started-with-playflow.md](getting-started-with-playflow.md "mention") tutorial already. In the following steps we will convert our project support WebGL.
{% stepper %}
{% step %}
### Install Bayou
For FishNet connections on WebGL we will need to use a web supported transport; there are multiple available, but this tutorial will be using [Bayou](../../../../fishnet-building-blocks/transports/bayou.md). Head over to the Bayou Github repo and download the most recently released `unitypackage` file and then import it into your project.
{% embed url="https://github.com/FirstGearGames/Bayou/releases/latest" %}
<figure><img src="../../../../.gitbook/assets/bayou-latest-release.png" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% step %}
### Add Bayou to your Network Manager
Now that **Bayou** is imported into your project, you can select your [NetworkManager](../../../../fishnet-building-blocks/components/managers/network-manager.md) and add the component to it.
<figure><img src="../../../../.gitbook/assets/bayou-added-to-networkmanager.png" alt=""><figcaption></figcaption></figure>
{% hint style="info" %}
If you have more than one [transport](../../../../fishnet-building-blocks/transports/) on your **NetworkManager**, such as [Tugboat](../../../../fishnet-building-blocks/transports/tugboat.md), then you will need to add the [TransportManager](../../../../fishnet-building-blocks/components/managers/transportmanager/) component, and drag Bayou into its **Transport** field to set it as the active one.
{% endhint %}
{% endstep %}
{% step %}
### Enable WSS
In the Bayou component, enable the **Use WSS** option. This will tell Bayou to use Web Socket Secure. Doing this will show a bunch of **SSL Configuration** options below, but we don't need to do anything with them for this setup.
<figure><img src="../../../../.gitbook/assets/bayou-wss-enabled.png" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% step %}
### Build your PlayFlow server
Open the PlayFlow Cloud Window from the Unity toolbar (**PlayFlow → Playflow Cloud**).
Click the **Upload Server** button to build and upload your Unity server.
<figure><img src="../../../../.gitbook/assets/playflow-uploading-server.png" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% step %}
### Set the correct PlayFlow port protocol
Open the [PlayFlow dashboard](https://app.playflowcloud.com/) in your browser and navigate to the **Configuration** tab. Edit or add your port and choose the **TCP** protocol and be sure to **Enable TLS**.
<figure><img src="../../../../.gitbook/assets/playflow-tcp-tls.png" alt=""><figcaption><p>Choosing the correct protocol for WebGL</p></figcaption></figure>
{% endstep %}
{% step %}
### Start a PlayFlow server
Now head over to the **Server** tab in PlayFlow and create your server instance.
<figure><img src="../../../../.gitbook/assets/playflow-create-webgl-server.png" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% step %}
### Prepare your client build
If you click on your server instance's **Details**, you will see a **Host** and **External Port** that you will be able to connect your clients to. Open Unity, select the Bayou component, and enter these into the **Client Address** and **Port** fields respectively.
<div><figure><img src="../../../../.gitbook/assets/playflow-webgl-address-port.png" alt=""><figcaption></figcaption></figure> <figure><img src="../../../../.gitbook/assets/bayou-webgl-fields-entered.png" alt=""><figcaption></figcaption></figure></div>
{% endstep %}
{% step %}
### Building your WebGL client
Now let's build the WebGL client. In your Unity build profiles, be sure to switch to the **Web Platform** and then build your game. Once that's done you can zip the built files and upload it to your chosen hosting site and run your game in the browser!
<figure><img src="../../../../.gitbook/assets/zipped-webgl-files.png" alt=""><figcaption></figcaption></figure>
For this test we have created a project on Itch.io and uploaded the client build to it.
<figure><img src="../../../../.gitbook/assets/itch.io-uploaded-webgl-game.png" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
## Success!
Just like that, we were able to create a server and have our clients in the web browser securely connect to it. If you want to check out more of their features, you can check out their documentation here: [https://documentation.playflowcloud.com/](https://documentation.playflowcloud.com/)
You are also encouraged to join their <i class="fa-discord">:discord:</i> Discord server here: [https://discord.gg/P5w45Vx5Q8](https://discord.gg/P5w45Vx5Q8)
@@ -0,0 +1,214 @@
---
description: Step-by-step tutorial for getting up and running with PlayFlow Cloud.
---
# Getting Started with PlayFlow
{% embed url="https://www.youtube.com/watch?v=TyvBHUlYP64" %}
***
## Written tutorial
This guide assumes you have some or all of your game already written using FishNet and are now ready to use PlayFlow to implement a dedicated server. You can also use PlayFlow throughout the development process as its one-click deployment makes it easy to setup a temporary server for testing.
## Before we begin...
{% stepper %}
{% step %}
### Starting project
If you don't have a project already setup but want to follow this tutorial, you can use the [getting-started](../../../../tutorials/getting-started/ "mention") FishNet tutorial project. The files for it can be downloaded here:
<a href="https://github.com/maxkratt/fish-networking-getting-started/releases/download/using-syncvars-to-sync-colors/using-syncvars-to-sync-colors.unitypackage" class="button primary" data-icon="down-to-line">Getting Started Project</a>&#x20;
{% endstep %}
{% step %}
### Install the PlayFlow SDK
Now that we're ready to start, let's install [PlayFlow Cloud](https://www.playflowcloud.com/). You can directly import it with the following git URL:
```url
https://github.com/PlayFlowCloud/PlayFlow-Multiplayer-Unity-SDK.git
```
Simply add this through the Unity Package Manager and you'll be ready to continue!
{% hint style="info" %}
If you need more detailed instructions for this step, check out **PlayFlow's** own tutorial page dedicated to it here.
<a href="https://documentation.playflowcloud.com/guides/installation" class="button secondary" data-icon="rocket">Installation Guide</a>
{% endhint %}
{% endstep %}
{% step %}
### Add the necessary Unity modules
The next thing we need to do is ensure our Unity installation has the correct modules for building a server. Install the **Linux Build Support** modules for your Unity version in the Unity Hub.
{% hint style="info" %}
Exact details on the required modules depending on your Unity version can be found here:
<a href="https://documentation.playflowcloud.com/guides/unity-modules" class="button secondary" data-icon="unity">Unity Modules Setup</a>
{% endhint %}
{% endstep %}
{% step %}
### Add Tugboat
Select the [NetworkManager](../../../../fishnet-building-blocks/components/managers/network-manager.md) in your project and add the [Tugboat](../../../../fishnet-building-blocks/transports/tugboat.md) component if it isn't already there (If you are using a different [transport](../../../../fishnet-building-blocks/transports/), that is also fine).
Enable the **Reuse Address** checkbox, this will be needed for our server to work correctly.&#x20;
<div align="center"><figure><img src="../../../../.gitbook/assets/playflow-tutorial-tugboat-reuse-address.png" alt=""><figcaption></figcaption></figure></div>
The other two fields we'll be paying attention to are the _Port_ and _Client Address_ ones. For now you can leave the default settings, we'll remember the port number for later and we'll use the _Client Address_ field in our client build to input the URL of our hosted server.
{% endstep %}
{% step %}
### Manage Auto Start
We will want FishNet to automatically start as a server in the server build we make. FishNet will actually do this by default with the [#start-on-headless](../../../../fishnet-building-blocks/components/managers/server-manager.md#start-on-headless "mention") option on the [ServerManager](../../../../fishnet-building-blocks/components/managers/server-manager.md). If you disabled this, be sure to manage starting the server itself, or simply re-enable it.
If we have set the [networkhudcanvas.md](../../../../fishnet-building-blocks/prefabs/networkhudcanvas.md "mention") _Auto Start Type_ to something other than **Disabled**, then we will want to disable it now, since we want our server to only behave as a server.
<figure><img src="../../../../.gitbook/assets/setting-autostart-type.png" alt=""><figcaption><p>Switch Auto Start Type to Disabled</p></figcaption></figure>
{% endstep %}
{% endstepper %}
Once that's all done we can move on to using PlayFlow Cloud!
## Deploying your game with PlayFlow
{% stepper %}
{% step %}
### Create your PlayFlow account
Now that PlayFlow is installed, let's go to the website and setup our dashboard.
Go to the [PlayFlow Cloud website](https://app.playflowcloud.com/) and sign-up using your email, or log in with your GitHub or Google account. If asked, confirm your email address to complete the setup.
{% endstep %}
{% step %}
### Create a game studio
You'll now be prompted to create a Game Studio. Game Studios make it easy to organize your game projects and work smoothly with your team.
Enter a name for studio and select either the **Hobby** or **Pro** plan, you can read more about the plan types [here](https://documentation.playflowcloud.com/fundamentals/plan-instance-types). For this tutorial we will be using the **Hobby** plan, but don't worry, you can always change the plan and even the name after it's created.&#x20;
Once you've done that, click **Create Studio** and you'll be good to continue.
{% hint style="info" %}
If you've chosen the **Pro** plan, you will also be able to manage **Team Collaboration** after your studio is created.
{% endhint %}
{% endstep %}
{% step %}
### Create a new project
Now that you've created your first Studio you'll be prompted to choose it and then we can move forward with creating a new project.
Click the **Create New Project** button and let's enter the details of your project.
* [x] **Project Name:** give your project any fitting name you'd like.
* [x] **Game Engine:** Select <i class="fa-unity">:unity:</i> _**Unity**_ as the **Game Engine** as that's what we are usin&#x67;**.**
* [x] **Game Type:** You can choose the game type that fits your project best, for this guide we'll simply choose <i class="fa-puzzle-piece-simple">:puzzle-piece-simple:</i> _**Other.**_
You can now click **Create Project** to proceed,
{% endstep %}
{% step %}
### Explore the dashboard
With your new project created and selected, you can check out the **PlayFlow** dashboard for it.
PlayFlow has a lot of powerful features and makes it very easy for you, the developer of your game, to view the logs, metrics, server details and more. The PlayFlow dashboard can also be used to directly upload your game's server builds and manage server instances.
<figure><img src="../../../../.gitbook/assets/playflow-tutorial-dashboard.png" alt=""><figcaption></figcaption></figure>
Once you're done looking around, we'll jump into setting up our server build and running it.
{% endstep %}
{% step %}
### Link the PlayFlow SDK to your project
Now let's link our Unity Project to the PlayFlow one we've just created.&#x20;
1. Open the **Overview** page in the PlayFlow dashboard.
2. Find the **API Keys** section and click the **View API Keys** button. Then copy the **PlayFlow API Key** to your clipboard.
3. Now go to the Unity Editor and open the PlayFlow window from the Toolbar at **PlayFlow → PlayFlow Cloud**.
4. Inside the _Token_ field, paste the **PlayFlow API Key** you copied.
<figure><img src="../../../../.gitbook/assets/playflow-tutorial-sdk-window.png" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% step %}
### Build and upload the server
You should now specify the scene that the server should start in with the **Server Scene** field. You can set it manually by selecting the chosen scene through the dropdown or you can make PlayFlow use the **Build Settings' Scene List** instead, by enabling that option.
{% hint style="info" %}
Don't forget to add your scenes to Unity's build settings scene list!
{% endhint %}
You can also customize the other settings in the PlayFlow Cloud window, such as the **Development Build** or **Build Version**.
When you're happy with those, you can press the **Upload Server** button to have PlayFlow automatically build and upload a headless Linux server build of your game. This will take a brief moment, and then you will have a log in the editor console saying the build uploaded successfully.&#x20;
If needed, you can browse the files of the build and delete it directly from the PlayFlow Dashboard under the Builds tab; pressing the **View Builds** button in the PlayFlow window will open this directly for you.
{% endstep %}
{% step %}
### Setup the PlayFlow port
Now we will setup the port to use in the PlayFlow dashboard. Open up the website and head to the **Configuration** tab and then **Network Ports** section. Click the **Add Your First Port** button and fill in the fields.
<figure><img src="../../../../.gitbook/assets/playflow-tutorial-add-new-port.png" alt=""><figcaption></figcaption></figure>
* [x] **Port Name:** We can enter a simple name for it here, we'll just call ours `getting_started_udp`.
* [x] **Port Number:** This field should be filled in with the port we have entered in our Transport's _Port_ field. Since we are using Tugboat, the default is `7770`, so enter that now.
* [x] **Protocol:** This is the protocol used by your transport, Tugboat uses UDP, so leave that as the option.
* [x] **Description (Optional):** This field is optional and self-explanatory.
Once those are entered, click the **Add Port** button to finish this step.
{% endstep %}
{% step %}
### Create the server
Now we are ready to start our server, head over to the Servers tab and click the **Create Your First Server** button.
<figure><img src="../../../../.gitbook/assets/playflow-tutorial-start-server.png" alt=""><figcaption></figcaption></figure>
A window will pop-up letting you customize the settings for this server, we've changed the **Name** to `FishNet Getting Started`, you can of course choose any name you like as well as customizing the other settings to better suit your needs. Once you are happy, press **Create** Server.
You should now see the server in the Servers tab and you can see its details or stop it directly from here.
<figure><img src="../../../../.gitbook/assets/playflow-tutorial-launching-servers.png" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% step %}
### Connect to the server
Click on the **Details** button to see the details of the server. You can view the Details, Metrics, and Logs of the server here; we will look at the **Details → Network** section and copy the _Host_ and the _External Port_ fields.
<figure><img src="../../../../.gitbook/assets/playflow-tutorial-server-details.png" alt=""><figcaption></figcaption></figure>
In the Unity Editor, select the Tugboat component (or other transport you may be using).
* [x] Enter the IP Address you copied from the **Host** field into the Transport's _Client Address_ field.
* [x] Enter the P**ort** you copied into the Transport's _Port_ field.
{% endstep %}
{% step %}
### Test the game
You can now run the game or build and run it and connect as a client. Your game should connect to the PlayFlow server we setup and work correctly!
{% endstep %}
{% endstepper %}
## Take the Next Steps!
Well done! You've now learned how to setup and deploy your server using PlayFlow. If you want to check out more of their features, you can check out their documentation here: [https://documentation.playflowcloud.com/](https://documentation.playflowcloud.com/)
You are also encouraged to join their <i class="fa-discord">:discord:</i> Discord server here: [https://discord.gg/P5w45Vx5Q8](https://discord.gg/P5w45Vx5Q8)
@@ -0,0 +1,46 @@
---
description: >-
Overview of key server hosting terms, comparing session-based vs persistent
architectures, and outlining the roles of relays and dedicated servers.
---
# Terminology
### Session-based versus persistent
A session-based service, be it relay or dedicated server, will start up and end as needed. Given that these servers are on-demand(session-based) you typically pay-per-use rather than a flat rate, which can save you a substantial amount of money. Session-based services are the most common way online games are hosted and are typically used for matches and lobby based gaming, but can also be used for entire worlds with hundreds of players.
Persistent services are typically always running, no matter the number of players present. Because the servers are always available, this makes it easier to maintain the state of your worlds. A persistent server is the common choice for MMO-like games. While a constant world is very appealing this type of service often comes with significantly higher costs.
### Dedicated servers
A dedicated server refs to a server-authoritative game server. There are several advantages to a dedicated server, and very few cons.
**Benefits of a dedicated server:**
* **Scalability**: dedicated servers are rarely limited to a set number of players. If you need worlds which support dozens — even hundreds — of players, generally a dedicated server is the recommended route.
* **Security**: a dedicated server is the only way to effectively prevent player cheating, as the server becomes your game's authority and allows you to validate player information.
* **Bandwidth**: data transfer is rarely limited with dedicated servers. Relays may limit how much total data you can send, or throttle how frequently you can send data.
* **Latency:** for games which require a fast response time a dedicated server is mandatory. These servers can deploy across the world, providing the best latency and most neutrality for players.
* **Persistence**: if you want players to be able to join and leave servers, whether the service is session-based or persistent, a dedicated server will provide a smoother experience. Unlike peer-to-peer hosting, no player-host is required.
**Drawbacks of a dedicated server:**
* **Cost:** dedicated servers can be more expensive, especially if a free relay service is available through your platform or other means.
### Relays
A relay is a client-authoritative service, where the client acts as the server.
**Benefits of a relay:**
* **Cost-effective for Casual Games**: Relays are Ideal for casual or small-scale games, especially when a free relay service is available. However, using a paid relay service can quickly become impractical, as pay-per-use dedicated servers are often more affordable, while also gaining other advantages.
* **Self-hosting**: You can self-host a relay server which is far less demanding, and thus a lot cheaper, than hosting a full dedicated game server that runs all the game logic.
**Drawbacks of a relay:**
* **Scalability**: relays cannot scale. You are often limited to a number of players per session.
* **Security**: the client acting as the host is the authoritative source. Because there is not a neutral authority, cheating is very possible and often easily performed on relay servers. If cheating is a concern, a relay is likely not for you.
* **Bandwidth**: while total bandwidth usage is rarely restricted, most relay services impose limitations on data transfer frequency or size. Games that require rapid data transmission or large data chunks may experience throttling, leading to various performance issues.
* **Latency**: the hosting client's network connection determines latency for the entire session. A weak connection results in higher latency for all players, and players located far from the host will experience additional delay.
* **Persistence**: relay services do not support state persistence. When the host ends the session, all progress is lost. Additionally, if the host leaves unexpectedly, the game session typically terminates immediately for all connected players.