Competitive Action Multiplayer Template now released! [Netcode for Entities]

Hello Unity Developers!

We are pleased to announce the release of our new Competitive Action Multiplayer template! This template is equipped with everything you need to build a First Person Shooter game using networked interactions, client-side prediction, game server hosting, and more. By leveraging our Netcode for Entities package and the Unity Multiplayer SDK, you can start building ambitious multiplayer games quickly.

Version 1.0.0

Why choose Unity’s Competitive Action Multiplayer template?

This template is perfect for people who want to dive straight into creating a first-person shooter project or similar competitive action games without the hassle of building and maintaining foundational systems from scratch. It includes in-Editor tutorials and a barebone FPS-driven gameplay flow. Here’s how our template will accelerate your early prototyping:

  • Employ ECS for efficient organization of in-game data and logic—benefit from Netcode for Entities
  • Leverage a server-authoritative model with client-side prediction and lag compensation for enhanced multiplayer responsiveness
  • Learn how to use the PlayMode Tools and the GameBootstrap to test your gameplay easily
  • Connect to anyone, anywhere, with Relay and Lobby
  • Pre-integration with Multiplay Hosting and Matchmaker
  • Networked Character Controller solution for Entities
  • Works cross-platform for Windows, Mac OS, Android, IOS, and Linux

Who Can Benefit from this Template?

The Competitive Action Multiplayer template is designed for creators developing a multiplayer game needing prediction. It is geared towards people who are prototyping a new experience, contributing to a project in a studio, setting up and testing a game with Unity Gaming Services, exploring multiplayer test modes, or exploring Unity as an enthusiast.

Get Started Today!

Download the Competitive Action Multiplayer template for Unity 6 from the Unity Hub and get started with the Quick Play tutorial. Refer to our documentation for more instructions.

Join the Discussion

We’d love to hear your feedback and see what you create with our template! Post in Discussions or join our Discord to share your projects, ask questions, and collaborate with fellow developers. Please follow this link to leave your feedback anonymously (ETA: 1 min). Your input will help us improve and expand the template in future updates.

Let’s push the boundaries of multiplayer together!

16 Likes

Hi there!
As soon as I’ve seen this, I made a new unity project using the template, to test it out!
Here’s my feedback in the order that I’ve encountered it.

The initial project creation took far longer than a regular empty unity project, with the initial domain reload being almost a whole minute. I was concerned that this would be the expected behavior with the involvement of Burst but it seems we’re fine. I’ve later opened the project and poked a file to trigger domain reload, clocking under 20 seconds.

  • I love that the project settings come with ‘run in background’ ticked, ‘do not reload domain or scene’ though!
  • After the first domain reload, I got a warning Missing types referenced from component BuildProfile on game object DGS-Linux-Build , I assume this is for people who’d like to build Linux, harmless enough even though I don’t like seeing warnings on opening a new project.
  • I noticed the Multiplayer Center package is installed in this template, isn’t this redundant? the project already leverages NFE…

I followed the popup tutorial diligently and had these notes.

  • When asked to open the playmode tools window, it looked like a button to a degree, I got slightly thrown off by that.
  • I liked that the tasks auto-detected completion and moved on.
  • I liked the highlights of the relevant panels and buttons including the ‘enter playmode’ button being highlighted, even though it was so tiny that the highlight was meaningless - it was doing its best!
  • When the tutorial in playmode asked me to set Num Thin Clients to 1 and I did so, the editor paused playmode and reached the tutorial’s conclusion. Clicking Done at that point closed playmode, which means I never got to interact with the thin client or see its effects. I recommend adding an extra step here so people can familiarize themselves with the thin client and see it in game.

Then, I began exploring on my own. I opened Multiplayer Play Mode, and made a second client successfully. Then everything started breaking.

It seems that every time the editor has any reason to pause, it makes multiplayer error out. Even simple things like dragging the playmode tools floating window around causes playmode to pause due to error.

On top of that, any pause for shader compilation that happens as objects load on the fly caused an error due to ‘bad client performance’ and shut down my ability to operate the multiplayer playmode session properly. This happened a lot as the weapons were randomized with unique projectile vfx and impaired my ability to enjoy the template.

In terms of quality of life, I wish that in the pause menu ingame, pressing on the outside area of the buttons panel would go back in game. Or that pressing ‘escape’ again would undo the pause. Currently you have to manually press ‘resume’ to continue.

I love the info panel that each client starts with - that one is a keeper!

The code for the FirstPersonPlayerInputsSystem.OnUpdate surprised me for a bit - there’s a mention of elapsedTime but it goes unused.

