Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Physics based movement in multiplayer, sync issues

This has been driving me mad, I can't get an accurate way to do this working. I had a very smooth and nice network script working, but I found that it quickly became out of sync between the various clients.

My goal:

  • Client-side physics based movement (because my controls need to be very responsive, can't wait for server to say "Yes that's ok")

  • Replication of this movement to other clients via the server (Doesn't need to be physics based but does need to be smooth)

What I tried originally:

  • Method: Replication of setting physics values on the characters.

  • Result: Very smooth movement on all clients, responsive, but quickly became out of sync

  • Conclusion: Not a huge surprise, latency would mean the application of the physics values would be timed differently

What I tried to fix this with:

  • Method:

  • Local physics based movement.

  • Kinematic replication of character rotation and position on the server, replicated other clients.

  • Result: Actors with "Simulate Physics" can't have kinematic based property applied to them, so it didn't work at all.

  • I then tried using an Authority switch to turn off Simulate Physics on the server side, but this didn't help as I assume the remote clients still had it enabled so ignored the replicated movement they were asked to do.

    I am thus at a loss. How on earth can I do this? I'm sure its possible, I'm just not seeing how!

    Product Version: Not Selected
    more ▼

    asked Aug 17 '14 at 08:12 AM in Blueprint Scripting

    avatar image

    16 4 6 5

    avatar image Marshiell Oct 09 '14 at 06:58 PM

    This concerns me as well. Why aren't there any answer on that point on any other topics?

    avatar image Qndel Oct 13 '14 at 08:34 AM

    Hello, let me join you in your problem. My physics game also gets out of sync, despite being an example 'blueprint rolling' project.

    avatar image Durandle Oct 13 '14 at 08:49 AM

    What I did find out is that you either (a) Have to create a very complicated system of applying physics locally to re-sync all network entities using physics (there is a forum post about it somewhere, though the guy doesn't share his work) or (b) you run all the physics simulation server side only. The downside to this is that if you have any network latency what so ever, controls are going to feel horrible and slow.

    avatar image Marshiell Oct 13 '14 at 04:50 PM

    Well that is disappointing. Thank you for your answer

    avatar image Durandle Oct 14 '14 at 03:08 AM

    It does make sense though. Consider how physics work and that any latency what-so-ever from client to client means the physics are applied slightly later remotely as they were locally. That means everything in the game will interact with that entity slightly differently, which is a snowballing effect.

    I was mainly hoping that UE4 would have some sort of auto-syncing/auto-correcting network physics that can run locally, but it seems not. Even if it did, I suspect overall it would be very network heavy. I've reverted to using standard input control, which is still vaguely physics based, you just can't apply physical forces the same way.

    avatar image Marshiell Oct 14 '14 at 03:24 PM

    I find it surprising that making a simple multiplayer racing game could be that complicated.

    avatar image Qndel Oct 13 '14 at 10:02 AM

    Seems that desyncing is not my only problem, server and clients are flickering between client/server view even on some projects that work flawlessly for other people, I have no idea what's wrong with my UE :/

    (comments are locked)
    10|2000 characters needed characters left
    Viewable by all users

    1 answer: sort voted first

    You're going to have to copy the bone and other transformations to server and then to clients every few frames. No other way around it.

    more ▼

    answered Oct 16 '14 at 04:18 PM

    avatar image

    2k 62 24 111

    avatar image mightyenigma Mar 14 '18 at 03:54 AM

    How do we do that? Do we have to create an array to store every transformation every frame and then send that array through a client-to-server RPC and have it send that array to all the clients?

    (comments are locked)
    10|2000 characters needed characters left
    Viewable by all users
    Your answer
    toggle preview:

    Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

    Follow this question

    Once you sign in you will be able to subscribe for any updates here

    Answers to this question