网络游戏中如何防止跳位?
我使用基于 .net 的游戏引擎和中间程序(使用可靠的 udp)来处理位置和旋转传输。数据似乎传输正确,但传输位置之间存在跳跃(可能是由于网络延迟)。我尝试过放松这个职位,但没有成功,因为下一个职位来得相当晚。我可以做什么来防止或减少这种影响?
我还希望在该主题上使用 .net(最好是 c#)进行一些实现。
I'm using a .net based game engine and an intermediate program (using reliable udp) to handle the position and rotation transfer. The data seems to transfer correctly but there are jumps between transfered positions (probably from network lag). I've tried easing the position but that didn't work as the next position comes rather late. What can I do to prevent or decrease this effect?
I would also appreciate some implementations using .net (preferably c#) on the topic.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
插值和外推是你应该关注的事情。
看看;
http://en.wikipedia.org/wiki/Extrapolation
http://en.wikipedia.org/wiki/Interpolation
interpolation and extrapolation are the things you should be looking at.
take a look at;
http://en.wikipedia.org/wiki/Extrapolation
http://en.wikipedia.org/wiki/Interpolation
我记得读过一篇关于虚幻引擎中的网络架构的精彩文章。我首先尝试的一个简单的事情是模拟网络帧之间的世界,以便世界时钟独立于网络计时。我想最大的问题是做出重大改变,比如杀死一名玩家——模拟玩家被击中却收到网络更新说玩家成功躲过了子弹,这真是太糟糕了。我已经有一段时间没有阅读链接的文章了,但我相信您会在那里找到详细信息。
I remember reading a great article about the networking architecture in the Unreal Engine. A simple thing I would try first is simulating the world in between network frames so that the world clock is independent of the network timing. I guess the big catch is commiting to a big change, like killing a player – it’s a bummer to simulate player being hit only to receive a network update that says the player managed to dodge the bullet. It’s been a while since I read the linked article, but I believe you will find the details there.