• Stars
    star
    1,595
  • Rank 29,332 (Top 0.6 %)
  • Language
    C#
  • License
    Other
  • Created about 4 years ago
  • Updated about 1 month ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A small-scale cooperative game sample built on the new, Unity networking framework to teach developers about creating a similar multiplayer game.

Banner

Boss Room: a Co-op, Multiplayer RPG Sample

Made with and Including Utilities for Netcode for GameObjects


UnityVersion NetcodeVersion LatestRelease

Boss Room is a fully functional co-op multiplayer RPG made with Unity Netcode. It is an educational sample designed to showcase typical netcode patterns that are frequently featured in similar multiplayer games.

Boss Room Sample Overview

Boss Room is designed to be used in its entirety to help you explore the concepts and patterns behind a multiplayer game flow; such as character abilities, casting animations to hide latency, replicated objects, RPCs, and integration with the Relay, Lobby, and Authentication services.

You can use the project as a reference starting point for your own Unity game or use elements individually.


πŸ’‘ Utilities Package

This repository also contains a Utilities package, containing reusable sample scripts. You can install it using the following manifest file entry:
"com.unity.multiplayer.samples.coop": "https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git?path=/Packages/com.unity.multiplayer.samples.coop",



For more information on the art of Boss Room, see ART_NOTES.md.




Readme Contents and Quick Links

Click to expand/collapse contents


Getting the project

Direct download

  • You can download the latest version of Boss Room from our Releases page.
  • Alternatively: click the green Code button and then select the 'Download Zip' option. Please note that this will download the branch that you are currently viewing on Github.
  • Windows users: Using Windows' built-in extraction tool may generate an "Error 0x80010135: Path too long" error window which can invalidate the extraction process. A workaround for this is to shorten the zip file to a single character (eg. "c.zip") and move it to the shortest path on your computer (most often right at C:\) and retry. If that solution fails, another workaround is to extract the downloaded zip file using 7zip.

Requirements

BossRoom is compatible with the latest Unity Long Term Support (LTS) editor version, currently 2022 LTS. Please include standalone support for Windows/Mac in your installation.

PLEASE NOTE: You will also need Netcode for Game Objects to use these samples. See the Installation Documentation to prepare your environment. You can also complete the Get Started With NGO tutorial to familiarize yourself with Netcode For Game Objects.

Boss Room has been developed and tested on the following platforms:

  • Windows
  • Mac
  • iOS
  • Android

Boss Room's min spec devices are:

  • iPhone 6S
  • Samsung Galaxy J2 Core

Installing Git LFS to clone locally

Boss Room uses Git Large Files Support (LFS) to handle all large assets required locally. See Git LFS installation options for Windows and Mac instructions. This step is only needed if cloning locally. You can also just download the project which will already include large files.

Opening the project for the first time

Once you have downloaded the project, follow the steps below to get up and running:

  • Check that you have installed the most recent LTS editor version.

    • Include standalone support for Windows/Mac in your installation.
  • Add the project to the Unity Hub by clicking on the Add button and pointing it to the root folder of the downloaded project.

    • Please note : the first time you open the project Unity will import all assets, which will take longer than usual.
  • Hit the Play button. You can then host a new game or join an existing one using the in-game UI.




Exploring the project

BossRoom is an eight-player co-op RPG game experience, where players collaborate to fight imps, and then a boss. Players can select between classes that each have skills with didactically interesting networking characteristics. Control model is click-to-move, with skills triggered by a mouse button or hotkey.

One of the eight clients acts as the host/server. That client will use a compositional approach so that its entities have both server and client components.

  • The game is server-authoritative, with latency-masking animations.
  • Position updates are carried out through NetworkTransform that sync position and rotation.

Code is organized in domain-based assemblies. See the Boss Room architecture documentation file for more details.

Registering the project with Unity Gaming Services (UGS)

Boss Room leverages several services from UGS to facilitate connectivity between players. To use these services inside your project, you must create an organization inside the Unity Dashboard, and enable the Relay and Lobby services. Otherwise, you can still use Boss Room without UGS.


Testing multiplayer

In order to see the multiplayer functionality in action we can either run multiple instances of the game locally on your computer - using either ParrelSync or builds - or choose to connect to a friend over the internet. See how to test for more info.

Local multiplayer setup

First, build an executable by clicking 'File/Build Settings' in the menu bar, and then click 'Build'.

Once the build has completed you can launch several instances of the built executable in order to both host and join a game. When using several instances locally, you will have to set different profiles for each instance for authentication purposes, by using the 'Change Profile' button.


