Skip to content

Conversation

@RikuTheFuffs
Copy link
Contributor

Description

This PR includes a new experimental sample that showcases how to use official Unity packages and tools to make a multiplayer game.

Issue Number(s)

N/A

Contribution checklist

  • [N/A] Tests have been added for the project and/or any internal package
  • [N/A] Release notes have been added to the project changelog file
  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • [N/A] JIRA ticket ID is in the PR title or at least one commit message
  • [N/A] Include the ticket ID number within the body message of the PR to create a hyperlink

Louis-Philippe Lafontaine-Bédard and others added 21 commits September 28, 2023 14:15
* Creating base project based on NGO template
* Adding dedicated server package

* enabling content selection and stripping rendering, UI, and Audio components on servers

* using multiplayer role instead of configuration to define if server or client

* Adding scene bootstrapper from Boss Room

* Adding multiplayerRoleRestricted attribute to relevant scripts

* updating to MPPM 0.5.0

* refactored game application and gamestate to isolate client and server code

* Adding min number of players to config and using max from config

* Shutting down the server after game ends or all clients disconnect

* setting vsync count to 0 on servers

* setting multiplayer role when building via BuildProcessor.cs

* updating project editor version to 2023.3.0a7

* Updating CLIArgParser to use CLI Arguments from DedicatedServer

* removing port and server ip from config file

* Adding default config to additional build files

* enabling dedicated server build optimizations in player settings
* split the pr trigger and build jobs in separate files

* moving test-editors as fields under each project, and adding the dgs sample to projects

* adding tests to CI

* renaming project to remove spaces in name

* Adding support to build Linux/Mac/Windows clients and servers through menus
…-6063] (#5)

* adding com.unity.multiplayer.samples.coop package

* Adding third person starter assets

* adding back animation module and updating assembly dependencies

* adding starter assets asmdef

* creating player character

* creating environment

* cleaning up UI and adding quit button

* adding menu toggle action

* cleaning up disconnect flow

* setting builds to windowed mode

* Adding game menu

* displaying number of connected players
* creating basic AI character patrolling between points

* using NetcodeHooks class for spawn and despawn hooks

* extracting character geometry and skeleton to prefabs

* replacing network variable with rpc

* updating mac image to more recent one
* creating readme file

* adding UGS setup instructions

* syntax fixes and adding links to package docs

* Apply suggestions from code review

Co-authored-by: Vic Cooper <vic.cooper@unity3d.com>

* add details for how to use MPPM

* clarifying local multiplayer flow

* removing doc link to page that doesnt exist yet

* clarifying how to use autoconnect mode

* Apply suggestions from code review

Co-authored-by: Vic Cooper <vic.cooper@unity3d.com>

* adding link to doc for port forwarding

* Apply suggestions from code review

Co-authored-by: Vic Cooper <vic.cooper@unity3d.com>

* Apply suggestions from code review

Co-authored-by: Vic Cooper <vic.cooper@unity3d.com>
Co-authored-by: Louis-Philippe Lafontaine-Bédard <louisphilippe.lb@unity3d.com>

* [Documentation] Removed useless section

* [Documentation] Applied feedback from PR

* Update Experimental/DedicatedGameServer/README.md

Co-authored-by: Vic Cooper <vic.cooper@unity3d.com>

* Apply suggestions from code review

Co-authored-by: Vic Cooper <vic.cooper@unity3d.com>

* chore: updated readme with suggestions

* Update Experimental/DedicatedGameServer/README.md

Co-authored-by: Vic Cooper <vic.cooper@unity3d.com>

* Update Experimental/DedicatedGameServer/README.md

Co-authored-by: Vic Cooper <vic.cooper@unity3d.com>

* chore: Fixed typos

---------

Co-authored-by: Vic Cooper <vic.cooper@unity3d.com>
Co-authored-by: Paolo Abela <paolo.abela@unity3d.com>
Co-authored-by: Paolo Abela <rikudefuffs@gmail.com>
* chore: updated project version to alpha 17

* chore: Updated multiplayer packages

* chore: reserealized proejct settings

* fix: stripped AICharacter animator component from server instances

* chore: disabled default network prefabs generation [skip ci]

* feat: removed Bootstrapper tool [MTT-7632] (#11)

* feat: removed Bootstrapper tool and used serialized fields instead [MTT-7632]

* fix: fixed faulty initialization due to race conditions

* chore: added comments and error logs
* importing door scripts, models and animations from boss room

* adding doors to environment

* changing match duration to 5 minutes

* feat: Added logic that allows doors to be opened if at least one player is nearby, and to display the related UI on clients
chore: removed FloorSwitch assets

* feat: players can now be detected by doors when they collide

* feat: added "OpenDoor" input detection

* feat: doors open when a player asks them to do so

---------

Co-authored-by: LPLafontaineB <louisphilippe.lb@unity3d.com>
* feat: Added predicted and reconciled UI for InteractiveDoor

* fix: fixed scaling of door interaction UI

* chore: updated CI windows image

---------

Co-authored-by: Paolo Abela <rikudefuffs@gmail.com>
* chore: updated README

* chore: Apply suggestions from code review

Co-authored-by: Vic Cooper <vic.cooper@unity3d.com>

---------

Co-authored-by: Paolo Abela <rikudefuffs@gmail.com>
Co-authored-by: Vic Cooper <vic.cooper@unity3d.com>
* URP settings updates: deleted 2D version and replaced with 3D version

* added colors and landmarks to the enviro, reorganized enviro prefab

* updated UI with stylesheet from other samples

* Added character color shader

* updated player colors

* Color updates and the addition of player icons

* Reorg of environment prefab, reimplementation of character numbers

* deletion of unneeded assets

* removed debugging method

* adjusted URP asset to minimize shadow artifacts

* environment tweaks

* slightly update door UI

* moved a pillar to be in desired position

* chore: Updated NGO to 1.8.0 to match the version ran in the CI

* deleted unused script

* made unnecessarily public class internal, also cleaned out some redundant code

---------

Co-authored-by: Paolo Abela <paolo.abela@unity3d.com>
* change the masking settings of that tutorial page so that users can use the ParrelSync window

* Revert "change the masking settings of that tutorial page so that users can use the ParrelSync window"

This reverts commit 86fe3b2.

* add parrelsync clones window to tutorial
* chore: added missing newline to readme

* chore: optimization. stripped out all default rendering, UI and audio components
* chore: fixed CI tests not running properly

* chore: (CI) updated Windows image and added specific editor version

* chore: (CI) updated mac image
…156)

* standards job added per sample project

* indentation

* descriptive job name per project

* relative path to projects

* editorconfig added

* actual netcode standards csproj file

* removing test job, paths sorted

* Invaders formatted

* 2DSpaceShooter formatted

* ClientDriven formatted

* DynamicAddressablesNetworkPrefabs formatted

* MultiplayerUseCases formatted

* changelog addition

* test: update editorconfig

* line separators change

* file in Addressables project formatted

* formatted straggler scripts in invaders
@RikuTheFuffs RikuTheFuffs requested a review from a team as a code owner March 19, 2024 11:32
@unity-cla-assistant
Copy link

unity-cla-assistant commented Mar 19, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
2 out of 3 committers have signed the CLA.

✅ jilfranco-unity
✅ RikuTheFuffs
❌ Louis-Philippe Lafontaine-Bédard


Louis-Philippe Lafontaine-Bédard seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Contributor

@jilfranco-unity jilfranco-unity left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RikuTheFuffs you already know about these, but I'll add my few comments here for others' visibility also :)

  • We should call out where users can adjust the min/max amount of players in the readme!
  • I've also found a broken link here for the multiplayer-roles.md
  • The web badges in the readme for the engine and netcode versions will need to up updated also!

