Home | Rules and Guide | Sign In/Create Account | Write a Post | Reddit | #LD48 | #ludumdare on irc.afternet.org (Info)

Ludum Dare 31 — Coming December 5th-8th 2014! — Join the Mailing List!
Also check out the Ludum Dare 30 results!
  • Ludum Dare 31 begins: in 72 days, 22 hours, 32 minutes, 39 seconds
  • (Time might be off, we’ll have it right soon) | Real World Gatherings (Now Open!)


    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 sockets.io 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 :))
      http://gafferongames.com/networking-for-game-programmers/

    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.


    All posts, images, and comments are owned by their creators.

    [cache: storing page]