Coder Social home page Coder Social logo

cmlewis89 / com.unity.multiplayer.samples.coop Goto Github PK

View Code? Open in Web Editor NEW

This project forked from unity-technologies/com.unity.multiplayer.samples.coop

0.0 1.0 0.0 8.2 MB

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

Home Page: https://docs-multiplayer.unity3d.com/

License: Other

C# 87.30% ShaderLab 10.69% HLSL 2.00%

com.unity.multiplayer.samples.coop's Introduction

Banner

Boss Room - Co-op multiplayer RPG built with Unity Netcode for GameObjects

Solutions architects are available on Discord and forums to help you work through issues you may encounter when using Boss Room.

Boss Room is a fully functional co-op multiplayer RPG made with Unity Netcode. It is built to serve as an educational sample that showcases certain typical gameplay patterns that are frequently featured in similar networked games.

You can use everything in this project as a starting point or as bits and pieces in your own Unity games. The project is licensed under the Unity Companion License. See LICENSE.md for more legal information.

See ART_NOTES.md for more information on the art of Boss Room.

IMPORTANT:

  • Boss Room has been developed and tested on these Platforms (Windows, Mac, iOS, and Android).
    • Tested on iPhone 6 and Pixel 3.
  • Boss Room is compatible with the latest Unity LTS version.
  • Make sure to include standalone support for Windows/Mac in your installation.

Getting the project

  • The pre-release version can be downloaded from the Releases page.
  • Alternatively: click the green Code button and then choose to download the zip archive. Remember, that you would download the branch that you are currently viewing in Github.
  • For Windows users: Using Windows' built-in extracting tool may generate a "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

This project uses Git Large Files Support (LFS), which ensures all large assets required locally are handled for the project. See Git LFS installation options for Windows and Mac instructions.

Opening the project for the first time

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

  • Make sure you have installed the version of Unity that is listed above in the prerequisites section.
    • Make sure to include standalone support for Windows/Mac in your installation.
  • Add the project in Unity Hub by clicking on Add button and pointing it to the root folder of the downloaded project.
    • The first time you open the project Unity will import all assets, which will take longer than usual - it is normal.
  • Once the editor is ready, navigate to the Project window and open the Project/Startup scene.
  • From there you can click the Play button. You can host a new game or join an existing game using the in-game UI.

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 we need to build an executable.

To build an executable, press File/Build Settings in the menu bar, and then press Build.

Once the build has completed you can launch several instances of the built executable in order to both host and join a game.

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, we need to build an executable that is shared between all players. See the previous section.

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

Running the game over internet currently requires setting up a relay. Boss Room provides integrations with Unity Relay and Photon Transport for Netcode.

Checkout our Unity Relay setup guide here Checkout our Photon-Realtime 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).


Exploring the project

BossRoom is an eight-player co-op RPG game experience, where players collaborate to take down some minions, 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 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 done through NetworkedVars that sync position, rotation and movement speed. NetworkedVars and Remote Procedure Calls (RPC) endpoints are isolated in a class that is shared between the server and client specialized logic components. All game logic runs in FixedUpdate at 30 Hz, matching our network update rate.

Code is organized into three separate assemblies: Client, Shared and Server which reference each other when appropriate.

For an overview of the project's architecture please check out our ARCHITECTURE.md.


For a deep dive in Unity Netcode and Boss Room, visit our doc and Unity Multiplayer Resources sections.

Bite-size Samples

This repository contains a collection of bitesize sample projects and games that showcase different sub-features of NGO. You can review these samples with documentation to understand APIs and features better.

Contributing

The project uses the git-flow branching strategy, as such:

  • develop branch contains all active development
  • 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!

For further discussion points and to connect with the team, join us on the Unity Multiplayer Networking Discord Server - Channel #dev-samples

Discord

com.unity.multiplayer.samples.coop's People

Contributors

andrews-unity avatar arturonereu avatar ashwinimurt avatar briancoughlin avatar cgerritssf avatar chrispope avatar cosmin-b avatar dwoodruffsf avatar eheimburg avatar fernando-cortez avatar fjgal avatar fpaizsf avatar jdepuy avatar jilfranco-unity avatar lkrell avatar lplafontaineb avatar lukestampfli avatar nomishen avatar pdeschain avatar ryantwarner avatar samuelbellomo avatar sbeck3d avatar speedyr10 avatar unitygeorgeli avatar valere91 avatar valere91unity avatar wackoisgod avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.