Tag Info

Hot answers tagged

14

I am going to approach this from a high-level discussion and then work towards your questions. For the sake of disclosure, I have no personal experiencing using socket.io but a lot of exposure to the problem space with regards to MMORPGs. The design of an MMORPGs engine's network architecture and/or the selection of a middle-ware or open source project to ...


13

I have created a framework specifically for creating HTML5 realtime multiplayer games, based on the Client/Server model. In this model, players send only input to the server (keys being pressed) - and the game occurs on the server. The server sends timed world-snapshots to all clients, and clients render themselves say 75 ms back in time from the current ...


7

Do you think it is technically possible to write a fully-fledged 3D MMO client with Browser JavaScript - WebGL for graphics, and WebSocket for Networking? Yes, absolutely. There is no reason WebGL or WebSocket technology would prevent you from making a 3D MMOG client, or any game client for that matter. Do you think future MMOs (and games generally) ...


6

UDP has less overhead, but at the cost of losing packets without knowing about it (part of the overhead with TCP ensures that lost packets get re-sent). However, the big problem with using UDP is that there are many sites that block all UDP traffic (except for DNS) because many administrators believe it's a good security practice. Also, don't assume that ...


6

Sure it is an overhead, but if your packets generally ain't much larger than the example you give it is not much overhead, pretty insignificant relative to general overhead of sending a package. Of course a denser format is a small performance improvement, and it should be considered. At the early development however I'd stick to something like JSON for ...


5

