Giter VIP home page Giter VIP logo

unity-technologies / com.unity.multiplayer.samples.coop Goto Github PK

View Code? Open in Web Editor NEW
1.5K 463.0 471.0 9.85 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# 89.86% ShaderLab 8.15% HLSL 1.53% Batchfile 0.02% Shell 0.03% Python 0.42%
mlapi unity3d unity multiplayer networking multiplayergames gamedev

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

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

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

Contributors

andrews-unity avatar arturonereu avatar bendoyon 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 morwennag avatar nomishen avatar pdeschain avatar ryantwarner avatar s-omeilia-unity avatar samuelbellomo avatar sbeck3d avatar thusspokenomad avatar unity-ptrottier avatar unitygeorgeli avatar valere91 avatar valere91unity avatar wackoisgod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

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

Local multiplayer

Hey I have problem when i try joing local multiplay server i tried hosting by editor and android build but every time i try joinn it lead to failed connection i

Timeout or Cancel button needed for join attempts.

You can get stuck on the 'Connecting Attempting to join...' section.
Needs a timeout variable or cancel button.

To reproduce:
Open game in Editor, change nothing, click join as a client (don't open a host).

Screenshot 2021-04-13 at 10 41 22

Gracefully handle "Trying to destroy object that doesn't exist".

Play the game with 2 players, within 30 seconds, 97+ yellow warnings can fill the console.
Have a check for it to prevent log spam.
Might be worrying for new users to see all that appear + log spam can cause lag on low end hardware, especially if the logs are not turned off and game is released, or open for long periods.

Screenshot 2021-04-13 at 11 06 06

WebGL build error

On switching the platform to WebGL, I unchecked Auto Graphics API in player settings.
After that the build gives some errors like:
1 - 'NetworkTransport' does not contain a definition for 'QueueMessageForSending'
2 - 'NetworkTransport' does not contain a definition for 'SendQueuedMessages'
3 -

UnityEditor.BuildPlayerWindow+BuildMethodException: 5 errors
  at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002be] in /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:190 
  at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in /Users/bokken/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:95 
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&) (at /Users/bokken/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:189)

Screenshots
Screenshot 2021-05-26 at 4 49 27 PM

Screenshot 2021-05-26 at 4 41 37 PM

Environment (please complete the following information):

  • OS: MacOS 10.15.7
  • Unity Version: 2020.3.9f1
  • BossRoom Version: 0.2.0

Unresponsive character select UI

Describe the bug
When two players, Alice and Bob join a game, character selections from either player don't work
(reproduced on the same machine, two instances, outside editor, Mac,)

To Reproduce
Steps to reproduce the behavior:
Alice selects Start
Alice selects Confirm
Bob selects Join
Bob select Join again to confirm
Alice picks Tank (second from the left)
Bob tries to click on the third character. No reaction from the UI.

Expected behavior
The third character should appear as selected

Screenshots
image
image

Environment (please complete the following information):

  • OS: Mac Os Catalina 10.15.7
  • Unity Version: 2020.2.7f1
  • BossRoom Version:
    commit 032d7a7 (HEAD -> release/v0.0.2, tag: v0.0.2-experimental, origin/release/v0.0.2)

Additional context
If Alice clicks "Ready", then, and only then does Bob selection start showing. See second screenshot.

CPU overhead due to Dispatcher.Dispatch()

Description
I've tried Boss Demo. I've got huge cpu overhead caused by *DispathFrame() in NetworkMetrics that causes much lower fps. At first stage I did not run profiler. I run it later to search for clues what's causing the problem.

To Reproduce
Steps to reproduce the behavior:

  1. Run game and watch statistics. Just stay at same place at the beginning of level
  2. Stop game
  3. Comment out Dispatcher.Dispatch() in NetworkMetrics
public void DispatchFrame()
{
    //Dispatcher.Dispatch();
    m_NumberOfMetricsThisFrame = 0;
}
  1. Run a game and compare statistics (be sure that Dispatch() is commented out)

Screenshots
https://cdn.discordapp.com/attachments/819614776165793852/936625306062704640/2022-01-27_16h34_53.png

Environment (please complete the following information):

  • Windows 10
  • Unity Version: 2021.2.8f1
  • BossRoom Version: tag: v1.0.1-pre,

Additional context
stats

Netcode for GameObjects 1.0.0.pre-10: 'No suitable method found to override' error for OnIsServerAuthoritatitive() for ClientNetworkTransform

