Azure Gaming Samples

There are many samples that demonstrate a variety of gaming scenarios using Azure. We have collected some of these samples below.

Scavenger

Get the source

Scavenger is a virutal scavenger hunt game written in Unity. Each day players are presented with a list of items to take a photo of. If the Computer Vision API determines the photo contains the required object, a point is awarded. The game demonstrates usage of various Azure services:

For more information, check out the linked GitHub repo, and watch the session recording from Build.

Multiplayer Scaling with Azure Container Instances

Get the source

This project allows you to manage Docker containers running on Azure Container Instances. Suppose that you want to manage a series of running Docker containers. These containers may be stateful, so classic scaling methods (via Load Balancers etc.) would not work. A classic example is multiplayer game servers, where its server has its own connections to game clients, its own state etc. Another example would be batch-style projects, where each instance would have to deal with a separate set of data. For these kind of purposes, you would need a set of Docker containers being created on demand and deleted when their job is done and they are no longer needed in order to save costs.

For more information, check out the linked GitHub repo, and watch the session recording from Build.

Multiplayer Scaling with Kubernetes

Get the source

Scaling dedicated game servers is hard. They're stateful, can't (well, shouldn't) be explicitly shut down (since players might be still enjoying their game) and, as a rule of thumb, their connection with the players must be of minimal latency, especially for real-time games. This sample aims to provide a solution/guidance for managing containerized dedicated game servers on Azure Platform using the managed Azure Kubernetes Service (AKS).

Leaderboards with Azure Functions, Node, and Cosmos DB

Get the source

This project is a starter kit that allows you to set up a RESTful API service that stores game leaderboards (scores) and exposes them via HTTP(s) methods/operations. A game developer can use this API service in their game and post new scores, get the top scores, find out the latest ones and more. Additionally, a Unity sample client is included in the project.

The technology/architecture stack includes an Express Node.js app hosted on an Azure Function that talks to a Cosmos DB database via its MongoDB API. Azure Application Insights service is used to provide information and metrics regarding application performance and behavior. A Unity game engine client is also provided, with a relevant Unity C# SDK to access the leaderboards API.

You can check the source code and the relevant documentation on GitHub and read the relevant blog post here.

Analytics with Event Hubs, Azure Functions, Cosmos DB, and Datalake

Get the source

A simple architecture to consume and process messages coming from video game clients (or servers) using the following Azure services: