Flash游戏服务器建议(Node.js,Red5等) [英] Flash Game Server Suggestions (Node.js, Red5, etc)

查看:145
本文介绍了Flash游戏服务器建议(Node.js,Red5等)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

快速总结:

我们已经完成了一个类似于俄罗斯方块的Flash游戏,它已经准备就绪,可以与多人游戏进行连接。在做了一些研究,并在这里问: Flash套接字,对等功能,我们得出这样的结论:如果没有昂贵的/可疑的adobe软件/服务(FMS / Cirrus)在这个时间点在Flash平台上,xbox / ps3游戏处理网络游戏的方式完成的P2P网络是不可能的。基本上,Flash客户端不允许成为在没有RTMFP协议的情况下监听套接字的主机。



需要建议的问题:

有了这个总结,问题是...什么是最好的方式来实现像俄罗斯方块这样的游戏的网络基础设施,有很多的I / O从用户到用户比方说,一次最多有4名玩家)。鉴于我们不能指定一个单一的球员作为主机P2P风格,我们的选择是:
$ b $ 1)。脂肪服务器游戏逻辑,轻客户更新显示/插值基于服务器更新(Ala Quake)2.轻量级服务器处理胖客户端之间的通信(Ala并行模拟像RTS游戏)

问题是,在网络游戏方面我们缺乏经验,因此对于这些解决方案(甚至是其他解决方案)的利弊,我们真的很感兴趣。我们的俄罗斯方块游戏并不像发送攻击线时那样微不足道,因为当客户清除线路以添加到当前正在进行战斗的其他玩家时。我们需要更多的实时同步。例如,下一个tetriminos的列表是一个单一的共享来源,每个人都在争取理想的作品。最后,根据所选择的实现,我想知道是否有人在游戏服务器上使用Node.js。我假设如果服务器是一个轻量级的服务器只处理客户端之间的数据传输,节点将是一个很好的完美契合。然而,如果游戏逻辑放在node.js服务器上,我会假设计算的阻塞性质会使Node.js的单线程无阻塞I / O方法变得多余?无论如何,在这个问题上的任何意见是非常赞赏。

解决方案

完全披露:我是联合平台的共同创始人。如果你想快速启动并运行,我会建议使用现有的多用户服务器和客户端框架,比如已经建议的或联合平台(www.unionplatform.com) ,同时连接1000个免费)。人们倾向于低估使用可靠的大堂系统和匹配制作全功能多人游戏所需的基础设施工作量。如果您正在从头开始构建,那么您可能会像在核心游戏物理学上一样花费在连接故障转移和重新连接代码上。

在多人俄罗斯方块,我会在服务器上实现权威的游戏/世界逻辑(在联合中,你会使用一个房间模块),并在客户端镜像服务器端的模拟。客户端显示输出,内插服务器端的世界,并提供玩家的输入。这里是一个多人乒乓游戏的例子,使用这种方法:

http://www.unionplatform.com/?page_id=1229

联合的一个潜在的有用的特点是您的情况是它支持javascript websocket除了传统的http通信。



http://www.unionplatform.com javascript支持为您提供了在html5中创建完整的游戏客户端的选项,或者添加了原生的web浏览器客户端来显示统计信息或观看正在闪光的游戏。 union的协议也公开记录(http://www.unionplatform.com/?page_id=86),所以你可以建立任何语言的自定义客户端功能。



out好奇心,你有一个公共链接为您的游戏?



有乐趣!



colin


Quick Summary:

We have a completed flash game similar to Tetris that is ready to be "linked up" for multiplayer. After doing some research and asking here: Flash Sockets, Peer-to-Peer Capabilities , we have come to the conclusion that P2P networking done in the way xbox/ps3 games handle online games is not possible without expensive/dubious adobe software/services (FMS/Cirrus) on the flash platform at this point in time. Basically, a flash client is not allowed to become a "host" listening on sockets without the RTMFP protocol.

The Question that needs Suggestions:

With that summary, the question is... what is the best way to implement the network infrastructure for a game like Tetris, which has quite a bit of small I/O going from user to user (say, a max of 4 players at a time). Given that we can't assign a single player as the host p2p style, our options are:

1.) Fat Server with Game Logic, Light Clients updating display/interpolating based on server updates (Ala Quake)

2.) Light Server handling communication between Fat Clients (Ala Concurrent simulation like RTS games)

The problem is, we are inexperienced when it comes to networking games and therefore would really love some advice on the pros/cons of those solutions (or even other solutions). Our Tetris game isn't as trivial as sending "attacking lines" when a client clears lines to add to the other players currently battling. We need a little more real-time syncing than that. For example, the list of next tetriminos is a single shared source where everyone is "fighting" for desirable pieces.

Finally, depending on the implementation chosen, I'm wondering if anyone has any experience with Node.js on game servers. I'd assume if the server was a lightweight server only handling transfers of data between clients that Node would be a good perfect fit. However, if game logic was placed on the node.js server, I'd assume that the blocking nature of the calculations would make Node.js' single threaded no-blocking I/O approach redundant? Anyway, any advice on the issue is much appreciated.

解决方案

Full Disclosure: I am a cofounder of the union platform.

if you want to get up and running quickly, i would suggest using an existing multiuser server and client framework, such as the ones suggested already or union platform (www.unionplatform.com, free for 1000 simultaneous connections).

people tend to underestimate the amount of infrastructure work required to make a full-featured multiplayer game with reliable lobby systems and match making. if you are building from scratch, you might spend as long on, say, connection failover and reconnection code as you do on core game physics.

in a game like multiplayer tetris, i would implement authoritative game/world logic on the server (in union, you'd use a room module), and mirror the server-side simulation on the client side. the client shows output, interpolates the server-side world, and provides player inputs. here's an example multiplayer pong game that uses that approach:

http://www.unionplatform.com/?page_id=1229

one potentially useful feature of union for your situation is its support for javascript websocket in addition to traditional http communication.

http://www.unionplatform.com/?page_id=1587

the javascript support gives you the option to create full-fledged game clients in html5, or add native web browser clients for displays statistics or spectating games being played in flash. union's protocol is also publicly documented (http://www.unionplatform.com/?page_id=86), so you can build custom client features in any language.

out of curiosity, do you have a public link for your game?

have fun!

colin

这篇关于Flash游戏服务器建议(Node.js,Red5等)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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