I decided to update the version of Netcode for GameObjects on a project I'm working on from 1.0.0.pre-9 to 1.0.0.pre-10, and now this method is causing a compiler error:

Library\PackageCache\com.unity.multiplayer.samples.coop@2bbc9f1cc2\Utilities\Net\ClientAuthority\ClientNetworkTransform.cs(43,33): error CS0115: 'ClientNetworkTransform.OnIsServerAuthoritatitive()': no suitable method found to override

Looks like the rename of this method to OnIsServerAuthoritative in the base class is tbe the culprit, so this method will need to be renamed to fix that problem so it works on 1.0.0.pre-10.

Return to Menu throws nullref if host exits the game

Describe the bug

If all players lose, you get prompted to return to the menu - clicking 'return' throws a null exception if the host has left:

NullReferenceException: Before using the library you should call Init() and do not forget to call Shutdown() afterwards
MLAPI.Transports.UNET.RelayTransport.Disconnect (System.Int32 hostId, System.Int32 connectionId, System.Byte& error) (at Library/PackageCache/com.unity.multiplayer.mlapi@54393f36bf/Runtime/Transports/UNET/RelayTransport.cs:213)
MLAPI.Transports.UNET.UnetTransport.DisconnectLocalClient () (at Library/PackageCache/com.unity.multiplayer.mlapi@54393f36bf/Runtime/Transports/UNET/UnetTransport.cs:296)
MLAPI.NetworkingManager.StopClient () (at Library/PackageCache/com.unity.multiplayer.mlapi@54393f36bf/Runtime/Core/NetworkingManager.cs:572)
BossRoom.Visual.PostGameUI.OnMainMenuClicked () (at Assets/BossRoom/Scripts/Client/UI/PostGameUI.cs:85)
UnityEngine.Events.InvokableCall.Invoke () (at <42a5878ce129403083acccf18e43363f>:0)
UnityEngine.Events.UnityEvent.Invoke () (at <42a5878ce129403083acccf18e43363f>:0)
UnityEngine.UI.Button.Press () (at C:/Program Files/Unity/Hub/Editor/2020.2.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:68)
UnityEngine.UI.Button.OnPointerClick (UnityEngine.EventSystems.PointerEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2020.2.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Button.cs:110)
UnityEngine.EventSystems.ExecuteEvents.Execute (UnityEngine.EventSystems.IPointerClickHandler handler, UnityEngine.EventSystems.BaseEventData eventData) (at C:/Program Files/Unity/Hub/Editor/2020.2.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:50)
UnityEngine.EventSystems.ExecuteEvents.Execute[T] (UnityEngine.GameObject target, UnityEngine.EventSystems.BaseEventData eventData, UnityEngine.EventSystems.ExecuteEvents+EventFunction`1[T1] functor) (at C:/Program Files/Unity/Hub/Editor/2020.2.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/ExecuteEvents.cs:262)
UnityEngine.EventSystems.EventSystem:Update() (at C:/Program Files/Unity/Hub/Editor/2020.2.7f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/EventSystem/EventSystem.cs:385)

To Reproduce

Start a game with more than one player (host + client)
let all players die
you are prompted to replay again.
quit the host application
hit 'replay' on the client

Expected behavior
to probably not do this.

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: 2020.2f7
  • BossRoom Version: latest master branch (dc06548)

Unable to start as host after trying to connect as client to ip that isn't hosting

Describe the bug

Unable to start as host after trying to connect as client to ip that isn't hosting.
Occurs in editor and in build

To Reproduce
Steps to reproduce the behavior:

  1. Open Boss Room in Editor or Build
  2. Click "Join"
  3. Close trying to join dialog
  4. Click "Start"
  5. Notice that it will never start as host

Environment (please complete the following information):

OS: Windows 10
Unity Version: 2020.3.28f1
BossRoom Version: 1.0.2 pre

Boss charge missing collider exception

Describe the bug
When Boss charges getting missing collider exception

To Reproduce
Steps to reproduce the behavior:

  1. Start game as host.
  2. Move/teleport to boss.
  3. Wait until boss executes charge attack.
  4. Exception gets thrown each frame during charge attack
MissingComponentException: There is no 'Collider' attached to the "ImpBoss" game object, but a script is trying to access it.
You probably need to add a Collider to the game object "ImpBoss". Or your script needs to check if the component is attached before using it.
UnityEngine.Collider.get_bounds () (at <19391519260842408ff993819e8afdf3>:0)
BossRoom.ActionUtils.DetectNearbyEntities (System.Boolean wantPcs, System.Boolean wantNpcs, UnityEngine.Collider attacker, System.Single range, UnityEngine.RaycastHit[]& results) (at Assets/BossRoom/Scripts/Shared/Game/Action/ActionUtils.cs:60)
BossRoom.Server.TrampleAction.SimulateCollisionWithNearbyFoes () (at Assets/BossRoom/Scripts/Server/Game/Action/TrampleAction.cs:197)
BossRoom.Server.TrampleAction.Update () (at Assets/BossRoom/Scripts/Server/Game/Action/TrampleAction.cs:92)
BossRoom.Server.ActionPlayer.UpdateAction (BossRoom.Server.Action action) (at Assets/BossRoom/Scripts/Server/Game/Action/ActionPlayer.cs:315)
BossRoom.Server.ActionPlayer.Update () (at Assets/BossRoom/Scripts/Server/Game/Action/ActionPlayer.cs:290)
BossRoom.Server.ServerCharacter.Update () (at Assets/BossRoom/Scripts/Server/Game/Character/ServerCharacter.cs:249)

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: 2020.3.12f1
  • BossRoom Version: currently on sam/update-to-latest-NGO branch #55a7c9a838c0b4aca5de50f4739e6c0fbc724c33

Additional context
Add any other context about the problem here.

Skinned Mesh Rendere is invisible in build

void AttachToMesh(SkinnedMeshRenderer mesh, int slotIndex) {

	if(!IsServer) return;
	if (currentMeshes [slotIndex] != null) {
		currentMeshes [slotIndex].gameObject.GetComponent<NetworkObject>().Despawn();
	}
	SkinnedMeshRenderer newMesh = Instantiate(mesh.equipment3D) as SkinnedMeshRenderer;
	newMesh.bones = targetMesh.bones;
	newMesh.rootBone = targetMesh.rootBone;
	currentMeshes [slotIndex] = newMesh;
	newMesh.gameObject.GetComponent<NetworkObject>().Spawn();
}

when i spawn mesk.equipment3D it's not visible on game build but when i change instead of spawn mesk.equipment3D i make copy of player skinned mesh renderer and then i change it's property like shared mesh and shared material to the one mesk.equipment3D it work and visible in editor and build

Auto Change Host When Host Disconnected

When I try the demo, the client is disconnected from lobby/game when the host left the game. Which I think this is old mechanism for multiplayer.
Can the host change automatically when the Host is leave from game?

ConnectionManager.cs doesnt compile

Just installed de package and got this error, figure I might as well share it here:
Unity version used 20.3.38f1

Assets\Scripts\ConnectionManagement\ConnectionManager.cs(90,48): error CS8124: Tuple must contain at least two elements.

I noticed this in line 7:
using UUnity.BossRoom.ConnectionManagement;

I also had trouble with the ai.navigation, the URP and the Parrelsync package,
which i ended installing manually, but this seems unrelated... thanks in advance for any feedback

Game gets stuck after both players click ready

Describe the bug
Game gets stuck after both players click ready

To Reproduce
Alice and Bob run locally. One hosts, the other joins. Outside the editor, two instances on the same machine, connecting via 127.0.0.1
Both select a character, both click ready. Nothing happens.

Expected behavior
The game should start

Screenshots
If applicable, add screenshots to help explain your problem.
image

Environment (please complete the following information):

  • OS: Mac OS Catalina 10.15.7
  • Unity Version: 2020.2.7f1
  • BossRoom Version:
    commit 032d7a7 (HEAD -> release/v0.0.2, tag: v0.0.2-experimental, origin/release/v0.0.2)

Additional context
Add any other context about the problem here.

Reparenting

Request to make it posible to reparent a networkobject under a non-networkobject parent but has a networkobject root.
this would help solve issues e.g like grabbing a networkobject gun where it has to be parented under a hand or a rigged component.
the other reparented can check if its root has the networkobject, for approval and since the player(its new root transform) has the networkobject, its counted as valid even thu the hand its direct parent has no network object, since the player cannot be spawned with nested networkobjects

ParrelSync cloning not working on Windows?

Describe the bug

Creating a clone project with ParrelSync seems to fail on Windows. (Probably not something we can fix or should care about but logging it here)

To Reproduce
Steps to reproduce the behavior:

  1. In the menu go to Parrelsync > Clones Manager
  2. Press Add new clone button.
  3. Exception gets thrown and project is not correctly cloned.
FileNotFoundException: Could not find file 'C:\Users\Luke Stampfli\Documents\com.unity.multiplayer.samples.coop\Library\PackageCache\[email protected]\Unity.Collections.LowLevel.ILSupport\source~\Unity.Collections.LowLevel.ILSupport.CodeGen\CollectionsUnsafeUtilityPostProcessor.cs.meta'.
System.IO.__Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) (at <695d1cc93cca45069c528c15c9fdd749>:0)
System.IO.FileInfo.get_Length () (at <695d1cc93cca45069c528c15c9fdd749>:0)
(wrapper remoting-invoke-with-check) System.IO.FileInfo.get_Length()
ParrelSync.ClonesManager+<>c.<GetDirectorySize>b__28_0 (System.IO.FileInfo file) (at Library/PackageCache/com.veriorpies.parrelsync@bb3d5067e4/Editor/ClonesManager.cs:599)
System.Linq.Enumerable.Sum[TSource] (System.Collections.Generic.IEnumerable`1[T] source, System.Func`2[T,TResult] selector) (at <351e49e2a5bf4fd6beabb458ce2255f3>:0)
ParrelSync.ClonesManager.GetDirectorySize (System.IO.DirectoryInfo directory, System.Boolean includeNested, System.String progressBarPrefix) (at Library/PackageCache/com.veriorpies.parrelsync@bb3d5067e4/Editor/ClonesManager.cs:599)
ParrelSync.ClonesManager.GetDirectorySize (System.IO.DirectoryInfo directory, System.Boolean includeNested, System.String progressBarPrefix) (at Library/PackageCache/com.veriorpies.parrelsync@bb3d5067e4/Editor/ClonesManager.cs:608)
ParrelSync.ClonesManager.GetDirectorySize (System.IO.DirectoryInfo directory, System.Boolean includeNested, System.String progressBarPrefix) (at Library/PackageCache/com.veriorpies.parrelsync@bb3d5067e4/Editor/ClonesManager.cs:608)
ParrelSync.ClonesManager.GetDirectorySize (System.IO.DirectoryInfo directory, System.Boolean includeNested, System.String progressBarPrefix) (at 

Expected behavior
It should work.

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: 2020.3.12f1
  • BossRoom Version: 8431933

Additional context
I can clone other projects using ParrelSync fine and this happens for me with BossRoom on both my Windows machines.

Host Migration implementation so the game doesn't end when the host leaves

Is your feature request related to a problem? Please describe.
Currently in Boss Room I believe all client listen to the OnClientDisconnect callback and then shutdown/return to main menu when the host leaves.

Describe the solution you'd like
This post from Luke last year gave a basic outline of what this could look like:

There are some ways you could add host migration to a game using the Photon Realtime Transport. Something along the line of the following should work:

  1. While still all clients are connected use a NetworkVariable to agree on a fallback client which will be next in case of the host disconnects.
  2. If the host disconnects have that that fallback client create a new room with a slightly different name like "_1" by starting MLAPI again as host with a different room name and have all other clients connect again to that new room.

To get that to work the fallback client will need some way to store the current game state when stopping MLAPI and spawning the right objects again when entering host mode after the migration.

Would it be possible to implement? All production p2p games need this.

If a server was started for a 2nd time, NetworkObjectPool doesn't work anymore

Describe the bug
I was reading the documentation for Object Pooling since I wanted to add pooled bullet prefabs for my game, and it linked the source code for NetworkObjectPool.cs.

The code looked very strange to me as the pool is initialized only once, then never again. This leads me to believe it won't have correct behaviour if the server is shutdown, then started again for a 2nd time.

I don't know if this is proper Netcode for GameObjects style of coding, but anyway it does give me a KeyNotFoundException when trying to instantiate a pooled prefab when the server is started a 2nd time, because at that point, the _pooledObjects Dictionary has been cleared.

m_HasInitialized is never set back to false when ClearPool is called. Also the existing pooled prefabs don't seem to be cleaned up or reused properly after the server is started for a 2nd time.

I don't get why you have to unregister the prefab handlers anyway upon server shutdown. If the server program is about to exit, then it wouldn't matter since the entire program will close anyway. If the server is merely resetting itself, then wouldn't you want those prefab handlers to still be there?

I'm also confused why this is using its own queue instead of using the already existing ObjectPool class.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: 2021.3.10f1
  • BossRoom Version: n/a I got the NetworkObjectPool.cs from a link in the documentation.

Additional context
Add any other context about the problem here.

Error reading movie files in untiy (linux mint)

Describe the bug
I've loaded the project and am presented with following errors:

errors

Environment (please complete the following information):

  • OS: [e.g. Linux Mint 20.1]
  • Unity Version: [2020.3.23f1.1294]
  • BossRoom Version: [e.g. v1.0.1pre]

Game won't build in Linux mint. (Grayed out save button)

Describe the bug
The hello world netcode example compiles and runs:
Hello World Netcode build

Bossroom has no errors but the save button is grayed out:
Build Linux Save grayed out

Environment (please complete the following information):

  • OS: Linux Mint 20.1
  • Unity Version: 2020.3.23f1.1294
  • BossRoom Version: v1.0.1 develop with IET package version to 2.1.1 #422 fix

Error while importing the BossRoom project in Unity 2020.3

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Extract the provided zip file.
  2. Add project in the Unity (my version Unity 2020.3)
  3. Wait while project is importing.

Expected behavior
A BossRoom Project should be opened.

Screenshots
Screenshot (6)
Screenshot (7)

Environment (please complete the following information):

  • Windows 10
  • Unity Version: 2020.3
  • BossRoom Version: v0.1.0

Additional context

  • I already have the Git and Git LTS installed.

CANT EVEN OPEN IT!

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to Unity Hub
  2. Click on the folder inside the zip
  3. Open the project.
  4. SCREW IT!!!

Expected behavior
ACT AS A NORMAL PROJECT!!!
Screenshots
HOW THE HECK CAN I ADD ONE?

Environment (please complete the following information):

  • Windows 10
  • 2020.3.8f1
  • BossRoom Version: [e.g. v0.1.0] (I GOT IT FROM HERE YESTERDAY!)

Skinned Mesh Rendere is invisible in build

void AttachToMesh(SkinnedMeshRenderer mesh, int slotIndex) {

		if(!IsServer) return;
		if (currentMeshes [slotIndex] != null) {
			currentMeshes [slotIndex].gameObject.GetComponent<NetworkObject>().Despawn();
		}
		SkinnedMeshRenderer newMesh = Instantiate(mesh.equipment3D) as SkinnedMeshRenderer;
		newMesh.bones = targetMesh.bones;
		newMesh.rootBone = targetMesh.rootBone;
		currentMeshes [slotIndex] = newMesh;
		newMesh.gameObject.GetComponent<NetworkObject>().Spawn();
	}

when i spawn mesk.equipment3D it's not visible on game build but when i change instead of spawn mesk.equipment3D i make copy of player skinned mesh renderer and then i change it's property like shared mesh and shared material to the one mesk.equipment3D it work and visible in editor and build

New mode pvp

Hey, i want to make the game system work with player vs monster and player vs player two for now i tried make new variable boolean called isplayer with isNpc and changed some fonction of utility to make it that i can hit player two but i think i may didn't know to do it exacutly can you tell me the general idea of how i can do like some mode that player can fight player and player can summon monster to fight the enemy and not targting me or player in my team.
1- i want to know best solution of how to make npc target other npc only if he is summoned from player if not from player just targeting all player.
2- i want to know best solution of how to make player hit other player but from other team not my team.
genrally the idea of how i want to turn the game into is to two team playing vs eache other and why i want to make monster target only the enemy of his owner is because i did new skill that can summone monster helping until he die

Network Player position resets after giving ownership back to client

Describe the bug:
I change ownership of a player between server and client and after I return the ownership from the server to the client, it resets the player's position (on client side) to the values it had the last time the client had the ownership (before giving the ownership to the server).
I'm on NGO 1.0.0, using the ClientNetworkTransform script from the Package Manager - NGO Example.

Expected behavior:
The network player remains at the position the server moved it to.

Desktop Unity Editor:
Unity 2021.1.26
"com.unity.netcode.gameobjects": "1.0.0-pre.3",
"com.unity.netcode.adapter.utp": "1.0.0-pre.2",
"com.unity.services.relay": "1.0.1-pre.3"

Video
You can see the behaviour in this Twitch video at 2:33:00
https://www.twitch.tv/videos/1210205925

ClientNetworkTransform (With little changes and comments removed)

`
using System;
using Unity.Netcode.Components;
using UnityEngine;

namespace Unity.Netcode.Samples {
[DisallowMultipleComponent]
public class ClientNetworkTransform : NetworkTransform {

    public override void OnNetworkSpawn() {
        base.OnNetworkSpawn();
        CanCommitToTransform = IsOwner;
    }

    protected override void Update() {
        base.Update();
        CanCommitToTransform = IsOwner;
        if (NetworkManager.Singleton != null && (NetworkManager.Singleton.IsConnectedClient || NetworkManager.Singleton.IsListening)) {
            if (CanCommitToTransform) {
                try {
                    TryCommitTransformToServer(transform, NetworkManager.LocalTime.Time);
                } catch (NullReferenceException exception) {
                    Debug.Log(exception);
                }
            }
        }
    }
}

}
`

Can't create a lobby.

Describe the bug

When I press the create button to create a lobby nothing happens. I made builds for mac and also in the editor but both just show the loading for a split second and do nothing. I already switched on Relay and Lobby services and installed Git Large Files Support. This is for when you press the Start button and then attempt to create a lobby.

To Reproduce
Steps to reproduce the behavior:

  1. Press play on the editor. Click Create Lobby. Type in name and click Create.

Expected behavior
I expected a lobby to be created and to go to character selection like in a video I saw on youtube.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: macOS Monterey
  • Unity Version: 2020.3.33f1
  • BossRoom Version: com.unity.multiplayer.samples.coop-1.2.0-pre

Additional context
I was able to test multiple local instances of Dilmers project https://github.com/dilmerv/UnityMultiplayerPlayground. But I can't paste trying to create a local lobby for this Boss Room sample.

How is PLayerServerCharacter script is working

Hello , i want some help to understand playerServerCharacter script how the list is full of the all player in scene all i see it's on network spawn addiing current player to that list isn't should the list have only one player how the imp can detect all player from it because i wanna use the same way to make npc detect npc summonde from player and thanks

Npcs Attack Npcs

Hello to all Boss Room Devs, i am in the point where i want to make npc summoned by player to attack npc from scene what is the best way to do it and thanks

CinemachinePipeline class is Deprecated

Describe the bug
This sample seems to use an outdated Cinemachine, which leads to runtime errors and the camera not moving.

To Reproduce
Steps to reproduce the behavior:

  1. Download latest Release Project.zip
  2. Enable Relay and Lobby for the Project
  3. Open With Unity 2022.2.1f
  4. Update packages to Cinemachine to 2.9.5
  5. Remove old Navmesh github package from the Manifest

Expected behavior
To be close to working with a newer version of Unity.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Windows 11
  • Unity Version: 2022.2.1f
  • BossRoom Version: 2.0.4

Additional context
I know I shouldn't have opened it with a non LTS. Some things are fairly out of date though.

Boss Room can't build with build Error

Describe the bug
Boss Room can't build with build Error.

error CS0012: The type 'NativeHashMap<,>' is defined in an assembly that is not referenced. You must add a reference to assembly 'Unity.Collections, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

To Reproduce

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: [2021.3.1f1]
  • BossRoom Version: 1.1.2-pre

Guide for webgl deploy

Is there any guide with which we can build this example in webgl.
Transport services that are recommended should be mentioned here as well.

Changing some enums to scriptable objects

Feedback
image
image

Situations where sample space is limited with few options is a good fit for old plain C# enums like the one below

image

Suggested Changes
For situations like these ones, ScriptableObject enums are more robust, they give more flexibility, we can add logic to them and they can still work like a enum, we can add new enum without changing code (and we wouldn't be afraid to lose the number order when we add it to the first row, where in plain C# enums it would be horrible). There isn't any drawback that I know so it is safe to change it, there is just too much enum usages that makes work a little taxing, but I would love to do that!

Unable to reach host/server when connecting 2 or more clients with IP

Describe the bug

Unable to reach host/server when connecting 2 or more clients with IP.
The issue only occurs when host is also a built player. Does not occur when host is on the Editor playmode.

To Reproduce
Steps to reproduce the behavior:

  1. Build Boss Room.
  2. Open multiple instances of player.
  3. Start the game as host and connect clients with IP.
  4. Fails on connecting the 2nd client.

Expected behavior
Connecting upto 7 clients should work,

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context
None

Spawning an object with ownership leads to a different initial rotation between server and client

Description
I am using ClientNetworkTransform component on a gameobject. When spawning the object with a specific rotation (Z Axis) and with ownership (SpawnWithOwnerShip) the object is spawned on the client correctly with the correct rotation. On the server it is also spawned correctly at first, but it changes the rotation within a short period of time (1 second or so) to EulerAngles 0/0/0, resulting in a different Rotation between Server and Client.

When spawning the object first (without Ownership) and changing the ownership directly afterwards, the described behavior does not occur but the ownership of the gameobject is not applied (client can't transform object). Seems to be related to an already reported issue.

Only tested with Z axis rotation.

To Reproduce
Steps to reproduce the behavior:

  1. Add NetworkObject and ClientNetworkTransform to an object which is going to be spawn
  2. Create Clone of the Project and start the project as server and start the clone project as client
  3. After the client has connected, instantiate the object with rotation 180 and spawn the object with ownership
  4. Or use minimum unity Project attached below

Screenshot 2022-01-03 133126

Screenshot 2022-01-03 132914

Environment

  • OS: [e.g. Windows 10]
  • Unity Version: [e.g. 2020.3.13]
  • Netcode Version: [e.g. 1.0.0-pre.3]
  • Netcode Commit: [e.g. https://github.com/Unity-Technologies/com.unity.multiplayer.mlapi/commit/c102935df1d7e0928283b48948fe96e5d96dd961]

Additional context

testing.zip

[Unity Internal Testing] GitHub Integration Testing

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

[Build error] When I attempt to build for Android, getting networkvariable error

Describe the bug
When I attempt to make an Android Build, I receive a Unresolved inflated type argument for 'T' with declaring type 'Unity.Netcode.NetworkVariable`1' error. Full error below in context

To Reproduce
Steps to reproduce the behavior:

  1. Open the co-op sample project
  2. Change platform to Android
  3. Choose build and run
  4. Build fails
  5. See error

Expected behavior
Build succeeds, apk generated, sent to device

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: 2021.3.8f1
  • BossRoom Version: commit at 6e1ee7a

Additional context

  • Unity for netcode is included in the project's package correctly
  • Unity Editor version of the project is working correctly
  • Detailed Unity build error, occurs 3 times each for the OnValueChangedDelegate. Double clicking does not bring me to the correct line in file
    Field 'Unity.Netcode.NetworkVariable1/OnValueChangedDelegate<T> Unity.Netcode.NetworkVariable1::OnValueChanged' from 'C:\Users\victorchua\Documents\GitHub\com.unity.multiplayer.samples.coop\Library\ScriptAssemblies\Unity.Netcode.Runtime.dll', exception Unresolved inflated type argument for 'T' with declaring type 'Unity.Netcode.NetworkVariable`1'
    UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Field 'T Unity.Netcode.NetworkVariable1::m_InternalValue' from 'C:\Users\victorchua\Documents\GitHub\com.unity.multiplayer.samples.coop\Library\ScriptAssemblies\Unity.Netcode.Runtime.dll', exception Unresolved inflated type argument for 'T' with declaring type 'Unity.Netcode.NetworkVariable1'
UnityEditor.BuildPlayerWindow:BuildPlayerAndRun ()

Error building Player: 7 errors

With 'Enter Play Mode Options' checked, the CharSelect scene is not loaded immediately when the host is started for the first time in the editor.

Describe the bug
Not high priority but the fix could be quick.
With 'Enter Play Mode Options' checked, the CharSelect scene is not loaded
immediately when the host is started for the first time in the editor.
Reload Domain and Reload Scene are unchecked.

Having Reload Scene checked only, can kind of resolve this issue. The problem
is not with Reload Domain as I've tried to reset some static fields and methods
already in ServerGameNetPortal, ClientGameNetPortal, SessionManager etc.

I've narrowed down the issue to SceneLoaderWrapper.cs LoadScene method.

if (
     IsSpawned && // <<< THIS
     IsNetworkSceneManagementEnabled &&
     !NetworkManager.ShutdownInProgress
) {
   ...
}

IsSpawned is false on the first Play. When it is true, you get to the CharSelect
scene correctly. I'm not sure why this condition is there.

To Reproduce
Steps to reproduce the behavior:

  1. With 'Enter Play Mode Options' checked, click on 'Start with Direct IP'.
  2. Get to the 'Host With IP' (localhost) tab in the Main Menu scene.
  3. With the default localhost IP address and port, click on the start 'Host' button.
  4. The loading spinner spins and 'RecvConnectFinished Got status: Success'
    is logged in the console. You don't get to the CharSelect scene on the first Play mode.
  5. Stop the Play mode.
  6. Try steps 1 to 3 again without changing anything else.
  7. You can now get to the CharSelect scene immediately.

Expected behavior
You get to the CharSelect scene immediately (like you would with 'Enter Play Mode Options' unchecked).

Screenshots
bug

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: 2021.3.2f1
  • BossRoom Version: v1.3.0-pre

Additional context
Not sure if removing IsSpawned condition will be an adequate fix. Also not sure if Reload Domain and Reload Scene being unchecked
is intended to be supported by NetCode.

Change ReadMe Contribution section text from Master to Main

Readme needs an update as we still point out our default branch is master vs main

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

  • Develop branch contains all active development
  • The master branch contains release versions

Change text to main

Mobile Joystick

Hello there, i wanna use mobile joystick for movment UI joystick i added in script client input sender in update this if statment

           if m_Joystick.JoystickAxis != Vector2.zero)

            {
                float h = m_Joystick.JoystickAxis.x;
                float v = m_Joystick.JoystickAxis.y;
                Vector3 movment = new Vector3(h,0,v);
                movment = transform.position + movment;
                m_ServerCharacter.SendCharacterInputServerRpc(movment);
                //Send our client only click request
                ClientMoveEvent?.Invoke(movment);
            }