FirstPersonPlayerSystems.cs was a very nicely named file. I like seeing the separation of the two systems in there.

CharacterWeaponVisualFeedbackJob was rather long to read, though well commented - I wish the methods were extracted out for each adjustment.

In terms of content variety - I like that weapons of all the important types were included - between the shotgun spread, the hit scan weapon, the projectiles, and the explosives, it feels like a solid template to work up from! The ECS jobs are well made and I didn’t feel overwhelmed by any of the classes I’ve read, though the amount of boilerplate feels staggering. I hope Unity NEXT removes some of that croft…

Thanks for the template!!

Edit: It seems 465 out of 550 MB of this template is the VFX textures of Assets/Art/VFX/Textures… rather painful to look at.

7 Likes

RiGHT ON TIME !! :raised_hands:

Would this work for WebGL / WebGPU ?

Hello, I’d like to ask how you managed to set up the NameTag’s UIDocument to World-Space, and how you managed to assign the UI Renderer component and material with the “Hidden/Internal-UIRDefaultWorld” shader. I haven’t found any settings for this, same goes for “CompetitiveActionPanelSettingsWorldspace”. When I change the Renderer Mode to Screen Space Overlay, I can’t switch it back to World Space mode. I understand it’s marked as experimental, but am I missing something? Is there a normal way to switch UI Toolkit to World Mode? Currently, it’s only possible by modifying the Prefab through a text editor, where you need to change m_RenderMode: 1, but this doesn’t seem like the right approach.

Thanks!

3 Likes

Hello everyone,

First, I want to thank Unity for providing this template. Unfortunately, I haven’t had the chance to fully explore and enjoy it yet, but I’m looking forward to diving in soon.

I hope the community is finding it useful. However, I couldn’t help but notice that the DOTS community doesn’t seem as active as it used to be before the forum rework. I truly hope we can rekindle that vibrant engagement soon!

Regarding the template, I noticed it uses Unity Relay. Could someone explain how peer-to-peer connections are implemented with the NetCode for Entities, given that it follows an authoritative model?

Additionally, I’m curious about your approach to handling host disconnections. How do you manage this scenario effectively while maintaining a good player experience?

1 Like

Thank you for creating such an amazing template and tutorial. Unity should create more tutorials like this, especially for DOTS!

7 Likes

Is there any way to speed this up? Maybe by simplifying or degrading the graphics quality?

UPD:
I definitely wouldn’t want to wait an hour and a half for the next time I create a project based on this template… Is there a way to create precompiled shaders, such as those that have just been created, so that next time I can just put certain files in a certain folder, so that I don’t have to wait an hour and a half again?

1 Like

Want to make one that works with Steam (Fish/Mirror/Netcode) and doesnt rely on your expensive gaming services/hosting?

1 Like

I came here wondering this exact thing. World Space UI in UI Toolkit seems like kinda a big deal to leave entirely undocumented.

2 Likes

I just notice that, thank you

Hello sionzee1,
I’m not sure why this is happening. As a workaround, can you try setting the inspector to debug? I assume the option should be available then. I’ll look into that when I return from holiday.

Happy holidays
Robi (Unity)


1 Like

To be honest, I want to try to run a project based on this template somewhere on a dedicated Ubuntu hosting, although considering that there are almost no comments in the presented code, and the whole lesson is limited to the location of folders and windows of the playmode, it will be another adventure.

Hi,
Thank you for your valuable feedback!

To answer some of your questions:

After the first domain reload, I got a warning Missing types referenced from component BuildProfile on game object DGS-Linux-Build , I assume this is for people who’d like to build Linux, harmless enough even though I don’t like seeing warnings on opening a new project.

This template also includes the usage of the Dedicated Gaming Server service which runs on Linux. There is a build profile for easier setup and this comes with the warning if you haven’t installed the Linux Dedicated Build Support module. If you are sure you are not using this service, you can remove the DGS-Linux-Build build profile, else you need to install the Linux Dedicated Build Support module to the Unity version you are using. We will investigate this and check if we could not print the warning on startup but on the build step instead.

I noticed the Multiplayer Center package is installed in this template, isn’t this redundant? the project already leverages NFE…

The Multiplayer Center package is now part of Unity 6 core packages, it is therefore installed by default.

When asked to open the playmode tools window, it looked like a button to a degree, I got slightly thrown off by that.

I’ll share this feedback to the team, thanks!

I liked the highlights of the relevant panels and buttons including the ‘enter playmode’ button being highlighted, even though it was so tiny that the highlight was meaningless - it was doing its best!

