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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.