A simple example of a server for linux

Please excuse me, I think this is a very stupid question, nevertheless: I cannot create a roadmap for deploying a simple Unity server on a dedicated server running Ubuntu OS.

I have already learned how to deploy a similar client-server application based on Net.8 (a simple TCP Chat with connecting clients, receiving and sending messages), but so far I have no idea how to deploy an application with a similar functionality, only based on Unity-Linux-Dedicated.

I would appreciate any help!

Have you looked at containerizing your game server? Using something like Docker automates the process, and then you can deploy it on any hosting platform?

At Edgegap, we built a plugin to automate both the containerization process, and automatically uploading it to our platform so it’s hosted and managed. All directly from Unity’s editor.

GitHub with the plugin: GitHub - edgegap/edgegap-unity-plugin

Tutorial is here:

1 Like

What do you mean by that?

In Unity, you have Dedicated Server as a build target and you can build for Linux (among others).
This executable you can then upload to a game server hosting service.

And then there’s build automation where you can do the building and live updating all from within the cloud.

1 Like

Thanks for the answers!
Today I was very pleasantly surprised that by slightly rebuilding the project, replacing the async method with carutins, everything worked almost unchanged on the ubuntu server. Today I made a small test project, in fact only transport (TcpClient) was in it, tomorrow I will try to use this transport for the entire main project.

I still know very little about [NetCode], and have little idea only about Rpc methods and NetworkVariable. Does NetCode have built-in support for something like TcpClient?

Rpc can handle calling functions with a small number of arguments, NetworkVariable is suitable for synchronizing some common parameters, and what is the best way directly in [NetCode] for transferring some relatively large files between the client and the server?

By large I mean from 1mB to 30Mb of json

Thanks for the answers!

By the way, can I see some sample NetCode performance tests somewhere? Just to at least roughly understand what he is capable of, and what should not be expected from him

Containers don’t introduce latency. You can read a bit about Docker/containers in this blog: Dockers for Multiplayer Game Servers

As for netcode to transport data to the game servers, you can use any with Edgegap. We also have a small guide on which are the easiest netcode to use on Edgegap: Easiest Unity Netcode for Game Developers

Whichever netcode you use (e.g., Unity’s NGO, Mirror, Fish-Net, Photon), we have documentation to help you add Edgegap for game server’s hosting: Edgegap

Thanks for the interesting article about using Docker in Unity!

I think the main reason for using Docker is to save money on proper management of computing power.
At the moment, I use the cheapest dedicated server for $11 per month, its configuration:
2x2.2GHz, 2GB RAM, 1IP
20GB SSD RAID

I think at this stage I would like to know the maximum allowable performance over a long period of time for this configuration without using Docker, so that I can assess the economic benefits and feasibility of using Docker

30 Mb Json => gzip compress it. If it’s still several MB after that it is best NOT to share such large files with Netcode but use any other means of sharing files, be it your own webserver or cloud drive/services.

And consider whether this actually has to be shared - quite often devs try to share things over the network that would only require very little information and the rest can be reconstructed from that. Typical example would be sharing a texture available on the net or procedurally, rather than sending the entire texture one would either send the URL to download the texture or send enough information (possibly just the random seed) to generate the same data on every client.

2 Likes

In this case, I’m talking about sending the client a list of current objects on the map from the server (not their Mesh grid, but just Transform data and some of their variable values).

In addition, 30mB is rather a maximum with a margin, usually it is about 0.5-3mB

Perhaps there is a better way to transfer data about the currently involved objects?

Thanks!