Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flash Game Server Suggestions (Node.js, Red5, etc)

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.

like image 332
DnisT Avatar asked Aug 04 '11 22:08

DnisT


1 Answers

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

like image 200
colin moock Avatar answered Oct 26 '22 04:10

colin moock