处理网络游戏中的延迟 [英] Dealing with Latency in Networked Games

查看:106
本文介绍了处理网络游戏中的延迟的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑制作网络游戏.我对此并不陌生,已经遇到了很多问题,试图为航位推测和网络延迟制定一个好的计划,因此,我很乐意看到一些有关该主题的好文献.我将介绍我考虑过的方法.

I'm thinking about making a networked game. I'm a little new to this, and have already run into a lot of issues trying to put together a good plan for dead reckoning and network latency, so I'd love to see some good literature on the topic. I'll describe the methods I've considered.

最初,我只是将玩家的输入发送到服务器,然后在服务器上进行模拟,然后将游戏状态的变化广播给所有玩家.这使作弊变得困难,但是在高延迟情况下,由于您无法立即看到自己的操作结果,因此事情有些难以控制.

Originally, I just sent the player's input to the server, simulated there, and broadcast changes in the game state to all players. This made cheating difficult, but under high latency things were a little difficult to control, since you dont see the results of your own actions immediately.

这篇GamaSutra文章提供了一种解决方案,可以节省带宽并显示本地输入也可以通过在客户端上进行模拟来实现平滑处理,但是它似乎使防骗窗口失去了作用.另外,我不确定当玩家开始操纵环境,推开石头之类的东西时该怎么办.这些以前中立的对象将暂时成为客户端需要发送PDU的对象,或者可能有多个播放器一次执行.谁的PDU会获胜?什么时候将停止对每个玩家进行双重跟踪(以与推算得出的版本进行比较)?天堂禁止两名玩家进行相扑比赛(例如,开始互相推手).

This GamaSutra article has a solution that saves bandwidth and makes local input appear smooth by simulating on the client as well, but it seems to throw cheat-proofing out the window. Also, I'm not sure what to do when players start manipulating the environment, pushing rocks and the like. These previously neutral objects would temporarily become objects the client needs to send PDUs about, or perhaps multiple players do at once. Whose PDUs would win? When would the objects stop being doubly tracked by each player (to compare with the dead reckoned version)? Heaven forbid two players engage in a sumo match (e.g. start pushing each other).

此gamedev.net位显示gamasutra解决方案不够充分,但描述了另一种方法并不能真正解决我的协作式巨石推销示例.我发现的大多数其他事情都是针对射手的.我希望看到更适合像SNES Zelda这样玩的游戏,但涉及更多的物理/动量.

This gamedev.net bit shows the gamasutra solution as inadequate, but describes a different method that doesn't really fix my collaborative boulder-pushing example. Most other things I've found are specific to shooters. I'd love to see something more geared toward games that play like SNES Zelda, but with a little more physics / momentum involved.

  • 注意:我不是在这里询问物理模拟-其他库已经介绍了.在网络延迟的情况下,使游戏流畅,反应灵敏的公正策略.

推荐答案

查看Valve在源引擎中的工作方式:

Check out how Valve does it in the Source Engine: http://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

如果是第一人称射击游戏,您可能必须深入研究他们提到的一些主题,例如:预测,补偿和插值.

If it's for a first person shooter you'll probably have to delve into some of the topics they mention such as: prediction, compensation, and interpolation.

这篇关于处理网络游戏中的延迟的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