Networked Multiplayer 多人网络

优质
小牛编辑
135浏览
2023-12-01

Realtime networking is a complex field, but with Unity we have made it extremely simple to achieve. However, it is still best to understand the breadth and depth involved with creating any kind of network game. This section will explain the fundamentals of networking concepts, and the Unity-specific executions of these concepts for you to use. If you have never created a network game before it is highly recommended that you read this guide in detail before attempting to create one.

实时网络是一个复杂的领域,但Unity非常简单的可以实现。不过,仍然最好广泛而深入理解涉及创建任何类型的网络游戏。本节将介绍网络概念的基础,以及使用时Unity具体执行这些概念。如果你从未创建过网络游戏,强烈建议您详细阅读本指南,然后试图创建一个。

High Level Overview 高级概述

This section will outline all the concepts involved in networking. It will serve as an introduction to deeper topics.

本节将概述在网络所涉及的所有概念。这将作为一个更深的主题。

Networking Elements in Unity 在Unity中的网络元素

This section of the guide will cover Unity's execution of the ideas discussed above.

本节讲述Unity执行上面章节中所讨论的的思想。

RPC Details 远程过程调用的细节

RPC stands for Remote Procedure Call. It is a way of calling a function on a remote machine. This may be a client calling a function on the server, or the server calling a function on all or specific clients, etc. This page explains RPC concepts in detail.

RPC表示远程过程调用。这是在远程机器上函数调用的方式。这可以是客户端调用服务器上的函数,或是服务器调用所有或指定客户端的函数,等等。这页的详细讲解了RPC的概念。

State Synchronization 状态同步

State Synchronization is a method of regularly updating a specific set of data across two or more game instances running on the network.

状态同步是一个定期更新的数据,跨越两个或两个以上的游戏在网络上运行的实例,具体设置的方法。

Minimizing Bandwidth 尽量减少带宽

Every choice you make about where and how to share data will affect the bandwidth your game uses. This page will share some details about bandwidth usage and how to keep it to a minimum.

每一次选择,以及如何共享数据,会影响游戏所使用的带宽。这个页面将分享一些有关带宽使用情况的详细信息,以及如何保持它到最低限度。

Network View 网络视图

Network Views are Components you use to share data across the network. They are extremely important to understand. This page will explain them in detail.

网络视图组件用来通过网络共享数据,理解它们是非常重要的,此页将详细讲解。

Network Instantiate 网络实例

One difficult subject in networking is ownership of an object. Who controls what? Network Instantiation will determine this logic for you. This page will explain how to do this. It will also explain the complex alternatives, for situations when you just need more control.

在网络中的一个棘手的问题是对象的所有权。谁控制什么?网络实例,将决定这个逻辑。本节会讲解如何做到这一点,当你还需要更多的控制的情况下,还将讲解复杂的替代方案。

Master Server 主服务器

The Master Server is like a game lobby where servers can advertise their presence to clients. It is also a solution to enabling communication from behind a firewall or home network. When needed it makes it possible to use a technique called NAT punchthrough (with help from a facilitator) to make sure your players can always connect with each other. This page will explain how to use the Master Server.

主服务器就像一个游戏大厅,服务器可以向客户端通知它们的存在。它也解决启用防火墙或家庭网络的通信。当需要时它能够使用称为NAT穿透的技术来确保玩家总能连接彼此。这样将讲解怎样使用主服务器。

页面最后更新:2010-01-06