Enter the Boss Room: our new multiplayer sample game
Explore Unity’s new, experimental netcode library and the underlying patterns of a multiplayer game in our small scale cooperative RPG, Boss Room
Creating multiplayer games is not easy, and it’s common to feel overwhelmed when exploring the development of a multiplayer game – even with SDK docs provided. You need advice on what to do with the provided SDKs and patterns you can use as building blocks for your own games. It’s our goal as the Unity Multiplayer Networking team to equip and support developers (like you) with the tools needed to build great multiplayer gaming experiences for your players. Part of that promise involves providing not only the foundational networking technology, but also the documentation and educational templates needed to understand its application. That’s where our multiplayer samples come in – with Boss Room being the first educational content of its kind.
As Boss Room is being developed, tutorials on the different aspects of networking the sample will be written for developers on our new documentation site. These tutorials will cover many critical pieces of networking a small cooperative game, such as how to choose between RPCs vs NetworkVariables, or how to design your game to be responsive with lag compensation techniques.
Now let’s dive into our new, early access co-op sample: Boss Room.
Enter the Boss Room
Welcome to the Boss Room, an official sample project built on 2020 LTS that showcases Unity’s native suite of tools, graphics, and experimental networking technology – available now as Early Access through Github. Boss Room leverages the new experimental netcode package to bring up to eight players together to defeat imps and a boss in this adorable vertical slice of a cooperative RPG dungeon. Eager for more Boss Room? Don’t sweat – it will continue to evolve alongside the community as our multiplayer solution evolves too.
Get started here, or read on to see a quick tour of what to expect in Boss Room today.
Players will begin Boss Room by hosting or joining a game server, which will be hosted on one of the players’ devices.
Once connected, players will select a Hero from one of the eight available, and join a lobby and select your character while waiting for all party members to be ready to play. When all players are ready, a short timer shows and then all Heroes are transported into the Boss Room environment.
Once in the Boss Room, players must work together to get past enemy minions and defeat the boss.
With the main goal of Boss Room being to teach developers the underlying concepts and patterns behind a multiplayer game, the networking aspects of the sample are crucial.
Part of the main value designed in Boss Room is the multiplayer patterns it shows: action animation anticipation, lobby, state vs RPC, and more. The goal is to provide users with not only the implementation of such patterns, but also documentation to help them understand it. Be sure to keep an eye on our documentation site to stay up-to-date with these articles as they’re published over the coming months.
The networking model used in Boss Room is a client-hosted server, and players can connect to each other through an integrated Photon Relay and IP direct connection.
Characters and classes
For Player Characters, we have four 3D character classes (Mage, Warrior, Rogue, and Archer), three races (Elf, Human, and Dwarf), and two genders represented today. These characters have two primary abilities and a few emote animations included for each. For AI / Enemies, we showcase imps and a dungeon boss – each with their own unique abilities.
The characters in Boss Room are all based on a common character model we lovingly call the “U” – designed to be reused and scaled into new shapes and sizes. Since they all share a common structure, they’re designed for reuse. Boss Room uses the UCL license, which means you’ll be able to reuse all our assets and build on top of them in your own Unity project, so by all means… mod away!
As previously mentioned, Boss Room demonstrates a variety of action gameplay techniques that are commonly found in co-op RPGs, along with the coding patterns and techniques that are useful when implementing said actions. This includes server-driven pathfinding and movement with client-side interpolation as well as having the Action System be a generalized mechanism for characters to “do stuff” in a networked way.
Actions include everything from your basic character attack, to a fancy AOE skill like the Archer’s Volley Shot. Below is a list of action archetypes implemented using this system:
- Melee attack with a physics-based hitbox check.
- Area-of-effect attack. The attack is centered on a point provided by the client to show client-side area selection with a server-driven effect.
- Ranged Projectile attack which spawns a server-driven projectile. Also includes a variant of this action with an ability to «charge» the shot by holding down the action button.
- Stunned action that prevents AI-driven agents from doing anything.
- Stealth action that toggles stealth mode for rogue.
- A buffing action with an included ability to charge it by holding down the action button. Produces extra effect on the maximum level of charge.
- Emote actions that play silly character animations – these show player communication.
- Chase action that makes your character follow the chosen target
- Target selection that is used for actions that can aim at a target, if one is chosen.
- Trample action that Boss executes and pushes unwary heroes aside – this shows patterns for networked physics.
- Revive action that allows heroes to bring each other back to life.
Dungeon and gameplay
The Boss Room environment is designed to let players have a few moments to test their character’s skills before they face the boss.
The dungeon features an antechamber and a boss room, with a simple coop switch puzzle to get into the Boss’s area. The goal is simple, defeat imps, solve the puzzle, take down the boss – and get to the treasure at the end!
A note from our team
The goal of Boss Room is greater than just API education. Multiplayer is one of the areas of game making which will influence your game design, not just your implementation. Knowing good practices like «when is it ok to be client driven vs server driven if I have a server driven, physics impacting NPC like the boss» or «tricks where you can use ramp up animations to hide latency» will help you make a better multiplayer game. Boss Room‘s whole feature set is examples of these practices and patterns.
Our team’s goal is to give you a reference for the whole engineering process around multiplayer game development so you’re able to build a multiplayer game from A to Z for specific types of games. This will involve design, implementation, testing and how to handle a live environment. We’re starting with Boss Room as the reference – our docs around it are currently being written.
Boss Room’s secondary goal is dogfooding the new experimental GameObject netcode package (an evolution of MLAPI). The samples team and the SDK team work hand in hand to improve MLAPI, give UX feedback, and raise issues. As MLAPI adds new features and updates the SDK, we’ll keep using these features and make sure they make sense in a project development context.
What’s up next?
As our networking solution continues to grow and improve, so will this sample. Here are ways to stay involved.