+ Reply to Thread
Results 1 to 3 of 3

Thread: smooth remote player movement

  1. #1
    Senior Member
    Join Date
    Oct 2011
    Posts
    114
    Thanks
    11
    Thanked 0 Times in 0 Posts

    smooth remote player movement

    Hello,

    Looking at the Unity Avatar chat demo, there appears to be a nice way to keep remote players synced nicely and keep tho movement smooth, so I used it in my project. However, the code seems to be based off of the clients current frame rate, and that it continually sends the player position over the wire. At frist, this was a fine way to do things, but the frame in my project is lower than what the avatar chat demo gets, so the movement isn't as smooth. Also, soon there will be other objects that will move much faster than people (like cars) and this really has stuttered movement.

    anyway, what can be done to make remote player movement smooth and accurate? i know of the general ideas of predicting movements, sending just button presses and just sending a Vector over the wire to show which way he is heading,(and have the client calculate the rest), but I would like to see some actual code. Is there another example that es has, or a good book that has some of these more advanced topics explained and shown via code?

    anybody want to share their actual ideas on what they do to keep players synced and moving smoothly?

    thanks

  2. #2
    Administrator tcarr's Avatar
    Join Date
    Dec 2007
    Posts
    7,219
    Thanks
    80
    Thanked 1,087 Times in 1,076 Posts
    Jobe Makar's book has a good discussion of making networked motion smooth, but the code examples are in AS3, not Unity.

    Here are a couple of articles to read (not specifically for Unity):
    What every programmer needs to know about game networking
    Minimizing Latency in Real-Time Strategy Games

    Note that the Avatar Chat example sends position updates using a FIXED update time. It's smoothest if the plugin queue time matches the fixed update time which is given in NetworkTransformSender. If you want to do prediction or easing, that would be done in NetworkTransformReceiver.
    Teresa Carrigan
    Senior Engineer
    Electrotank, Inc.

  3. #3
    Senior Member
    Join Date
    Oct 2011
    Posts
    114
    Thanks
    11
    Thanked 0 Times in 0 Posts
    thanks for the resources. I'm not to worried about the language the materials use to demonstrate how its done, as long as there is some code to see, I can make it work.

    thanks again

+ Reply to Thread

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts