Dev Asset Collection

All Things That You Need to Build A Video Game
Menu
  • 2D
    • Characters
    • Environments
    • Fonts
    • GUI
    • Textures & Materials
  • 3D
    • Animations
    • Characters
    • Environments
    • GUI
    • Props
    • Vegetation
    • Vehicles
  • Add-Ons
    • Machine Learning
    • Services
  • Audio
    • Ambient
    • Music
    • Sound FX
  • Essentials
    • Tutorial Projects
  • Templates
    • Packs
    • Systems
    • Tutorials
  • Tools
    • AI
    • Animation
    • Audio
    • Camera
    • Game Toolkits
    • GUI
    • Input Management
    • Integration
    • Level Design
    • Localization
    • Modeling
    • Network
    • Painting
    • Particles & Effects
    • Physics
    • Sprite Management
    • Terrain
    • Utilities
    • Version Control
    • Video
    • Visual Scripting
  • VFX
    • Particles
    • Shaders
Home
Tools
Network
DarkRift Networking 2 – Pro – Dev Community

DarkRift Networking 2 – Pro – Dev Community

Tsunami 10 February, 2022
Sending
User Rating 0 (0 votes)

For more detail this asset from the Unity Asset Store: Click Here

DarkRift Networking 2 – Pro v2.10.1 (Latest version)

Download Now

DarkRift Networking 2 – Pro v2.9.1

Download Now

“Sharing is caring”

Fast, Flexible and Powerful networking for Unity. Rewritten from scratch to make it the best.

DarkRift takes a code-first approach to cloud based networking to make a super simple and super easy to learn networking solution that can be used for absolutely any type of game.

– No CCU limitations – No need to fork out for expensive licenses no matter how many users.
– Fully multithreaded – Make the most of vertical scaling and use your servers as efficiently as possibly.
– Unity or no Unity – Run your cloud servers from a Unity instance or run them standalone for a little extra performance.

The Pro version brings even more features to your game including our matchmaker, server clustering and server monitoring.

Unity Forum Thread
Community Discord
Documentation
Wiki

Getting Started
Welcome, and it’s nice to know you want to learn DarkRift! This tutorial aims to be a comprehensive guide for anyone who wants to get started with DarkRift no matter how much networking experience you have. Nevertheless, as someone who hates oversimplification, I’ll try and keep it interesting for people who do have networking experience!

If you want to learn DarkRift you’ll need a solid grasp of C# and a good knowledge of Unity. DarkRift also uses multithreading quite extensively so, although we won’t be using it in this tutorial, to get the most out of DarkRift you’ll need to understand multithreading very well!

As a tutorial, we’re going to recreate a popular game called Agar.io. We won’t implement all the features it has but we’ll get a basic system of moving and eating going and you can always add the others as an exercise afterwards.

Before we jump into the art of DarkRift we should explore how DarkRift operates.

Hopefully the autogenerated properties should be fairly self-explanatory. When implementing them remember:

Version should follow Semantic Versioning (unless you really hate best practices). It is used to trigger upgrades to plugins (we’ll cover that later) so you should give it a default value now.
ThreadSafe indicates whether your program can handle multithreaded events to boost performance. Since I won’t cover any multithreading in this set it to false, if you know about multithreading then it might be a nice exercise at the end to reimplement the plugin with multithreading enabled!

DarkRift uses plugins to implement all server side logic, you write plugins as you would develop a standard .NET library and then you just drop the generated DLL into DarkRift’s ‘Plugins’ directory. DarkRift offers a large API for managing clients and sending messages etc. and provides events that inform your plugins when a client connects, sends a message etc.

Everything related to the server code is in the namespace DarkRift.Server, everything to do with the client in DarkRift.Client and everything used in both is just in DarkRift.

Setting up the Plugin
Create a new Class Library C# project in Visual Studio named something like “AgarPlugin” and add references to DarkRift.Server.dll and DarkRift.dll.

WARNING
If you are using the Free version of DarkRift you will need to create a .NET Framework plugin, only the .NET Core build of the Pro version of DarkRift supports .NET Core/Standard plugins.
Rename the default class to AgarPlayerManager and rename the file similarly. Add using directives to the top of the file (using DarkRift; and using DarkRift.Server;) so that we have access to both DarkRift.Server and DarkRift namespaces.

All plugins in DarkRift must inherit from DarkRift.Server.Plugin so that DarkRift can correctly discover and instantiate them and so it can easily read details about your plugin. It is also your entry point into DarkRift’s API so that you make changes on the correct server instances.

Go ahead and make AgarPlayerManager inherit from Plugin, you’ll notice Visual Studio throws an error saying that there is no constructor so add it. You’ll then notice it says that it does not implement a number of abstract properties, once again add them. If you’re following along, you should have a class like this:
 

Prev Article
Next Article

Related Articles

Fusion (Game Creator 2) – Dev Community
Tsunami 30 June, 2025

Fusion (Game Creator 2) – Dev Community

Forum for Combu – Dev Community
Tsunami 5 August, 2020

Forum for Combu – Dev Community

Smooth Sync – Dev Community
Tsunami 5 May, 2025

Smooth Sync – Dev Community

Internet Checker – Dev Community
Tsunami 17 July, 2020

Internet Checker – Dev Community

Leave a Reply Cancel Reply

Recent Posts

  • OptiTerra (HDRP) – High Performance Terrain Shader – Free Download
  • MIGHTY FPS HEATMAPS – Free Download
  • Scene Pilot Pro – Free Download
  • Fantasy User Interface Sounds – Lite Edition – Free Download
  • Advanced Multiplayer Game Template – Dev Community

Dev Asset Collection

All Things That You Need to Build A Video Game
Copyright © 2026 Dev Asset Collection
Privacy Policy | Disclaimer | DMCA