Unity logo
取消
购物车
应用
Sell Assets

11000+款5星资源

8.5万+用户参与评分

10万+社区成员鼎力支持

每款资源都经过 Unity 审核

首页
模板
教程
此内容由第三方提供商托管,该第三方提供商在未接受Targeting Cookies的情况下不允许观看视频。如果您想观看来自这些提供商的视频,请将“Targeting Cookie”的Cookie偏好设置为“是”。
1/5
资源包依赖项
1
此资源包需要与资源商店的其他资源包一起使用。
描述
Since UNET deprecation, asset was rewritten for Mirror Networking. Mirror asset will need to be imported first Link

Multiroom PvP is an example (not complete project) on how to use Mirror/UNET to create multiple game rooms in a single Mirror/UNET server. It's meant to be used as a learning resource to get you inspired or help to increase your knowledge of networking with UNET. To make networking development easier, [Easy Unet Packets] is also included in this package.


Why would someone try multi-room setup? (in general)
If a game room is small, it might make more sense to have multiple game rooms in a single server. Take for example a small 1 vs 1 game, which consumes about a 100 MB of RAM. You could only run 10 instances (rooms) in a 1 GB RAM server, which is wasteful and only allows 20 players to play concurrently. If all of your rooms are on one unity instance, you no longer have the overhead of Unity, and can run hundreds of game rooms. With this example, I've tested 200 players constantly running around, and here are the stats:
[200 players, 26% CPU, 184 MB RAM on a 5$/month VPS.]


If a game is relatively small, it's easier to have things running in one server. This way, you don't need to spend time working on master servers and synchronization between servers. It should give you more time to work on the actual gameplay, not the infrastructure of it. If you get lucky and your game becomes more popular, it's easy to spread servers across multiple regions or to upgrade the VPS plan. If a need arises - no one stops you from having a master server managing your multi-room servers.


Is multi-room setup just for 1 vs 1 games?
No. Example only deals with 1 vs 1 game, but you can use similar technique to make 5 vs 5 game, 10 player deathmatch or something similar

What are the limitations of this method?
Ask yourself a question - does it make sense to copy the room multiple times in one server? Will it break something? (navmesh, terrain and etc.) For example, if terrain is large, it wouldn't make sense to multiply it in the server. If your game relies on having AI (bots), can you make sure that your navmesh implementation works on duplicate rooms?

Warning: Focus was put into making this example as simple as possible, so it has no character animations or effects - just basic game mechanics for a 1 vs 1 game (see video attached).
Warning: It's for people who are interested in self-hosting the server (not using Unity Multiplayer services)

Multiroom PvP Example

(4)
85 users have favourite this asset
(85)
$15
增值税将在结算时计算
许可证类型:Single Entity
一个实体
适用于个人或小型企业。
多个实体
适用于大型企业或多用户。
退款政策
该资源受Unity资源商店退款政策约束。有关详细信息,请参见《最终用户许可协议》(EULA)中的第2.9.3节。
安全结账方式:
Supported payment methods: Visa, Mastercard, Maestro, Paypal, Amex
许可证类型
文件大小
896.3 KB
最新版本
1.0.4
最新发布日期
2022年6月13日
原始 Unity 版本
2018.4.32
高品质资源
11000+款5星资源
深受用户信赖
8.5万+用户参与评分
强大的社区支持
10万+社区成员鼎力支持
Unity logo
语言
反馈
合作伙伴计划
合作伙伴
USD
EUR
Copyright © 2025 Unity Technologies
所有价格不包含税
USD
EUR