In 2013, when we started the Stormancer project, we wanted to create a platform as a service available on the cloud, similar to Heroku in its usage, but for low latency network applications in general, and for video games in particular. We wanted something that would give as much power as possible to the developer, while abstracting away all the underlaying complex infrastructure code. Developers would be able to code a complex game server on their machine, then push it to a cloud platform, where its services would be deployed transparently on many instances, where load would be distributed depending on the requirement of each service.
For both players and developers, everything would look like there was a single server, a "mega server" (even if this term has been somewhat worn off by marketing).
As a company, we still don't provide a managed cloud platform for many reasons (business reasons, mainly. But we could, in the future). Instead, we went another way: Stormancer is a set of tools, software and technologies that allow developers to create this kind of cloud platform, for their game.
Stormancer is a powerful, flexible and scalable system for easier devops and liveops of realtime multiplayer games, that facilitates both deployment automation and API management. Build, run, manage your online games in a large and rapidly growing ecosystem that overcomes actual server infrastructure solutions.
Stormancer is a flexible solution that can be thought of as:
- a portable cloud platform for game development
- a backend software solution
- a container system
Since Stormancer’s server is implemented as a distributed container system, our solution provides a container-centric management environment. All the applications are isolated and all the network communication between your app and the exterior are filtered by the distributed platform. It provides much of the simplicity of Platform as a Service (PaaS) with the flexibility of custom hosting and enables portability across hosting providers.
Stormancer was designed to serve as a platform for building an ecosystem of components and tools to make it easier to deploy, scale, and manage applications for faster online game development.
Code server applications in C# with a powerful high-level API, deploy on the server using GIT, automate operations using web APIs, save time by using our open source server-side and client-side plugins, connect game clients with SDKs targeting multiple platforms, install and scale a cluster as your playerbase grows.
Stormancer is not PaaS, but a foundation on which to build one. You can think Stormancer as a set of building elements to create the clouds you need for your game. Stormancer provides the building elements for building online games but preserves user choice and flexibility where it is important: the core elements include an open source C++ client SDK, a fully customizable server application model, flexible hosting solutions as well as customizable and pluggable open source plugins. Stormancer is not monolithic and is designed to share as much code as possible between platforms, and can be plugged in other services (in-app purchase, Playfab, etc.), making you more productive.
It's possible to start and run a single or even serveral Stormancer grid nodes on a development machine, and imitate a production environment. You can run several Stormancer grids between different hosting providers, whether dedicated or public cloud without restriction, and make them cooperate. And as the topology of the cluster is 100% software defined, setting up a new development or production cluster is as simple as starting several nodes and copying a single configuration.
In term of development, as you control your cluster and its security, there is no restriction to what you can run: UE dedicated servers, custom C# game server code or even a node.js game server. We provide components to make your life easier, but these components being open source, you can adapt or improve them for your special needs. Come have a chat for advices on the best way to get the result you want.
To scale easily, a web application should be stateless and not require server affinity. These characteristics enable decoupling load balancing from the application (no affinity), and easy replication of web servers (stateless). In a scalable web application, the only stateful part are the databases.
However, game servers run complex logic (AI, physics ) and require low latency communications between players and the service (game session) that runs the logic of interest to a set of players. To achieve a sufficient level of performance, the service must be stateful (maintain a state of the world in memory). Furthermore, players are connected to a specific game session located on a specific server instance (because of statefulness). We are in a situation of affinity.
Please note that databases have the same constraint. They are stateful (because they are storing documents) and when a client does a query, the query will be routed to an (or several) instance(s) that contain the documents returned by the query.
Stormancer is composed of several parts: The grid, the client libraries and the plugins.
The grid runs the game server of a game that uses Stormancer for its online functionalities. It's a distributed infrastructure composed of one or many identical nodes or instances that together form a cluster. In the cluster, services are allocated using configurable policies depending on their type. Whenever a client sends a message to a service, the grid is able to locate it using the same policie then route the message to it. The grid is designed for bidirectional client-server communications, with a preference for the UDP protocol.
The grid works in a similar way as distributed databases like MongoDB, Cassandra or Elasticsearch. but instead of storing documents on different nodes of the cluster, a Stormancer grid runs logic.
This architecture allows the creation of clusters of any size out of a single image, without application specific configuration in the server images themselves. The topology of the cluster (which server instance a service runs on) is decided at runtime according to a set of rules. If an instance goes down, the grid is able to recover by reallocating the services that were running on this node on another node.
The grid supports running several servers (applications) on the same cluster, and supports running different deployments of the same application side by side, as long as only one of them is the active one. This behaviors allows seamless server updates without service interruption, because player already connected to the old application version can still temporarly use it.
The grid manages the lifecycle of services, starting them lazily when a client tries to connect to it, and shuts them down after an inactivity timeout.
How does the grid work?
Our server platform is implemented as a distributed container system. Each server node can host several application nodes, and applications are segmented into several application nodes each one on a different server. Each node expose our web API and transport endpoints.
When a client application connects to Stormancer, a server node hosting the target server application is selected, the client connects to this node, the application node is started if necessary, and the servers route the client session and requests to the adequate application node. In the Stormancer platform, application startup is lazy, to make sure that resources are allocated to running applications. In the same way, inactive applications are shut down after an inactivity period.
Stormancer is designed to isolate each server application in its own process, and communicates with them using a shared memory protocol. This way, failure or misbehavior of a server app can't impact other applications.
Stormancer provides a set of client libraries for different platforms:
- C# with or without Unity3D
- C++ with or without Unreal Engine 4
Stormancer use a custom network engine and protocols that are implemented by the client libraries. These libraries provide an high level generic, object oriented` and fully non blocking abstraction layer on top of the protocols.
It is responsible of:
- Connectivity management
- Message routing
- Scene lifecycle management.
- P2P connectivity
Plugins are sets of high level functionalities that typically contain a client and a server component. They use the extensibility features of the client and server libraries to hide the inherent complexities of working with the lower level abstractions of Stormancer.
Plugins built by the Stormancer team follow a set of patterns and good practices designed to facilitate development, provide extensibility and improve robustness against network failures.
Most plugins provide Unreal engine specific wrappers and Blueprint nodes.
Stormancer uses a cross platform network engine optimized for performance. It handles all the complexity of establishing connectivity between different devices, whether mobile, web or desktop based. To do that, it currently implements two transports and is modular enough to accomodate new ones when new technologies become available.
• UDP through the Raknet network engine. Raknet is a reference in the gaming industry, powering many games. It's a proven and stable technology, now available as open source. Raknet provides the best set of capabilities for Stormancer, and is our "reference transport". It provides reliable & not reliable messaging, prioritization and packet ordering.
• TCP through websockets for the platforms without raknet support. websockets provide efficient realtime communication capabilities from an HTTP connection. It's essentially TCP with an HTTP handshake. It's fast enough for a lot of applications (many games run using TCP based protocols). However, TCP only supports reliable messaging, which may result in network contention if the connectivity is not good enough, or if too many messages accumulate.
Stormancer is built from the ground up for the cloud. When we started the project, we had several core objectives.
The first was scalability, making sure that developers using the tools would be able to build great scalable multiplayer games. The core hosting infrastructure is a distributed system able to host your games transparently on several servers, according to your configuration. When developing games for Stormancer, you just don't have to care about synchronizing servers or load balancing your game sessions.
The second was customization & flexibility. Stormancer is a solution to run your code. We are quite fond of the work made on modern cloud web hosting platforms, so we’ve taken some of our inspiration from them. Deployment is always a few keystrokes away, then rollback securely if something goes wrong. We handle everything to make sure it happens smoothly.
The last was security. All the applications are isolated. Stormancer nodes (hosting apps) are isolated too, and all the network communication between your app and the exterior are filtered by the distributed platform. The web API themselves and the websocket communications are secured through SSL and symmetric key authentication.