but i think doing server rpg of the new poistion and invoke ClientMoveEvent in update is kinda heavy so what should i do

Lobby not working on latest LTS

Hello,
I'm getting the following Error when trying to use the Lobby in the Boss Room Example:
Unity Gaming Services ProjectID not set up. Click the Readme file in the Assets Folder within the Project window in-editor to follow "How to set up Unity Gaming Services"

I've followed the instructions in the Readme, set the Project ID together in correlation with the Dashboard and enabled both Services.
I've also tried the sample "LobbyHelloWorld" and I get Heartbeets from the Lobby connection.
I'm using the latest LTS version of Unity btw.

Thank you!

Authentication Failed: Invalid_parameters valid ID domain not specified

Describe the bug
When I open up the menu; it sends two error messages. One a warning and the other with an formal error.
The message is near identical. "[Authentication]: Request failed: 400, {"title":"INVALID_PARAMETERS","detail":"Valid ID Domain not specified","details":[],"status":400}"

To Reproduce
Steps to reproduce the behavior:

  1. Download the latest version, which as of now is v1.1.0-pre.
  2. Add the project and open it with Unity Personal 2020.3.33f1
  3. Open up the Startup Scene and hit play
  4. See error

Expected behavior
I expected the main menu to show up and stay open.

Screenshots
Screenshot of console

