My first multiplayer online demo!

Posted by
March 5th, 2013 7:42 am

>> Play on my home server >>

>>Play on my home server>>

Screenshot at 2013-03-05 09:25:30


So I started making an online multiplayer thingy. How hard can it be? I asked myself.

Well… PRETTY HARD! Making a game on a single computer has became pretty straightforward to me, but making a game on multiple computers is much more complicated, since I had to synchronize the characters, and make sure to remove and add characters when they connected or disconnected. I used js for both client and server (node.js) and used to do the realtime communication. My code is certainly a huge mess! I had a chunk of code for the client, a chunk of code for the server, and a chunk of code that both had access to, not speaking about libraries.

Anyways, it’s a beginning, and I’d like to see some of you made try it, to make sure the port forwarding and everything is correct. The link will be valid until I will shutdown the computer or my IP adress changes.

>>Play on my home server>>

The link will be down


6 Responses to “My first multiplayer online demo!”

  1. Zelen3d says:

    Now there is still the problem of lag and jerkiness. I am just not sure how to synchronize the movement to prevent it.

  2. timtipgames says:

    Yah it’s still a bit laggy. Here’s some good stuff to start (in case you haven’t read that yet, you should :))

  3. Jorjon says:

    #1 rule of multiplayer games: add a chat.

    Also, you should not wait for the server response to move the character. Move the character and let the server do the collision handling. You don’t need to send to every character the position of everyone.

  4. ippa says:

    You should run a local simulation to give the feeling of non-lag. At the same time you send the same keyinputs to the server which also runs the simulation to send to all other players.

    Of course it would be good if you structure your code so the browser simulation and the server simulation is the very same code.

  5. Zelen3d says:

    I run already a local simulation, that runs the same code as the server simultion . Now that I updated it, both simulations work at 60 frames/second, and the server broadcasts the data at 30fps. The information sent to the server is the total outcome of all the keys pressed, and it is sent every 60fps.

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]