Same here, we will check if they can make the highlight bigger. If you can share an image it could be very helpful!

When the tutorial in playmode asked me to set Num Thin Clients to 1 and I did so, the editor paused playmode and reached the tutorial’s conclusion. Clicking Done at that point closed playmode, which means I never got to interact with the thin client or see its effects. I recommend adding an extra step here so people can familiarize themselves with the thin client and see it in game.

We will keep this in mind for a future release. Thanks!

It seems that every time the editor has any reason to pause, it makes multiplayer error out. Even simple things like dragging the playmode tools floating window around causes playmode to pause due to error.

We will investigate what’s causing this, thanks for flagging it!

On top of that, any pause for shader compilation that happens as objects load on the fly caused an error due to ‘bad client performance’ and shut down my ability to operate the multiplayer playmode session properly. This happened a lot as the weapons were randomized with unique projectile vfx and impaired my ability to enjoy the template.

This is due to using compute shaders on the vfx, they have to play once to compile. One solution would be to play them on the loading scene (being sure they are not culled). This is planned to be implemented in a future release.

In terms of quality of life, I wish that in the pause menu ingame, pressing on the outside area of the buttons panel would go back in game. Or that pressing ‘escape’ again would undo the pause. Currently you have to manually press ‘resume’ to continue.

Noted, we will discuss and implement some of your suggestions in a future release.

I love the info panel that each client starts with - that one is a keeper!

Yay, thanks!

The code for the FirstPersonPlayerInputsSystem.OnUpdate surprised me for a bit - there’s a mention of elapsedTime but it goes unused.

Missed that one, thanks!

Edit: It seems 465 out of 550 MB of this template is the VFX textures of Assets/Art/VFX/Textures… rather painful to look at.

Yes, indeed, we will downscale those textures in a future release, thanks for flagging and for your thoughtful feedback!

1 Like

The host client (i.e. the client who creates the Relay lobby, with associated join code) is also the ‘server authority’; it runs an in-process ServerWorld, which is connected to said Relay’s server, and said ServerWorld is responsible for creating and sending snapshots to each connected peer via the relay service.

The host’s ClientWorld also connects to its own ServerWorld via the relay.
Aside: For a production build, you’d want to connect this in-proc client to its in-proc server directly via IPC, of course. The sample doesn’t show this.

Non-host peers have no additional netcode-related authority when running in this Relay mode. They basically act as if they’re connected to a Dedicated Game Server, except that they connect via Relay parameters discovered via the Relay JoinLobbyByCode API. Thus, they are only permitted to send input commands and RPCs, and use client prediction to hide latency, as is typical in Netcode for Entities.

This approach has pros and cons, but one broad positive is that gameplay netcode is identical for each use-case. For example; this sample supports; DGS matchmaking, Relay, and Direct Connection (via Address:Port).

That said; broadly speaking, supporting other forms of authority – particularly for these smaller scale use-cases most suited to Relay – is something we’re looking into in relation to our unifying efforts. It would help us bring Netcode for Entities closer to Netcode for GameObjects, which handles client & distributed authority well.

1 Like

Hi @NikiWalker,

Thank you for your detailed response it has given me a much clearer understanding of the relay service. I do, however, have two additional questions:

  1. Why should the host client connect to the server rather than directly patch the server to include rendering and client-only components, systems? This approach seems like it could make the system more efficient by avoiding unnecessary resimulations and reducing bandwidth usage by design. While it would likely increase the host’s gameplay responsiveness, it could also lower the hardware requirements for hosting. This is particularly significant, as maintaining a stable 60fps on mobile devices especially Android is already a challenge. Adding both server and client Worlds to the same device could make meeting these performance standards even more difficult.

  2. Server Migration and Distributed Authority: Could you provide more details on how migration and distributed authority are designed to work? Additionally, do you have an estimated timeline (or quarter) for their public release in DOTS?

From my perspective, without migration or distributed authority, I struggle to see a strong real-world use case for using relay services aside from perhaps certain 1v1 or co-op games.

I am really curious about games scenarios where relay might still be advantageous under these limitations.

Hey @Oberheim,

We haven’t build the template with WebGL support in mind. I gave it a try and it’s not working at the moment but we’ll investigate as soon as possible.

Can someone provide the build version?
Feels like if I open there would be Errors.
(Github LInk etc)

Hi @Kadir,
The repository for this project is not public at the moment, we’ve tested the template extensively with Unity 6000.0.28f1 before release, and more recently we’re working with Unity 6000.32f1, but I believe the template should work with any Unity 6 version, starting from Unity 6000.0.19f1 (which was our main version during the last bit of development).

1 Like