πŸ’‘ Mac users: To run multiple instances of the same app, you need to use the command line. Run open -n BossRoom.app



Multiplayer over Internet

To play over internet, first build an executable that is shared between all players - as above.

It is possible to connect between multiple instances of the same executable OR between executables and the editor that produced it.

Running the game over internet currently requires setting up a relay.

Relay Setup

  • Boss Room provides an integration with Unity Relay. You can find our Unity Relay setup guide here

  • Alternatively you can use Port Forwarding. The https://portforward.com/ site has guides on how to enable port forwarding on a huge number of routers.

  • Boss Room uses UDP and needs a 9998 external port to be open.

  • Make sure your host's address listens on 0.0.0.0 (127.0.0.1 is for local development only).



Index of resources in this project

Click to expand/collapse contents

Gameplay

Game Flow

Connectivity

Services (Lobby, Relay, etc)

Tools and Utilities



Troubleshooting

Bugs

Documentation

For a deep dive into Unity Netcode and Boss Room, visit our documentation site.

License

Boss Room is licensed under the Unity Companion License. See LICENSE.md for more legal information.

For a deep dive in Unity Netcode and Boss Room, visit our docs site.

Contributing

We welcome your contributions to this sample code and objects. See our contribution guidelines for details.

Our projects use the git-flow branching strategy:

  • our develop branch contains all active development
  • our main branch contains release versions

To get the project on your machine you need to clone the repository from GitHub using the following command-line command:

git clone https://github.com/Unity-Technologies/com.unity.multiplayer.samples.coop.git

PLEASE NOTE: You will need to have Git LFS installed on your local machine in order to clone our repo.

Community

For help, questions, networking advice, or discussions about Netcode for GameObjects and its samples, please join our Discord Community or create a post in the Unity Multiplayer Forum.

Feedback Form

Thank you for cloning Boss Room and taking a look at the project. To help us improve and build better samples in the future, please consider submitting feedback about your experiences with Boss Room and let us know if you were able to learn everything you needed to today. It'll only take a couple of minutes. Thanks!

Enter the Boss Room Feedback Form

Other samples

Bite-size Samples

  • The Bitesize Samples repository is currently being expanded and contains a collection of smaller samples and games, showcasing sub-features of NGO. You can review these samples with documentation to understand our APIs and features better.

Documentation Forums Discord

More Repositories

1

ml-agents

The Unity Machine Learning Agents Toolkit (ML-Agents) is an open-source project that enables games and simulations to serve as environments for training intelligent agents using deep reinforcement learning and imitation learning.
C#
16,946
star
2

UnityCsReference

Unity C# reference source code.
C#
10,410
star
3

EntityComponentSystemSamples

C#
7,135
star
4

FPSSample

A first person multiplayer shooter example project in Unity
C#
4,864
star
5

PostProcessing

Post Processing Stack
C#
3,665
star
6

arfoundation-samples

Example content for Unity projects based on AR Foundation
C#
3,040
star
7

NavMeshComponents

High Level API Components for Runtime NavMesh Building
C#
3,008
star
8

BoatAttack

Demo Project using the Universal RP from Unity3D
C#
2,534
star
9

Graphics

Unity Graphics - Including Scriptable Render Pipeline
C#
2,504
star
10

com.unity.netcode.gameobjects

Netcode for GameObjects is a high-level netcode SDK that provides networking capabilities to GameObject/MonoBehaviour workflows within Unity and sits on top of underlying transport layer.
C#
2,138
star
11

AssetBundles-Browser

Editor tool for viewing and debugging asset bundle contents before and after builds
C#
1,940
star
12

UniversalRenderingExamples

This project contains a collection of Custom Renderer examples. This will be updated as we refine the feature and add more options.
C#
1,923
star
13

VolumetricLighting

Lighting effects implemented for the Adam demo: volumetric fog, area lights and tube lights
C#
1,576
star
14

Unity-Robotics-Hub

Central repository for tools, tutorials, resources, and documentation for robotics simulation in Unity.
C#
1,544
star
15

AutoLOD

Automatic LOD generation + scene optimization
C#
1,534
star
16

VisualEffectGraph-Samples

Visual Effect Graph - Samples Project
C#
1,498
star
17

InputSystem

An efficient and versatile input system for Unity.
C#
1,428
star
18

game-programming-patterns-demo

A repo of small demos that assemble some of the well-known design patterns in Unity development to support the ebook "Level up your code with game programming patterns"
C#
1,427
star
19

2d-extras

Fun 2D Stuff that we'd like to share!
C#
1,387
star
20

Animation-Instancing

This technique is designed to instance Characters(SkinnedMeshRender).
C#
1,366
star
21

