Loonride

Coding Multiplayer IO Pac-Man in One Week (Timelapse)

Recommended Posts

You've done a great job, especially in a week!

I'have a question regarding player movement prediction in multiplayer: when you use the velocity and direction and let's say a player or enemy is heading towards a wall. The distribution of network packages is uneven expectedly. Have you not run into an issue, where a package was in late, that describes a player/enemy turning before hitting the wall, therefore client predicting that it went through the wall, using existing velocity and direction for the prediction. ..I've personally run into this a lot and had to abandon the approach. Is there anything that I'm missing here?

Share this post


Link to post
Share on other sites
On 7/18/2018 at 9:27 PM, Krisztian Varga said:

You've done a great job, especially in a week!

I'have a question regarding player movement prediction in multiplayer: when you use the velocity and direction and let's say a player or enemy is heading towards a wall. The distribution of network packages is uneven expectedly. Have you not run into an issue, where a package was in late, that describes a player/enemy turning before hitting the wall, therefore client predicting that it went through the wall, using existing velocity and direction for the prediction. ..I've personally run into this a lot and had to abandon the approach. Is there anything that I'm missing here?

Here is how I solve this. I adjust the predicted position of an opponent when it runs into a wall in the same way that I adjust your own players position without going through walls. I am doing collision checking for the opponent predicted positions as well for your own player (but only if in visible area). I always try to keep the predicted position within a certain range of the actual position. If an opponent's predicted position starts getting out of that range, I move it the minimum distance possible to get it back into that range, account for any collision. So the most choppy parts are when an opponent changes directions, but choppy movement is minimized by having this acceptable range of inaccuracy.

Share this post


Link to post
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...

  • Recently Browsing   0 members

    No registered users viewing this page.