Skip to content

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

License

Notifications You must be signed in to change notification settings

flarePL/BossRoom

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Banner

Co-op multiplayer RPG and utilities built with Unity Netcode for GameObjects

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.

PLEASE NOTE: Boss Room is compatible with the latest Unity Long Term Support (LTS) editor version, currently 2021 LTS. Please include standalone support for Windows/Mac in your installation.

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

Find our full project documentation, here.

To connect and find support, join the multiplayer community on the Unity Discord and Forum.
Got feedback? Tell us what you think using our new Feedback Form .

Contents and Quick Links

Boss Room 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.

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.

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.

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.

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.

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.

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

Gameplay

Game Flow

Connectivity

Services (Lobby, Relay, etc)

Tools and Utilities

Troubleshooting

Bugs
Report bugs in Boss Room using Github issues Report NGO bugs using NGO Github issues Report Unity bugs using the Unity bug submission process.

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

Licence.

Boss Room is licenced under the Unity Companion Licence. See LICENSE.md for more legal information.

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

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.

Contributing

Please check out CONTRIBUTING.md for full guidelines on submitting issues and PRs to BossRoom.

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

IMPORTANT: You should have Git LFS installed on your local machine.

Please check out CONTRIBUTING.md for guidelines on submitting issues and PRs to BossRoom!

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 89.6%
  • ShaderLab 8.4%
  • HLSL 1.6%
  • Other 0.4%