SUPER NETCODE - Networking Made Simple

(Asset Store) (Documentation) (Discord) (Email)

About
Super Netcode is an easy-to-use networking solution for Unity for programmers and non-programmers. It comes with code examples, YouTube tutorials, and support from the developer. Entire source code is included without DLL’s, it works with IL2CPP, .NETCore and can be compiled without Unity for standalone fully authoritative dedicated servers. Connections can be established across different platforms including Mobile and PC. You host your own servers, there are no hidden fees or plans, once you have the netcode you have everything you need.

Low Level Transport
At its core is the low level transport over UDP written from scratch which supports reliability, encryption, authentication, compression, P2P, Mirror compatibility, accurate timings, and much more. To get familiar with the API, check out the documentation and examples that come with the asset. If you’re comfortable with coding, you can only use the low level transport and write your own spawning and synchronization logic, or you can use the provided network component system that was built on top of the transport.

High Level Network Component System
With the network component system, you can easily spawn and synchronize transforms, rigidbodies and animations with no coding required. There is no distinction between servers and clients, the system allows any kind of network architectures including mesh networks, you just need to decide which peers get authority over which objects, and the system does the rest. There are several already written components for you to use for synchronizing transforms, rigidbodies and animations. These components use smooth interpolation and only send updates when necessary to save on bandwidth. You can also extend the system by writing your own components which handle synchronization in the way you want. For a quick start guide on how to use the network component system, check out the youtube tutorial.

Support
Since we use the netcode in our games, we plan on maintaining it, adding features and offering support for the indefinite future. So go ahead, get the asset, try it out, and if you have any questions, suggestions, or if you just want to showcase what you’ve done with it, feel free to use this thread, discord, email, or add me on discord directly (Casper#8159) and i will help you out.

7 Likes

This looks incredible!

How does input works? Is it server authoritative?
Any input predictions & rollbacks?

Is there any lag compensation, reconciliation?

1 Like

Yes, you can build and run your own servers. There is no distinction between servers and clients within the netcode itself, you can do anything with the received messages, so if you’re writing a server, the server would handle assigning authorities, spawning players, relaying messages, etc. It’s completely up to you how you want to use it.

If you’re using a character controller to move the player locally, you can add a network transform component on it, give it authority and it will synchronize itself across the network on every peer that has the same player spawned. You can also automatically spawn players using the spawner component. If you want to send custom messages, you can either do it via the low level transport which sends global messages, or the network component system which sends messages directly between components.

The network transform component does both interpolation and extrapolation based on the data it receives. Depending on how you configure it, it will attempt to predict future positions in cases where there are lost or delayed packets, or if the configured delay is larger than the round trip time. If too much time elapses without any updates it will rollback to the last known position and wait for updates there. This results in perfectly smooth movement even on bad network conditions both for transforms and rigidbodies.

Because the transform component uses accurate timings, any minor lag spikes will not effect the movement of the object as extrapolation/prediction will kick in and compensate for it. This also means all peers will see the object in the same position regardless of what their RTT/ping is. So if you do hit detection on both the client and the server, the differences should be minimal.

Version 1.5 released.

  • Stability improvements and bug fixes.

  • Arena example now uses Component System with a few physics objects players can kick around.

  • Much better compatibility between Low Level Transport and High Level Component System so both can be used together.

For a full list of changes, see the changelog.

It may seem difficult, but I hope WebGL will be supported in the future.

There are several features planned, and one of them is indeed WebGL support. It’s still a while until it gets added, but once it does, Low Level Transport will use either WebSockets or WebRTC internally for WebGL builds. Out of those two, WebRTC seems like a more likely candidate as it can work via UDP.

1 Like

How many max people can be connecting at the same time?

You can have as many connections as your machine can handle. The Low Level Transport has been tested to work with over 10k encrypted connections on a small VPS (t2.micro on AWS).

2 Likes

Version 1.6 released.

Low Level Transport remains mostly the same with the biggest improvement being the calculation of timestamps of timed messages. This will now drastically reduce jitter on network transforms.

High Level Component System internal messaging system has been completely rewritten and simplified. You can now safely connect multiple clients together into a mesh network for faster delivery of messages. Even if the network you have created contains cycles, the system will detect them and stop packets from looping forever. For example, if you have a classic server/client architecture, you can also connect several clients directly to each other via P2P which will allow the system to deliver packets much faster rather than packets going through the server.

A new NetworkAuthority component has been added that can manage authority over several components for you. The update also includes several bug fixes and improvements. For a full list of changes, see the changelog.

As always, if you have any questions, suggestions or feature requests let me know, i’m happy to help.

2 Likes

https://www.youtube.com/watch?v=uu4JNvTGL8o

Hello, I am finally thinking of getting Super Netcode for my next project, can I see a video on how accurate lag compensation is for collider hit detections on various simulated latency/packet loss? If this works nicely, it will be worth getting to cut down a lot of complications and production time on the netcode side for competitive shooters!

https://www.youtube.com/watch?v=d0Mewv2fnE4

Here is a video showcasing interpolation, rollback mechanisms and lag simulator. Version 1.7 with these features should be published in a couple of days.

To make lag compensation more accurate, you can increase the send rate of your transforms which will result in more updates being sent and more accurate rollback, but your transform will consume more bandwidth as a result.

5 Likes

Good Job!!

Version 1.7 released.

With the new lag simulator found in the NetworkHost inspector, you can simulate latency and dropped packets to test how your game performs under bad network conditions.

NetworkManager now has a rollback mechanism which allows you to rewind time on transforms to a particular time in the past. This is useful for lag compensation on servers when resolving hits received by clients. When the server receives a hit, it can rewind time to when the hit was made, check if the hit is valid, and then continue.

NetworkSpawner can now be optionally used by anyone on the network which allows you to spawn a player object without any code. Just place the player onto the scene under the spawner and the spawner will do the rest.

NetworkAuthority can now resolve authority ownership in mesh networks. This allows you to connect players together via P2P and automatically resolve authority without any central servers or code. If you have physics objects such as cars or boxes or other interactive networked objects in your game, authority ownership over them can be easily transferred between players.

Vehicles and NPC’s have been added to the Arena example and players can spawn them in the escape menu. The code has been significantly simplified to make it easier to learn from. When you touch a physics object, you claim authority over it which makes the physics object react instantly without having to wait for updates from the network. Similarly when you enter a car, you instantly claim authority over it which allows you to drive it around.

Several games are in development using the netcode, some of which the developers have shown footage and screenshots for on our discord. If you’re working on a networked game, feel free to showcase it, it helps prioritize what features to add.

For the next version I’m going to look into adding WebGL support.

If anyone has any questions, suggestions or feature requests, you can ask here on email or discord. I’m happy to help, and it improves the netcode :slight_smile:

3 Likes

I am interested in your asset. I am not familiar with multiplayer games, and I am not a programmer, but understanding logics quite well. I am searching for a solution for a multiplayer game which offers me the useage of my own server, and a tool which helps me to add multiplayer functionalities by the inspector, or maybe for example by NodeCanvas or Playmaker (I own both).

Is there a way to use your asset without the need of coding (simple use cases), by using NodeCanvas or Playmaker? Or are there already functionalities in the asset which would that make possible or will these be integrated? (I have read your asset description and documentation partly, but wanted to ask directly in detail before buying. Thanks in advance!

1 Like

Thank you for your interest. You can already synchronize objects without any coding by using high level components such as NetworkTransform which automatically synchronizes position and rotation for you. All you have to do is establish a connection using a NetworkHost which can be done by calling NetworkHost.Connect with the address you want to connect to. That should be possible with Playmaker or NodeCanvas too so a multiplayer game where you can start a server or connect to one via its IP is relatively easy to make. If you’d like to have server/room/lobby list or matchmaking however, that might require some coding for now, but an easy solution for that which will hopefully require no coding is planned too. If you need any help with networking feel free to drop by on discord, send an email or use this thread, i’m happy help :slight_smile:

Hello! Great job! Is there relay support? Can you link to a video where you explain how to use your system with dedicated server? Can I use your system for MMO? if so, then how many online users can one server support? If users don’t have a real IP how can they connect?

Hi, can I use your system for Virtual Reality?

When there will be a new version? Does it will support webgl?

1 Like

Could you please provide more details regarding how does it compare against the “Netcode for GameObjects”? What does it do better?