实时多人游戏(概念问题) [英] Real-time multiplayer game (concept question)

查看:152
本文介绍了实时多人游戏(概念问题)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在阅读来自Valve的这篇文章,似乎解释了他们的架构多人系统。看起来他们通过客户端上的几个滴答来延迟渲染,因此他们可以处理丢弃的数据包,但是他们还会将数据包发送为增量快照(两个相邻状态之间的差异)。



假设我们有时间A,B,C,并且客户端在时间A是正确的,但是在B处丢弃分组,然后在C处接收该分组。如何能够正确地推断在时间C的状态?在C的数据包只告诉(我认为)状态B和C之间的增量,客户端只知道A的状态。我在这里缺少什么?

解决方案

增量不必相对于发送的前一个消息(通过增量或快照)。相反,它们将相对于最后的确认的状态。因此,在上面的示例中,C处的更新可以是相对于A的增量。因此,丢失消息B变得不方便,因为增量越来越大(并且潜在地错误正在累积),但是最终消息将通过并被确认,服务器可以开始发送与该更新状态相关的delta。


I've been reading this article from Valve that seems to explain the architecture of their multiplayer system. It seems they delay rendering by a couple ticks on the client so they can handle dropped packets, but they also send packets as "delta snapshots" (the difference between two adjacent states).

Suppose we have times A, B, C, and the client is correct at time A but drops the packet at B, and then receives the one at C. How can it correctly deduce the state at time C? The packet at C only tells (I think) the delta between states B and C, and the client only knows the state at A. What am I missing here?

解决方案

The deltas don't have to be relative to the previous message that was sent (by delta or snapshot). Instead, they would be relative to the last acknowledged state. So in the example above, the update at C could be a delta relative to A. Losing message B therefore becomes an inconvenience as the deltas are getting larger (and potentially error is accumulating) but eventually a message will get through and be acknowledged, and the server can start sending deltas relative to that updated state.

这篇关于实时多人游戏(概念问题)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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