Environment (please complete the following information):

  • OS: Windows 10
  • Unity Version: 2020.3.33f1
  • BossRoom Version: v1.10-pre

Can't add a new character

Hi guys. I'm really new to programming, so please go easy on me. I've been trying to add my own character to Boss Room for the past week, but I can't get past this without throwing the System.Exception. It's from GameDataSource.cs.

public Dictionary<CharacterTypeEnum, CharacterClass> CharacterDataByType
{
get
{
if( m_CharacterDataMap == null )
{
m_CharacterDataMap = new Dictionary<CharacterTypeEnum, CharacterClass>();
foreach (CharacterClass data in m_CharacterData)
{
if (m_CharacterDataMap.ContainsKey(data.CharacterType))
{
throw new System.Exception($"Duplicate character definition detected: {data.CharacterType}");
}
m_CharacterDataMap[data.CharacterType] = data;
}
}
return m_CharacterDataMap;
}
}
}

These are the steps I'm taking to create a new character. Well, the latest way. I've tried like 3 different ways, but I only documented what I did the last time. The System.Exception gets thrown immediately after I click on a character in the Character Select scene. I just don't understand why my new character PlayCharacter is considered a duplicate, but the other 6 CharacterClass.CharacterType not?

Any help would be very much appreciated. Thank you.

Steps I took to add a new character (just did it with a simple cube, prefab called CharacterPlayer):

  1. Create CharacterPlayer prefab and add to Prefabs-CharGFX folder
  2. Add CharacterPlayer Prefab to PlayerGraphics prefab in Prefabs-CharGFX
  3. Add new type to CharacterTypeEnum.cs, calling it CharacterPlayer
  4. Add new ActionType called LavaCube to public enum ActionType in ActionRequestData.cs
  5. Create the following Scriptable Objects, all called CharacterPlayer:
    a) Character Class SO
    b) BaseHP SO
    c) Action Description(s) SO
  6. Update the GameDataSource Prefab by adding Character Class SO and Action Description SO
  7. Increase k_MaxLobbyPlayers in CharSelectData.cs
  8. Add new "LobbySeatConfiguration(CharacterTypeEnum.CharacterPlayer,8" to ChatSelectData.cs
  9. Duplicate an existing seat, edit as necessary and then drag and drop new PlayerSeat GO into Player Seats in CharSelectState in editor.

Then I hit Play, get to the Character Select scene, but then get hit with the System.Exception as soon as I choose any character.

Thanks guys!

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.