layer tells Server what they want to do --> Server determines what happens --> Server tells client players how to update".从根本上讲,只是一个在游戏玩家想发生的事情和实际发生的事情之间的一个隔层。这允许服务器侦听到每个人想做什么,执行游戏规则的逻辑(与游戏到游戏的有所不同)然后告诉每一个客户端当前正发生了的事情。我们可以把这个过程看作是"玩家告诉服务器他们想做什么--> 服务器处理什么发生--> 服务器告诉客户端更新世界所需的数据"An advantage of using this approach is that it makes cheating much harder for clients. For example, they do not have the capabilities to tell the server (and thus all clients) "I killed your character" because of the technical limitations of the network communication. They can only tell the server "I fired my weapon" and the server determines whether or not a kill was made.使用这种方案的优势是使得游戏难以出现客户端的欺诈行为。例如,客户端不能告诉服务器(或者其他客户端)"我搞定了你的角色"应为网络通信的技术限制。他们只能告诉服务器"我开火了"然后服务器决定是否或者完成了一次击杀。Another example of an authoritative server would be the following for a physics game: "
layer client sends input to the server --> Server ***ns physics simulation and determines all collisions & effects of collisions --> Server sends updates of object positions to the player client". This means that while each player client appears to be ***nning a full physics simulation, they are not. They are only receiving the result of the physics simulation that was performed by the server.授权服务器的另一个例子是体现在接下来的一个物理游戏中:“用户客户端发送输入到服务器->服务器完成物理计算然后检测所有碰撞和碰撞的效果->服务器发送物体的更新到用户客户端”。这意味着每一个用户客户端看起来正执行着完整的物理计算,但实际上他们没有,他们只是接收由服务器计算后的物理计算的结果With an authoritative server local movement has no effect until the server has reacted to it, which can look unnatural to the player. So if you press the go forward button, nothing will happen for possibly 100 ms if there is a 50 ms trip time in each direction. To combat this a technique called Client Side Prediction is used. This guide will not explain Client Side Prediction in depth, as it is a very technical and specialized technique. Essentially, it is a method of allowing each client to operate in the way that it believes it should, and receive corrections from the Server only if it calculates something incorrectly. The server can then override the actions of a client when it predicts something incorrectly. For more information on Client Side Prediction, simply Google the term.使用一个授权服务器,直到服务器做出反应,本地的移动才会真正生效,在玩家看起来这可能不可思议。因此如果你键入一个向前的按钮,可能100ms内不会发生任何事情,因为单边的数据传输可能超过了50ms.用来解决这个问题的技术被称作客户端预告。本指南不会深入解释客户端预告本身,这是一门特别而且非常技术性的工作。简单来说,这是一种允许客户端以它假定自己可以完成操作的方式行为。如果它做出了错误的预测,可以从服务器端得到纠正。服务器能够更正客户端的行为当它错误的预测某些事情的时候。关于客户端预测技术的更多信息,请在Google上搜索.Making the server authoritative requires a greater processing load on the server. Imagine the server receiving a variety of different processes and commands from 32 different players in an action game. He needs to process each user input and decide what is legal and not legal sometimes resolving conflicts between clients.授权服务器还必须在服务器具备更强大的处理能力。请设想在一个动作游戏中通常服务器会同时超过32个不同用户的命令和各种各样不同的处理。服务器需要处理每个用户的输入和有时还要在客户端之间处理冲突,然后决定什么是合理的,什么是不合理的。| 欢迎光临 纳金网 (http://go.narkii.com/club/) | Powered by Discuz! X2.5 |