If you need an active connection and literally real-time gameplay, then go with WebSockets, or a similar technique like Comet. Note that WebSockets requires a recent browser, while Comet is probably good enough for most purposes with better support for older browsers. For example, Facebook and Google use Comet for their technologies (Facebook Chat, Google ...


5

I take it all the variable name are broadcast as well. Isn't that a huge overhead? That's the case, and yes that's quite an overhead. Wouldn't it be better if I glued all data together using delimiters like this (...)? The disadvantage here would be that I have to split the string each time I receive it. But isn't that much better for latency? ...


5

Nic explained this to me briefly yesterday. Check out the explanation on his blog. http://nic-gamedev.blogspot.com/2011/11/mmo-architecture-creating-ghosting.html


5

There are already several Browser based MMOs out there. They usually don't use 3D graphics though. I'm a bit sceptic when it comes to WebGL. The current crop of browsers don't support WebGL in their normal release builds. You'll have to get special builds or mess with config files, which is more complicated to the average user than downloading a plugin. ...


5

If you're willing to ease on the requirement that a client should be informed of other clients that are exactly 200 blocks away or closer, then here's an idea: split your map to squares of, say, 200 blocks each side. Then you can keep track of where the client is, and inform the client of all other clients in the adjacent squares. More detailed discussion ...


4

This is too broad, you need to work out some things. What do you call a high-performance server. You can get some very powerful servers with 4 CPU sockets and such. But it is likely 4 servers with a single socket may be cheaper. Real time (meaning each game instance must be processed all the time at some frequency) or turn based (meaning you just need to ...


3

a big one for flash dev is to never compile any secret into the source, because a decompiler can pull it out pretty easily. so any authentication that you need to do should be session based, and not hard coded into the game. other than that it's pretty much the same as web site security, use a session, only send a passphrase over https, etc.


3

Technically possible? Yes. But why bother when web solutions like Unity are available? Future MMOs written in WebGL? No. Ok maybe but there are web based plugins like Unity that do fine right now. Today's JavaScript performance allow this? No. Ok yes if you keep your game simple. Would you use a library like SceneJS [...] or write straight WebGL? ...


3

This is not a direct answer to your question, but gafferongames has some really nice articles on network games: http://gafferongames.com/networking-for-game-programmers/what-every-programmer-needs-to-know-about-game-networking/


3

Refer to this article: http://gafferongames.com/game-physics/networked-physics/ In short: Physics is run on the server according to a stream of input from clients This means the actual physics/collision runs on the sever, and client simply sends player input and renders server output to screen. Server continuously broadcasts required rendering ...


3

SockJS has a test suite which includes some smoke tests that report latency. For example, here's a test that does cursor tracking. Select 'websockets' from the drop down and click 'connect'. Mind that it's hosted in Europe; I get about 30ms. Also note that it polls at 5Hz, so the cursor movement is not an indication of latency, only the 'latency' field is. ...


3

It's quite an advanced topic, and as word of warning I'm hesitant to indulge too much in to this because I only know some theory and haven't actually produced an MMO. In MMOs, optimization is perhaps the primary factor in decision making on the technical side. The more users you are able to host, the better. It's easy to accidentally use poorly scaling ...


3

I'm far from an expert but I've been working on an HTML5 version of Pong that uses Websockets for multiplayer so I can share what's been working for me. The general maxim I've been living by is: "Send the minimal amount of information necessary as infrequently as possible." In my case I maintain the state of the keyboard by listening for the keyup and ...


3

Socket.io will emit connected event for every connected socket. So in your case you will create loads of loops there. It is better to have list of sockets, and one loop separately. As you've said - your case is simple - so keep it simple, do not overcomplicate. var sockets = { }; server.on('connected', function(socket) { // runs for every connection ...


3

You don't necessarily need a timer on the server but you do need the server to be checking time(1) That is, that game should keep track of when the turn started, so that it can compare against this timestamp when it receives moves from the client. (1) Assuming the time limit for turns has any effect on the game results. The rule of thumb with these things ...


2

Take position of player A. Subtract position of player B. Get the length of the resulting vector. If it's under the sightrange, add the other player to a list that a player can see. This will help you with all updates, ie you don't need to send all movement/socials that a player that isn't visible is doing. You can do the initial check fairly seldom(say once ...


2

Here's a real-world example: RuneScape "ticks" once every ~0.6 seconds. You can read about it here. I imagine it simplifies things from their perspective, as in their scripts they probably specify timings and delays in ticks instead of milliseconds. And of course, with such a large/slow tick rate, users with slow connections are not at a huge disadvantage ...


2

Your main priority should be assuming the client talking to your server isn't your flash code, but a program written specifically to try and break the server. Fuzzing is a common technique to try and find this sort of issue. There's also the possibility of a client that instead of trying to break the server it will try to let a real player cheat or automate ...


2

This is not feasable right now (early 2011). You can not create a real-time, 3D MMO in native, browser technologies (meaning no plugins). I won't speculate about the future. This is how it looks right now. Assuming you target only modern browsers (IE9, FF4, etc). If you plan to support IE7 then you are crazy. That will never work. Things missing: full ...


2

Only thing that seems to be there is this: http://www.kaazing.com/download.html As it seems, you have to pay for a full version. If you're not interested in paying, you can either write a server yourself (see the spec) or you can switch the language, you can find more information on that over a the SO WebSocket FAQ.


2

Does this mean I have to maintain a list on the server which player can see another? Basically, yes. The way we did it on a previous project was that each character had 2 lists: one of IDs of the characters that it knew about, and one of IDs of characters that knew about it. (Obviously it's possible to derive the 2nd list from the 1st but it's quicker ...


2

Websockets are definitely the way to go. There are indeed solutions out there that allow you work with websockets smoothly and very fast. A couple were already addressed here and I work for Realtime.co. One of our priorities was precisely providing developers with a way for them to start working with this new technology (with fallbacks, of course) in a very ...


2

Your players may hack your game. Verifying things on the server is good to combat that but potentially bad for performance. Collision detection can fail if not done carefully. Say the particle is moving quickly and you're only testing for intersection with an object. If the particle moves from one side of the object, through the object, and on to the far ...


2

With an authoritative server, there is no way of being 100% fair without exposing the player to latency. There is always the possibility that the player made a sudden move that didn't reach the server before the ball passes the paddle, resulting in the player failing even when he should have hit it. But if the ping is low enough and 100% fariness is not ...


2

Your game timing system should have its own internal clock that is started when the game begins (this can be setup by the server to force clients to be the same). Have you considered using this internal timer? It would be valid, and the same across all clients.



Only top voted, non community-wiki answers of a minimum length are eligible