Unity.Mathematics

The C# math library used in Unity providing vector types and math functions with a shader like syntax
C#
1,354
star
22

multiplayer

Unity multiplayer packages and samples
1,328
star
23

UnityRenderStreaming

Streaming server for Unity
C#
1,306
star
24

DOTS-training-samples

Samples designed as exercises to be ported from Unity GameObjects/MonoBehaviours to Unity DOTS.
C#
1,281
star
25

Addressables-Sample

Demo project using Addressables package
C#
1,277
star
26

ShaderGraph

Unity ShaderGraph project
C#
1,154
star
27

AssetGraph

Visual Workflow Automation Tool for Unity.
C#
1,088
star
28

XR-Interaction-Toolkit-Examples

This repository contains various examples to use with the XR Interaction Toolkit
C#
1,068
star
29

FontainebleauDemo

Fontainebleau demo
C#
947
star
30

uGUI

Source code for the Unity UI system.
C#
937
star
31

DOTSSample

A third person, multiplayer sample project. Built with Unity and using the new Data Oriented Tech Stack (DOTS).
C#
932
star
32

EditorXR

Author XR in XR
C#
925
star
33

SpaceshipDemo

Spaceship Demo - AAA Playable First person demo showcasing effects made with Visual Effect Graph and rendered with High Definition Render Pipeline
C#
916
star
34

VFXToolbox

Additional tools for Visual Effect Artists
C#
909
star
35

2d-techdemos

Tech Demos for Unity 2D Features
C#
881
star
36

ProjectTinySamples

Samples for Project Tiny
C#
880
star
37

HLODSystem

C#
844
star
38

ProjectAuditor

Project Auditor is an experimental static analysis tool for Unity Projects.
C#
815
star
39

UnityPlayground

A collection of simple scripts to create 2D physics game, intended for giving workshops to a young audience
C#
806
star
40

com.unity.formats.alembic

Alembic importer and exporter plugin for Unity
C#
786
star
41

HLSLcc

DirectX shader bytecode cross compiler
C++
770
star
42

com.unity.webrtc

WebRTC package for Unity
Assembly
753
star
43

giles

GILES: A Runtime Level Editor for Unity3D
C#
743
star
44

com.unity.perception

Perception toolkit for sim2real training and validation in Unity
C#
734
star
45

BackgroundDownload

Plugins for mobile platforms to enable file downloads in background
C#
721
star
46

UniteAustinTechnicalPresentation

C#
721
star
47

com.unity.demoteam.hair

An integrated solution for authoring / importing / simulating / rendering strand-based hair in Unity.
C#
712
star
48

SuperScience

Gems of Unity Labs for our user-base.
C#
711
star
49

com.unity.multiplayer.docs

Open Source documentation for Unity Multiplayer, which includes Netcode for GameObjects, the Unity Transport Package, Multiplayer Tools and Educational references and Sample Games such as Boss Room.
JavaScript
634
star
50

NativeRenderingPlugin

C++ Rendering Plugin example for Unity
C
633
star
51

guid-based-reference

A component for giving Game Objects a GUID and a class to create references to objects in any Scene by GUID
C#
615
star
52

uaal-example

Objective-C++
605
star
53

com.unity.uiwidgets

UIWidgets is a Unity Package which helps developers to create, debug and deploy efficient, cross-platform Apps.
C#
603
star
54

Standard-Assets-Characters

Unity Standard Asset Controllers
C#
602
star
55

megacity-metro

Megacity-Metro: a thrilling shooter game, using Netcode for Entities for a multiplayer experience supporting 128+ players. Latest DOTS packages and Unity Gaming Services elevate the user experience, demonstrating how to craft engaging multiplayer games.
C#
567
star
56

barracuda-release

C#
565
star
57

MeshApiExamples

Example project for Unity 2020.1 Mesh API improvements
C#
558
star
58

unity-cache-server

Unity CacheServer optimized for multi-client local networks
JavaScript
554
star
59

SimpleAnimation

A simple Animation Component that leverages PlayableGraphs
C#
539
star
60

GenericFrameRecorder

