Pulse.NET – Extra fast distributed networking

By 2 December 2015 Game Development No Comments 6 min read

In my free time usually I work on my side projects, to learn and to improve my skill in my job! I want to explain you my last effort, Pulse.NET!

What is Pulse.NET?
As server side developer and old school programmer I’m really disappointed of current Unity networking plugins. I can’t find the one that fits exactly with my idea of networking programming and can offer me features I need. Of course I didn’t tried all network plugins on Asset Store, but I tried 4-5 of them and just one is acceptable (imho). Unluckily, it lacks of some important features I need.
No one of them, instead, can offer an acceptable, load balanced, high scalable way to work on MMO Games with no bottlenecks (I’m clearly talking about standalone plugins, no cloud services or something similar).
So Pulse.NET will try to accomplish an hard task: to fill the lack that exists in distributed authoritative client/server solutions for massive multiplayer games.

What Pulse.NET can do for us?
Pulse.NET is based on Lidgren library, at the moment. My plugin wraps all P2P stuff from Lidgren, so you will be able to create P2P (peer to peer connections, discovery requests, discover local peers, send unconnected data, etc) behaviours also. But it isn’t my target, I wrapped them because I don’t want to cut out base library’s features.
My attenction is focused on client/server functionalities, in particular on high scalable networking for MMOGs.
So the main features of Pulse.NET are the following:
– Standalone multithreaded server
– Unity APIs for client creation and server creation. Of course you could need that a game server has access to physic, navmesh, etc. So you need server APIs for Unity.
– Callback system to manage all incoming packets
– Integrated database APIs (for MySQL at the moment, but I created a factory that instantiates drivers, so I want to introduce also drivers for SQLServer, MongoDB, PostgreSQL, etc: if you have requests feel free to post it) to manage worlds persistence
– Scalable and distributed-like network architecture
– Integrated examples and documentation
– Integrated distributed network example, with a masterserver, nodes, database server and game servers

Thanks to Lidgren, Pulse.NET supports reflection objects serialization, network buffers, various delivery types (like ReliableOrdered, ReliableSequenced, Unreliable, ReliableUnordered, UnreliableSequenced), messages pool/recycle, etc. In other words, you can use all Lidgren features.

Can we talk about your network architecture? How it is composed?
Pulse.NET’s architecture is composed by some, important, entities. The following scheme will explain graphically what is the flow:

<size=2>The flow of generic client’s action against the server
Let’s explain what each entity means!
First of all, of course, we have clients: all our efforts are focused to enhance their game experience.
When a client connects to Pulse.NET server, a MasterServer will check for current load of whole architecture (all registered nodes). So MasterServer will send back to client all information it needs to connect to chosen node. At the same time, MasterServer will communicate to connected client all information to connect to all services like chat, auctions, etc.
At this point, our client can communicate directly with node to send messages that server side has to evaluate.
Nodes can manage all non-game logic and respond to clients. A node can act as proxy – by submitting client’s requests to game servers – or can act as a submasterserver – by checking current load of whole game servers architecture and communicate to client the chosen one. Client is now allowed to send messages and to receive responses back.
Game servers architecture is composed by a group of Unity servers that manage virtual world. So they can manage physic, navmesh, animations, etc. They can represent different scenes or they can represent the same scene to split load on that scene (but they have to interact between them to ensure GameObjects sync).
If chosen node hasn’t proxy behaviour, game servers can interact directly with client, instead if node has proxy behaviour all messages between client and game server have to pass by chosen node.
Database server is useful to store async information. It is a standalone server that receive all queries and put them in a queue: it will compute the queue independently of other servers.

Last but not least, all this entities can be isolated on a single physical server. This means that you can spread your network on a huge physical servers group and you can add or subtract physical machines to this network based on your needs.

Oh, well: you’re talking so much now… Pics or GTFO!
I know, I know: I am boring with this wall of text, probably…
I already provided two examples, the classic “spawn the cube, move it around the world and see other remote cubes” and the classic chat. Other examples will come, if this asset will go on Asset Store. You will find these examples in Pulse.NET package.

Leave a Reply

Your email address will not be published.