How we built and scaled our CS2 Match API to 2000+ matches in 24 hours
Managing game servers at scale is hard. You need to consider things such as image build, testing and infrastructure elements like networking and storage not to mention strategies around resource allocation like CPU, RAM and disk. All before you've even had a single player connect to your server.
Background
Platforms increasingly want to concentrate on their unique offerings to their users, not on creating, maintaining and managing server hardware and infrastructure.
During the private beta of OGH Cloud we had a platform enquire about how we could empower them to do just that - they were using a mixture of their own servers/hardware and some hosting provided game servers, but they weren't happy with the reliability and quality of service they were receiving - not to mention the price they're paying!
These problems align perfectly with the core reasons we came together to build the Open Game Hosting ecosystem, our vision that a gamer should be able to spin up a game server with a single command - ready in "one click".
We were approached with a similar challenge - how can a competitive game provider (case study coming soon!) have a similar "one click" experience?
Introducing the CS2 Match API
We were given a challenge - to have a working prototype ready for "real" games ready ASAP. This meant we would have to lean on our existing infrastructure as much as possible, as well as the fantastic community around CS2 plugin development.
After careful consideration, we chose the MatchZy plugin from Shobhit Pathak (and contributors) as the base of our CS2 Match engine. This plugin was built upon the original Get5 plugin by splewis (splewis/get5) - which at a time was the gold standard for CSGO scrim/pug match setup plugins.
Leveraging our highly flexible infrastructure, we created a Match API for CS2 which allows you to provide your match config, and everything else around provisioning the gameserver β¨ just works β¨.
We built all of this and ran some scaling tests in less than 24 hours. With around 2000 concurrent matches on our platform, across multiple different regions, we were still able to provision new matches in less than 30 seconds.
This provides the same guarentees around scalability and reliabiulity as all of our other OGH services, meaning you can focus on your platform and you dont have to worry about ours.
How can you use the CS2 Match API?
Although their surrounding logic and infrastructure is more complex, you can get started with a CS2 Match using our Match API in one simple command:
curl -X POST -d '{
"game": "cs2",
"version": "latest",
"type": "scrim",
"config": {
"num_maps": 3,
"maplist": ["de_mirage", "de_overpass", "de_inferno"],
"map_sides": ["team1_ct", "team2_ct", "knife"],
"spectators": {
"players": {
"76561198264582285": "Anders Blume"
}
},
"clinch_series": true,
"players_per_team": 5,
"cvars": {
"hostname": "Scrim - powered by OGH.cloud and MatchZy"
}
}
}' "https://api.opengamehosting.cloud/v1/matches"
Our scheduler creates the gameserver, allocates the network/storage/disk and installs the gameserver to the specific version (did we mention we can support on-site game servers for LAN providers?) - all in under 30 seconds. This eliminates the complexity of managing the game server infrastructure and lets you be sure that you have a reliable way to launch games with a chosen configuration, and focus on the thing that matters to you - in their case, their own product.
Since our Match API is powered by the OGH cloud infrastructure, meaning you have the same flexibility for deployment location, resources (although our Match API actually provides flexible resources at no extra charge) and configuration.
You have scalability and flexibility where it matters, whether you are spinning up scrims for your team to face off against others, or whether you run a matchmaking platform with thousands of active users. We have you covered.
Once your Match has been provisioned, you can interact with your gameserver in the same way you would normally would on our platform, upload custom files/plugins/mods and send commands. Your match can fit right into your existing tooling.
Match API Roadmap
We will be laying out our roadmap for the Match API in the near future, including which other games we will support in the future. Our CS2 Match API is implemented with a layer of abstraction that allows us to deliver a consistent API experience across multiple games, so if you're a platform which provides matchmaking across multiple titles - get in touch, we'd love to talk!
We'll be contributing back to the development of the open source tooling that makes our platform possible - so any feature improvements or requests you have, send them our way!
If you would like to discuss the Match API or you have a use-case for custom platforms like it, please let us know at hello@opengamehosting.cloud
Thanks
The OGH Team πΎπ