This GitHub package is DEPRECATED. Please get the new Unity Recorder from the Asset Store (https://assetstore.unity.com/packages/essentials/unity-recorder-94079) Use the editor builtin Bug Reporter to report issues. You can track and vote for issues on the Issue Tracker (https://issuetracker.unity3d.com)
C#
533
star
61

obstacle-tower-env

Obstacle Tower Environment
Python
532
star
62

graph-visualizer

Visualizer for your Playable graphs
C#
522
star
63

DeLightingTool

De-Lighting tool
C#
518
star
64

com.unity.demoteam.digital-human

Library of tech features used to realize the digital human from 'The Heretic' and 'Enemies'.
C#
517
star
65

PhysicsExamples2D

Examples of various Unity 2D Physics components and features.
C#
512
star
66

com.unity.cinemachine

Smart camera tools for passionate creators
C#
503
star
67

usd-unity-sdk

Integration of Pixar's Universal Scene Description into Unity. UPDATE: This package has been superseded by our new bundle of USD packages. Please see README & link below for further details.
C#
498
star
68

arfoundation-demos

AR Foundation demo projects
C#
494
star
69

facial-ar-remote

**This project is discontinued** Facial AR Remote is a tool that allows you to capture blendshape animations directly from your iPhone X into Unity 3d by use of an app on your phone.
C#
482
star
70

animation-jobs-samples

Code samples using the animation C# jobs feature.
C#
464
star
71

vscode-unity-debug

Unity debugging support for VS Code
C#
459
star
72

MeshSyncDCCPlugins

DCC plugins for MeshSync in Unity. Supported tools: Maya, Maya LT, 3ds Max, Motion Builder, Modo, Blender, Metasequoia
C++
438
star
73

UIElementsExamples

Unity project containing examples to use UIElements in the Editor
C#
436
star
74

Unity.Animation.Samples

Repository of projects that showcase the new DOTS animation package (com.unity.animation).
C#
419
star
75

com.unity.demoteam.mesh-to-sdf

A light and fast real-time SDF generator, primarily for animated characters. The dynamic SDF can be used for all sorts of VFX. Also enables hair-to-character collisions in the new hair package.
C#
402
star
76

MeasuredMaterialLibraryURP

HLSL
377
star
77

BatchBreakingCause

This project demonstrates different cases when Unity has to break a batch while rendering.
GLSL
355
star
78

MeasuredMaterialLibraryHDRP

C#
355
star
79

UIToolkitUnityRoyaleRuntimeDemo

This is a sample project to introduce the use of UI Toolkit in Runtime
C#
351
star
80

UnityDataTools

Experimental tools and libraries for reading and analyzing Unity data files.
C#
328
star
81

HDRPRayTracingScenes

This repository contains a startup DXR project.
327
star
82

SynthDet

SynthDet - An end-to-end object detection pipeline using synthetic data
C#
324
star
83

EndlessRunnerSampleGame

Repository for the Endless Runner Game Sample (Trash Dash)
C#
324
star
84

boat-attack-water

Package repo containing the water system created for the URP Boat Attack demo project.
C#
318
star
85

BuildReportInspector

Editor script which implements an inspector for the BuildReport class
C#
317
star
86

multiplayer-community-contributions

Community contributions to Unity Multiplayer Networking products and services.
C#
316
star
87

com.unity.services.samples.use-cases

The collection of samples in this repo use Unity Gaming Services in a Unity project to demonstrate live gaming operations.
C#
312
star
88

com.unity.probuilder

C#
305
star
89

XRLineRenderer

An XR-Focused line renderer that mimics rendering with 3d capsules while only using two quads worth of geometry.
C#
299
star
90

com.unity.demoteam.digital-human.sample

Character sample featuring the digital human from 'The Heretic'.
C#
298
star
91

VRAlchemyLab

VR Demo project using HDRP and unity 2019.3
C#
283
star
92

marathon-envs

A set of high-dimensional continuous control environments for use with Unity ML-Agents Toolkit.
C#
279
star
93

articulations-robot-demo

C#
278
star
94

NotificationsSamples

Sample project for Unity Notifications
C#
265
star
95

SkyboxPanoramicShader

Skybox shader for support of 360/180/cubemap video and static content
ShaderLab
265
star
96

PeopleSansPeople

Unity's privacy-preserving human-centric synthetic data generator
C#
261
star
97

Robotics-Object-Pose-Estimation

A complete end-to-end demonstration in which we collect training data in Unity and use that data to train a deep neural network to predict the pose of a cube. This model is then deployed in a simulated robotic pick-and-place task.
Python
250
star
98

ECS-Network-Racing-Sample

ECS multiplayer racing sample to showcase using Unity Entities and netcode with best practices
C#
248
star
99

2d-pixel-perfect

Pixel Perfect Camera
C#
244
star
100

ShaderGraph-Custom-Lighting

A sample project showcasing a simple method to calculate custom lighting inside of Shader Graph for the Lightweight Render Pipeline. Includes a sample toon shaded scene and example assets. Built for Unity 2019.2 .
Mathematica
244
star