Jump to content
  • Advertisement

AliAman

Member
  • Content Count

    4
  • Joined

  • Last visited

Community Reputation

0 Neutral

About AliAman

  • Rank
    Newbie

Personal Information

  • Interests
    Programming
  1. I am just setting the player's position to the one received by the packet but due to packet loss and packet delay, the movement is jittery and freakin laggy. How should I implement the interpolation. Can you please show the code even if it is sixth grade because I am in grade 11 now I think I might need a review
  2. Thanks. Can you please give some pseudo code?
  3. Thanks for the detailed explanation. What do you mean by timestamp? Is that the time that the player was moved? Can you please give me some pseudo code of how I can go about implementing it? How I can extrapolate? I have tried something like moving the player slowly towards the position received by the packet. This just makes it seem unrealistic and jittery. Please give me some pseudo code or code that you have written to do this, if you are comfortable. Thanks again.
  4. I am working on a multiplayer game which uses UDP protocol in Java. I have a server and multiple clients. The clients connect to the server and they each have their player. When one client moves a player, the position of it is sent to all the other clients connected to the server. The positional data isn't sent from the client to server and then from server to all clients. It is sent directly from the client who moved the player to all other clients connected to the server. The player is then moved in all clients windows according to the positional data sent. I know packet loss exists and there is delay in receiving packets. But I dunno how other games manage to smooth out their multiplayer player movement. Can you explain how they do it and how I can go on implementing it my self. The bottom code is happening in the client who hasn't moved. this is the client who has received the positional data of the client who HAS moved. The bottom code runs when ever the other client moves. // here is some pseudo code of how I manage my player movement. // This packet contains the x and y position of the player who has moved. Packet receivedPacket = new Packet(recievedData); // this is the player which represents the player who has moved. player.setX(receivedPacket.getX()); player.setY(receivedPacket.getY()); The problem is there is very laggy player movement especially if the clients are on different computers. This is most probably due to packet loss and packet delay across the network. I have tried tweaking the player's position to the position that is received by the client. But still there is some lag. Please help me.
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!