These minor things aside, it's looking really good! I tested with builds and had no issues, and the readme is really solid! I think we're good to merge once these last few kinks are worked out ✨ Thanks for your hard work, and @Elfi0Kuhndorf for reviewing! :)

Copy link
Contributor

@fernando-cortez fernando-cortez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Edit: Per the contribution guidelines, PRs for Experimental samples should target main directly.

Adding requested changes since some of the Yamato jobs from develop are removed/not compiling.

---

# Run all relevant tasks when a pull request targets the develop / main or a sample branch
pull_request_trigger:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to add specific yml files for the triggers and the tests.

However, inside the previous build.yml file, the old pull request trigger job remains. I'm fine with removing that one out of the build.yml file and keeping this here, but let's also move over the standard pass that was recently added as a dependency to our pull request triggers.

On that note, project-standards.yml seems to have been removed. Let's revisit that merge and get that file back, so that the job would fire, since the job def file isn't actually compiling on Yamato (both build.yml & project-standards.yml). See the branch here: https://unity-ci.cds.internal.unity3d.com/project/1573/branch/sample%2FDGS?nav=jobDefinitions.

Last note about the project tests, could we leverage UPM-CI tools here, since I'm seeing that there's an individual job to build a project for every supported platform? You can notice that the dependency graph on Boss Room's pull request trigger job has one packing job, in which the 3 project tests refer to that artifact.

I'm thinking, every project is packed, and we use the booleans (run_editor_tests & run_playmode_tests) inside the projects to determine whether a project test is run, like you've done here. So we would shrink by a lot the number of jobs run.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disclaimer: these changes were made by LP, months ago, so I don't have the full context of "why" they were made.

On that note, project-standards.yml seems to have been removed. Let's revisit that merge and get that file back, so that the job would fire

I'll open a new branch to start from a point before the merge (reverting it doesn't seem enough, this PR still tries to delete the Anticipation Sample) and open a new PR. If the issues persist there, we'll fix them.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On that note, project-standards.yml seems to have been removed.

project-standards is not present in main either. It's only in develop.
It seems that develop hasn't been merged into main yet.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay noted! And yes I wrote that before noticing that this was targeting develop. I'll check out the other PR.

@RikuTheFuffs RikuTheFuffs changed the base branch from develop to main March 20, 2024 11:36
@RikuTheFuffs
Copy link
Contributor Author

RikuTheFuffs commented Mar 20, 2024

Closing as superseeded by: #160

@RikuTheFuffs RikuTheFuffs changed the title Added Dedicated Game Server Sample (experimental) Added Dedicated Game Server Sample (experimental) - ignore. Mar 20, 2024
@RikuTheFuffs RikuTheFuffs deleted the sample/DGS branch March 22, 2024 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants