All Projects → markmandel → Paddle Soccer

markmandel / Paddle Soccer

Licence: apache-2.0
A simple, two player multiplayer game built to show how you can host dedicated game servers on Kubernetes.

Projects that are alternatives of or similar to Paddle Soccer

09 Zombierunner Original
First person shooter with Unity terrain and AI pathfinding (http://gdev.tv/cudgithub)
Stars: ✭ 64 (-54.61%)
Mutual labels:  unity3d, game-development
1 Character Movement
The first section of the course. You will learn everything required to build a simple movement system in your RPG, creating the core experience. http://gdev.tv/rpggithub
Stars: ✭ 81 (-42.55%)
Mutual labels:  unity3d, game-development
3d Game Shaders For Beginners
🎮 A step-by-step guide to implementing SSAO, depth of field, lighting, normal mapping, and more for your 3D game.
Stars: ✭ 11,698 (+8196.45%)
Mutual labels:  unity3d, game-development
Ksframework
QQ Group:538722494,KSFramework = KEngine + SLua(or xLua) , Unity3D Framework/Toolsets focus on hot reload
Stars: ✭ 1,119 (+693.62%)
Mutual labels:  unity3d, game-development
Reflexityai
Provide a basic framework to build an Utility IA in Unity using the xNode editor of Siccity
Stars: ✭ 109 (-22.7%)
Mutual labels:  unity3d, game-development
Unity Scene Query
A library to traverse and query the Unity scene to find particular objects, uses something similar to CSS selectors to identify game objects.
Stars: ✭ 63 (-55.32%)
Mutual labels:  unity3d, game-development
Rocket.unturned
Unturned 3 implementation of the RocketMod — .NET Game Server Plugin Framework
Stars: ✭ 73 (-48.23%)
Mutual labels:  unity3d, game-development
Documentation
Online documentation and tracking tools for Naninovel — writer-friendly visual novel engine
Stars: ✭ 48 (-65.96%)
Mutual labels:  unity3d, game-development
Dotgame
.GAME is a show hosted on Channel 9 that is dedicated to game development with a primary focus on .NET technology. Each episode will focus on tutorials, cover helpful tips/tricks, or feature an interview with an industry expert.
Stars: ✭ 107 (-24.11%)
Mutual labels:  unity3d, game-development
Arcadevehiclephysics
A framework for creating an arcade inspired physics system for vehicles in Unity
Stars: ✭ 103 (-26.95%)
Mutual labels:  unity3d, game-development
Unity3d Ai And Procedural Generation Framework
Unity3D AI and Procedural Generation Framework.
Stars: ✭ 58 (-58.87%)
Mutual labels:  unity3d, game-development
O2
2D Game Engine with visual WYSIWYG editor
Stars: ✭ 121 (-14.18%)
Mutual labels:  unity3d, game-development
X Postprocessing Library
Unity Post Processing Stack Library | Unity引擎的高品质后处理库
Stars: ✭ 1,079 (+665.25%)
Mutual labels:  unity3d, game-development
3 Modifiers And Abilities
Customise character abilities, weapons, characters and enemies. This includes multiple damage types, modifiers, sounds, animations. By the end you can create your core combat experience. (REF MA_RPG) http://gdev.tv/rpggithub
Stars: ✭ 64 (-54.61%)
Mutual labels:  unity3d, game-development
Factory
Factory for object creation and dependency injection. Works with normal C# apps or under Unity3d
Stars: ✭ 50 (-64.54%)
Mutual labels:  unity3d, game-development
Unity3d Simple Mobile Joystick
Mobile Joystick suitable for any types of game
Stars: ✭ 68 (-51.77%)
Mutual labels:  unity3d, game-development
C Sharp Promise
Promises library for C# for management of asynchronous operations.
Stars: ✭ 870 (+517.02%)
Mutual labels:  unity3d, game-development
Beaverandfairies
Stars: ✭ 14 (-90.07%)
Mutual labels:  unity3d, game-development
Bright Souls
An indie "Dark Souls" clone in Unity with Adaptive Game Technology.
Stars: ✭ 91 (-35.46%)
Mutual labels:  unity3d, game-development
Gdk For Unity Fps Starter Project
SpatialOS GDK for Unity FPS Starter Project
Stars: ✭ 119 (-15.6%)
Mutual labels:  unity3d, game-development

Paddle Soccer

A simple, two player multiplayer game built to show how you can host dedicated game servers on Kubernetes.

It has been implemented using Unity for the game client and dedicated game server, and Go for the backend service components that sit on top of Kubernetes.

Screenshot

Overview

Game servers are started up as a Pod on request through the Kubernetes API, and configured to use Host Networking, to avoid any network latency issues through a Load Balancer. The Game Servers start on a random port between a given range (defaults to 2000-3000), and then register themselves against a custom API with their Pod name for later lookup.

Once the game server has started, we use the combination of the Kubernetes API and the aforementioned custom port registry to determine which node in the Kubernetes cluster the Pod has been scheduled on, that node's external IP and what port the game server is open on. This is then pass that back to the game client, through a match maker or otherwise, so that they can connect to it directly.

Blog Posts

Presentations

GCAP Australia
GDC

Unity Structure

The unity source code can be found in the unity folder.

It was built with Unity 5.6.0. It was built on Linux, but the client should run on any OS.

To quickly make the Client and Server builds (for Linux), you can run the Build Pipeline under the Build > Build Game and Server menu

Once the server infrastructure has been configured, you can start the game with a -match command line argument, to tell it where the matchmaker is. For example:

./Game.x86_64 -match "http://10.32.14.10" -logFile /dev/stdout

Server

All the non-Unity server side code is found in the server folder.

Infrastructure

This project works on Kubernetes 1.6.0 or higher, as it uses Kubernetes Node Affinity.

If you have a Google Cloud Platform Project configured and the Google Cloud SDK installed, you can cd into the infrastructure folder, and run make deploy to deploy a 4 node cluster over 2 nodepools, as well as the accompanying firewall rules. make auth will authenticate your local kubectl tooling with this cluster.

Node Pools

  • There are two Node Pools withing this cluster.
    • "apps" (Node Selector role=apps) - which is the area in which Sessons, Matchmaker and Nodescaler all run, so as to keep application separate from the game servers, and not have them impact CPU performance.
    • "game-servers" (Node Selector role=game-servers) - for which game servers will be exclusively run on, and for ease of autoscaling.

Game Server

The game-server folder contains Dockerfile for the Unity dedicated server. To build the server, and the image (on Linux) run make build and then make push to push the image up to Container Registry for use.

Sessions

The sessions folder contains the Go application manages the HTTP API that creates new instances of the Unity Game Server within a Pod. It also hosts the HTTP API the that Game Server connects to to register the port that it currently runs on, with the podname is it provided through an Environment variable.

To build the code for the Docker image and push the image up to the Container Registry, run make build push. To deploy, run make deploy-all and it will deploy the Redis Stateful Set, and the Kubernetes Deployment and accompanying Service.

Matchmaker

The matchmaker folder contains a Go application that is a very simple HTTP based matchmaker that pairs the first two players that request a game in FIFO order. It coordinated with the session manager to start game servers, and inspect what IP and port they are running on, so it can be passed back to the client.

To build the code for the Docker image and push the image up to the Container Registry, run make build push. To deploy, run make deploy-all and it will deploy the Redis Stateful Set, and the Kubernetes Deployment and accompanying Service.

NodeScaler

The nodescaler folder contains a Go application that tracks resource usage within the game-server node pool and increases the number of nodes if the amount of CPU space available falls below a certain buffer value. Once the buffer is exceeded, the node scaler will first cordon nodes that have game servers still running on them, and then eventually delete them once they are empty of running dedicated game servers.

Currently only implemented to work on Google Cloud Platform, through its Container Engine API and Compute Engine Instance Group Manager API, but has been written for extension if required.

To build the code for the Docker image and push the image up to the Container Registry, run make build push. To deploy, run make deploy-all and it will deploy the Kubernetes Deployment for this.

Licence

Apache 2.0

This is not an official Google product.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].