用于多人游戏的完全/半自治 P2P 网络的可行性如何?
我一直在思考如何创建一个 P2P 系统(就像用于文件的 BitTorrent)来玩多人游戏。 这个想法是从多人游戏架构中删除传统服务器。 我知道启动通信和发送世界更新等可能需要某种服务器,但我对如何减少服务器上的负载和带宽压力感兴趣。
顺便说一句,这适用于任何规模的游戏,从两人跳棋游戏到 30 名以上玩家的 FPS。
我疯了吗?
I've been mulling over how one would go about creating a P2P system (like BitTorrent is for files) for playing multiplayer games. The idea is to remove the traditional server from the multiplayer architecture. I understand that some sort of server may be necessary for initiating the communications and sending world updates etc, but I'm interested into how you would reduce the load and bandwidth pressures on the server.
By the way, this goes for any size game, from a two player checkers game right up to a FPS with 30+ players.
Am I crazy?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
最大的问题不是带宽、延迟或游戏状态的分布变化。 最大的问题是信任。
如果我告诉你我杀死了一个怪物,你如何验证我确实做到了? 你如何验证我是否真的达到了45级? 你如何验证我没有传送到世界各地? 请记住,您无法检查服务器的每一个小细节:这就是我们试图避免的!
你需要玩家观察玩家,即使这样他们也可能会合作作弊。 我真的怀疑有人会很快设计出一款值得信赖的 P2P MMO。
The big problem is not bandiwdth or latency or distributing changes to the game state. The big problem is trust.
If I tell you I killed a monster, how do you verify that I actually did it? How do you verify that I'm actually level 45? How do you verify I'm not teleporting around the world? Remember you can't check the server for every little detail: that's what we're trying to avoid!
You need players watching players and even then they might work together to cheat. I really doubt anyone will engineer a trustworthy p2p MMO anytime soon.
我一直在想同样的事情。 我长期以来有一个偏见,认为分布式系统应该是分布式的,不需要中央控制器。 MMO 或类似游戏的问题是每个玩家都应该能够看到相同的“世界”。 你最终会遇到一个类似于爱因斯坦相对论和“同时性”的问题——你们距离越远,你们对世界的看法就越不同。
一般来说,解决方案是您必须能够以足够快的速度将信息传播到您附近的其他客户端(在游戏玩家空间中,不一定是物理空间),以便所有本地玩家同时看到更新。
我怀疑答案是为每个玩家提供一个“服务器”或世界模型,而不是将玩家表示为世界服务器中的向量。
I've been thinking about the same thing. I've got a long-time prejudice that distributed systems ought to be distributed, with no need for a central controller. The issue with an MMO or similar game is that every player should be able to see the same "world". You end up with an issue similar to Einstein-ian Relativity and "simultaneity" -- the farther apart you are, the more your view of the world differs.
In general, the solution is that you have to be able to propagate information to other clients in your immediate neighborhood -- in the in-gamer space, not necessarily physical space -- fast enough that updates appear simultaneous to all the local players.
I suspect the answer is to have a "server" or world-model per player, rather than representing the players as vectors in a world server.
您的问题中有很多事情需要考虑:
1)分布式主控 - 那么谁开始游戏? 我在哪里可以找到第一个节点? 如果每个人都决定同时关闭他们的 P2P 客户端怎么办? 世界末日了吗?
2) 分散的规则 - 谁能确认 102235 名玩家中的 77 名在 x,y,z 处杀死了怪物? 我发现在没有“总指挥”的情况下进行黑客攻击/作弊会遇到很大的麻烦......
3)延迟 - 客户端何时收到所有数据? 如果互联网坏了怎么办? 或者在局域网游戏中,如果硬盘坏了怎么办——这会让其他人的游戏变得疯狂吗?
我确实认为P2P的思想很有趣,但就像在所有比赛中一样,我相信我们需要一个能够处理规则的“法官”,因为当你与“匿名者”竞争时,“可以作弊”很多认为。
我认为某种网格计算可能是做到这一点的方法,但同样,如果网格中的某些内容脱落或渲染世界和发送结果太慢......那么我们就会让整个游戏“滞后”。 . = 对每个人来说都是糟糕的游戏...这已经在许多带有主服务器的 FPS 游戏中看到了。 如果网络协议不能很好地处理延迟,那么击中正在奔跑的人就会变得更加困难,或者他们会突然朝你的脸开枪。
一个昂贵的解决方案可能是拥有“子服务器”(代理游戏服务器),其中一些数据更接近玩家。 我相信这需要你能够访问世界各地的许多服务器场(就像暴雪对WOW所做的那样),或者你将不得不发明某种智能“P2P主机”,当带宽不足时,它会将自己升级为“子服务器”足够大并且有足够多的玩家接近它(总是从它的角度检查滞后......)......现在让我们说这是可能的......如果这个子服务器和全局主游戏循环之间的线被打破怎么办再次?
哈哈...这可以继续下去...听起来越来越像互联网上的普遍问题:-)
快乐编码...!
There are many things to consider in your question:
1) Distributed master - who starts the game then? where can I find the first node? what if everyone decides to close their P2P client at the same time? does the world end?
2) Distrubuted rules - who can confirm that player 77 out of 102235 killed a monster at x,y,z ? I see BIG troubles in hacking/cheating with out a "chief in command"...
3) Latency - when has a client recieved all data? what if the internet breaks down? or in a LAN game, what if the harddrive dies - will this crazy the game for everyone else?
I do believe that the P2P thought is interesting, but as in all competitions, I believe that we will need a "judge" who can handle the rules, because when you are competing against "anonymous people" then its "okay to cheat" a lot thinks.
I think that some sort of grid computing might be the way to do it, but again, if some in the grid falls out or are too slow for rendering world and sending results back.. then we have the whole game "lagging"... = terrible game for everyone... this is already seen in many FPS games with a master-server. If the network protocol doesnt handle lag too well, its getting harder to hit a person running or they appear out of nowhere shooting you in the face.
An expensive solution might be to have "subservers" (proxy-game-servers) where you have some of the data more close to the players. This I believe would require you to have access to a lot of serverfarms around the world (as Blizzard does with WOW) or you will have to invent some sort of intelligent "P2P host" that will upgrade itself to "subserver" when then bandwidth is big enough and enough players are close in proxsamity of it (always checking the lag from its point of view... )... now lets say that was possible.. what if the line is broken between this subserver and the main gameloop globally again?
LOL... this could go on... it sounds more and more like the general trouble with the Internet :-)
Happy coding... !
我当然不是专家,但这对我来说听起来有点疯狂。 根据我的经验,由于带宽和性能的原因,您需要专用的游戏服务器。 如果使用 P2P,您将失去这两样东西。 在我看来,P2P 有很多好处。 其中包括分发文件和研究。 然而,这两件事不需要实时数据。 如果您有某种大型多人游戏世界,那么您可能会使用 P2P 来分发游戏文件,甚至可能卸载数字运算。
我想说可能性是存在的,但虽然潜力巨大,但数量似乎有限。
I'm certainly no expert, but it sounds a little crazy to me. In my experience, you need dedicated game servers because of bandwidth and performance. With P2P you would lose both of those things. In my opinion, P2P is good for a few things. Distributing files and research are among them. However, those 2 things don't need real time data. If you had some sort of massively multiplayer game world, then you could probably use P2P to distribute game files, and maybe even offload number crunching.
I would say there are possibilities, but the number of them seem limited, although potentially powerful.
我认为这在理论上是可能的,但还有很长的路要走。
正如其他帖子中所指出的,通过仅保证附近其他玩家的更新,可以保持较低的延迟。 这在分布式游戏中已经进行了很多年。
通过让多个节点负责每条数据,可以将数据丢失保持在可容忍的水平。
关于信任问题,有可能制定一个协议,让玩家可以“挑战”另一个玩家以揭露作弊行为。 即挑战者会复制其他玩家计算的某些部分并要求比较结果。 已经有加密协议可以做这类事情,但我不知道细节或它们在实践中是否可行。
我认为真正的问题是没有理由开发这样的系统。 成本会很高并且会增加复杂性,但游戏体验(产品)不会得到显着改善。 省钱活动必须节省比成本更多的钱才能可行。
I think this is probably possible in theory, but it is still a long way off.
As noted in the other posts, the latency could be kept low by only guaranteeing updates to other players who are nearby. This has been done for many years in distributed games.
Data loss could be kept at tolerable levels by letting several nodes be responsible for each piece of data.
Regarding the trust problem, it would be possible to have a protocol where a player could "challenge" another player to uncover cheating. I.e. the challenger would duplicate some part of the other players computation and ask to compare the results. There are already cryptographic protocols which do this sort of thing, but I don't know the details or whether they are feasible in practice.
The real problem as I see it is that there is little reason to develop such as system. The cost would be high and add complexity, but the game experience (the product) would not be significantly improved. A money-saving activity must save more money than it costs in order to be viable.