Jump to content

Multiplayer Platformer devlog


Antriel
 Share

Recommended Posts

I started developing multiplayer online platformer to get back to things that got me to programming in the first place.

I have no idea how it will work out (if at all), but I decided to blog about my progress in a devlog/tutorial fashion.

The first entry is about my proof of concept prototype and why it wouldn't work :)

https://antriel.com/post/online-platformer-1/

Link to comment
Share on other sites

Things are starting to get exciting – moving physics to the server, implementing client-side prediction and server reconciliation.

https://antriel.com/post/online-platformer-3/

The end result, with applied 200 ms lag and 15% packet loss:
prediction-with-latency.gif.092f7cef89499a548455b911d4661f9d.gif

See the post to see a video of how bad it was before the client-side prediction :)

Link to comment
Share on other sites

I am a fan of this series :)

I am not sure if I followed it properly, but it seems to me that demo with only one player shows nothing. If you set 1000ms delay and 50% packet loss, does it still look great in such demo?

I would love to see this in action with two players. And how the second player sees the movements of the first player. So simply two windows next to each other.

Link to comment
Share on other sites

Thanks! It's always super nice to hear that :)

1 hour ago, Jorasso said:

I am not sure if I followed it properly, but it seems to me that demo with only one player shows nothing. If you set 1000ms delay and 50% packet loss, does it still look great in such demo?

Yeah, it would. The reason is that the prediction done on the client is essentially perfect. Which means the prediction will never stray away from what server simulates. The only limitation is length of the `oldInputs` buffer, which I have set up to 2 seconds for now. After which I suppose the server should simply disconnect the user, or maybe allow him to catch up – will see, have to test these things in reality.

2 hours ago, Jorasso said:

I would love to see this in action with two players. And how the second player sees the movements of the first player. So simply two windows next to each other.

That is planned for the next devlog :). Essentially, I will use entity interpolation to achieve smooth movement. That means a client renders other players with a delay. If some of the users lag too much, it will still be noticeable though. Then extrapolation can come into play, but that has its own issues too.

Link to comment
Share on other sites

  • 2 weeks later...

This community rocks! :)

14 hours ago, zeebo said:

Yep that's what I'm doing - Note adding a tc rule on ubuntu only effects outbound packets. If you want to more accurately simulate latency you may want to add outbound latency on windows using Clumsy that way you can test 50ms to server, 50ms back rather then ~2ms to server, 100ms back.

I updated my article based on this new information. We learn something every day. Thanks zeebo!

Link to comment
Share on other sites

I don't recall the exact issue. As far as I remember, I had issues with the general latency settings and how they affected Chrome.

I quickly changed to Netbalancer, and have used that ever since. As well as TC for packet drops. Got tired of dropping them manually.

Link to comment
Share on other sites

  • 2 weeks later...

Another devlog and it's a big one!

Multiplayer Platformer Log #5 – Entity Interpolation

Explaining entity interpolation.
Implementing client-server synchronization using phase-locked loop.
Talking about server update loops.
And lot of shared code.

Finally some worthwhile gif – moving around on a real server with ~200 ms ping:

entity-interpolation.thumb.gif.954ec03d498dd47d1a9c1fb0b084496c.gif

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...