User Tag List

Page 1 of 2 12 LastLast
Results 1 to 40 of 64

Thread: Pull Request - World Origin Shifting in MP

  1. #1
    7
    Promoter
    Join Date
    Jan 2015
    Posts
    153

    Post Pull Request - World Origin Shifting in MP

    Merged.

    Hello everyone.

    Probably everyone knows about floating point precision issues with big worlds in UE4. Sometimes some jitter (anims, camera) starts to appear only 2-4 km from origin (especially noticeable in first person games).
    Since UE4 uses single point precision - only possible way to fix it is using world origin shifting. But it not works in multiplayer at the moment.

    So, I am working on PR to Epic with support for origin shifting in multiplayer. Goal is to make it able to transparently use independent origins in each client/server.

    Basic idea is simple as a stone: lets include sender's origin value each time client/server going to replicate coordinates over network. In such a case receiver is able to resolve received location/origin on local origin value and work as usual.
    But sending origin with every coordinate could cause some additional bandwidth usage. In order to avoid it - sender tries to resolve location/origin to zero origin before transmitting (if origin value is not too high - to avoid precision issues). With such trick it is possible send zero origin value as single bit flag (OriginIsZero).

    Yes, in case of really big differences in client/sender origins it still could cause some some issues for server-driven physics. But in most of cases (animations, IK, client physics, tracing, camera location, particles) it works like a charm.

    It was required to find every place where engine replicates coordinates and apply such logic there. You could get branch here - https://github.com/michail-nikolaev/UnrealEngine/tree/mp_origin_shift . I hope you able to access if you have access to Epics UE4 repo.

    Currently everything is ready for about 90%.
    Supported things: actor spawn, physics, character movement, pawn movement, remote proxy movement, root motion, object-based movement, blueprints functions, network relevancy, etc. Need to finish matinee data replication (what hell is it? )

    This is example how it works so far. Red sphere - is location of origin on each client/server. Number on top of the character - distance to world origin.


    You could get test project here.
    Keys: P - put origin to player location, Q, E, Z - spawn different types of object, T - teleport to distanced location, R - play root motion.

    Most of the things work out of the box, but one thing you need to keep in mind: if you manually sending coordinates over network (as Vector) - engine have no idea about its semantic. So, you need to use some functions provided but it is pretty simple.
    It is looks like this (converter for Vector and OriginBasedPosition):

    OriginBasedPosition structure uses OriginIsZero flag optimisation out of the box.

    So, I will happy if you could to try this branch (based on 4.11) on your project to test how it works (don't forget about manual coordinate sending!). Especially interested in world composition tests.

    Thanks a lot.

    UPD: Official feature request ID: UE-13079
    UPD2: Looks like everything is now supported, going to prepare pull request.
    UPD3: Branch ready https://github.com/EpicGames/UnrealEngine/compare/release...michail-nikolaev:mp_origin_shift
    UPD4: Pull Request is submitted: https://github.com/EpicGames/UnrealEngine/pull/2359
    UPD5: Pull Request is updated according to EPIC review: https://github.com/EpicGames/UnrealEngine/pull/2359
    UPD6: MERGED!
    Last edited by nkey; 10-06-2016 at 11:40 AM.

  2. #2
    3
    Kudos!

    We cant have features like this soon enough....

  3. #3
    1
    Judging by the UE4 Roadmap, Epic may already have something in the works:
    https://trello.com/c/M4LgGSUW/118-large-world-coordinate-system

    Not sure the status of this system, just that it may exist and conflict with yours.
    May need Epic to chime in here.
    Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.


  4. #4
    0
    Promoter
    Join Date
    Jan 2015
    Posts
    153
    Quote Originally Posted by Kris View Post
    Judging by the UE4 Roadmap, Epic may already have something in the works:
    https://trello.com/c/M4LgGSUW/118-large-world-coordinate-system

    Not sure the status of this system, just that it may exist and conflict with yours.
    May need Epic to chime in here.
    Yep, but card in Wishlist/Backlog for 2 years...

  5. #5
    1
    Luminary
    Join Date
    Mar 2014
    Posts
    1,700
    When you do a Pull request - I will give you my support

  6. #6
    1
    Champion

    Join Date
    Mar 2014
    Posts
    852
    This is interesting, nice work!
    This are the kind of things we need.
    Hevedy - Image Tools: https://hevedy.itch.io/imagetools

  7. #7
    0
    Promoter
    Join Date
    Jan 2015
    Posts
    153
    Did some tests, works fine with level streaming + world origin rebasing in MP (but dedicated server required to load all levels)


  8. #8
    1
    Looks great! Will test out later

    Regards,
    Benjamin D. Smith

    Founder & CEO | Binary Sword Pty Ltd
    Currently working on: ODIN Tracker (UE4 Plugin)

  9. #9
    0
    Supporter
    Join Date
    Jul 2015
    Posts
    2
    Keep it up nkey. Great work!

  10. #10
    1
    Awesome work @nkey.

    When you say the server has to load all maps - does it need to load *all* the maps, or just all the maps that clients have loaded? The latter would probably be a decent optimization.

    And if you want to get really deep into this, if you could make it so that separate servers can host the individual levels, that would be insanely good/useful!
    Storyteller - An immersive VR audiobook player

    Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

  11. #11
    1
    This is awesome. I had been wishing this from Epic some months ago. I really hope this will get integrated into the main line.

  12. #12
    0
    Promoter
    Join Date
    Jan 2015
    Posts
    153
    Quote Originally Posted by n00854180t View Post
    Awesome work @nkey.

    When you say the server has to load all maps - does it need to load *all* the maps, or just all the maps that clients have loaded? The latter would probably be a decent optimization.

    And if you want to get really deep into this, if you could make it so that separate servers can host the individual levels, that would be insanely good/useful!
    Currently dedicates server loads all maps (even client is not on it) - it is logic in current main line.
    Regarding separate servers - currently it is out of scope.

  13. #13
    1
    Name:  eab.jpg
Views: 4722
Size:  38.0 KB
    (of course)

  14. #14

  15. #15
    1
    Luminary
    Join Date
    Mar 2014
    Posts
    1,700
    @nkey - Let me know when you make the pull request

  16. #16
    1
    Quote Originally Posted by Kris View Post
    Judging by the UE4 Roadmap, Epic may already have something in the works:
    https://trello.com/c/M4LgGSUW/118-large-world-coordinate-system

    Not sure the status of this system, just that it may exist and conflict with yours.
    May need Epic to chime in here.
    @nkey - True.
    Ditto on mirrored animation support :P

    Ok, sp I have no use for the feature in current project, but I'm more then happy to support the feature, as it is useful to others.
    Please let me know when and what to do when the times comes.
    Cheers.
    Rule#21: Be polite, be professional, but have a plan to kill everyone you meet.


  17. #17

  18. #18
    1
    Quote Originally Posted by nkey View Post
    404 Dead link for anyone else?

  19. #19
    1
    Quote Originally Posted by franktech View Post
    404 Dead link for anyone else?
    UnrealEngine on GitHub is private.

    You have to be signed in to GitHub to see that page.

  20. #20
    1
    Added my support to the Github comments
    Storyteller - An immersive VR audiobook player

    Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

  21. #21

  22. #22
    1
    Quote Originally Posted by franktech View Post
    404 Dead link for anyone else?
    You must A. Be signed into GitHub, and B. Link your GitHub account with your Epic account (Account settings).

    Regarding the PR, I would love to see this in 4.12
    Marketplace Assets

    Advanced Mobile Input: Marketplace Page | Support Thread ――― Easy Input Remapping: Marketplace Page | Support Thread
    Multiplayer Blueprint Chat System: Marketplace Page | Support Thread ――― Closing Credits System: Marketplace Page | Support Thread
    Minesweeper Template: Marketplace Page | Support Thread ――― Maze Creator: Marketplace Page | Support Thread

  23. #23
    1
    Regards,
    Benjamin D. Smith

    Founder & CEO | Binary Sword Pty Ltd
    Currently working on: ODIN Tracker (UE4 Plugin)

  24. #24
    2
    Quote Originally Posted by Rhynedahll View Post
    UnrealEngine on GitHub is private.

    You have to be signed in to GitHub to see that page.
    Quote Originally Posted by Jamendxman3 View Post
    You must A. Be signed into GitHub, and B. Link your GitHub account with your Epic account (Account settings).

    Regarding the PR, I would love to see this in 4.12
    Cheers guys! For anyone else new to Github...

  25. #25
    0
    Luminary
    Join Date
    Mar 2014
    Posts
    1,700
    @nkey - Has there been any news on this from Epic?

  26. #26
    0
    Promoter
    Join Date
    Jan 2015
    Posts
    153
    Nope, silence.

  27. #27
    0
    Luminary
    Join Date
    Mar 2014
    Posts
    1,700
    Quote Originally Posted by nkey View Post
    Nope, silence.
    I will poke someone on the engine team to see the status of this PR

  28. #28
    0
    You have no idea how much I want this, for both the city sized game I'm making now, and the world sized game I'm making tomorrow.

    aaand maybe a space game one day. I've SEEN what happens when you don't do it - Kerbal Space Program has this issue.

  29. #29

  30. #30
    0
    Any new news from epic on this?

    I'm up to dealing with origin shifting in Eden (again) and this will be the thing that determines whether or not I can support multiplayer in it...

  31. #31
    0

    4.13 maybe... Big thanks to nkey for this!!!

    Quote Originally Posted by ioFlow Studios View Post
    Any new news from epic on this? I'm up to dealing with origin shifting in Eden (again) and this will be the thing that determines whether or not I can support multiplayer in it...
    Simon, see below... Try to use your 'spotlight' clout to nudge / remind Epic
    (I've read 4.13 is still some months away, probably September at the earliest...)

    A lot of devs are calling for DGI and Dynamic Terrain etc as Epic priorities.
    But many projects will hit a total standstill without MP features like this.
    So @nkey just want to shout out a big thanks, you're a real hero here!

  32. #32
    0
    This feature is really exciting for many people who want to be able to make larger scale multiplayer.... No not infinite worlds or planet size... but arma size
    Twitter - @TheKRushin

    Feel free to ask questions and come learn to be an #UnrealDev

    How to report a Bug

  33. #33
    0
    Hey, you got feedback! Nice!

  34. #34
    0
    Luminary
    Join Date
    Mar 2014
    Posts
    1,700
    I am really looking forward to this

    Will this be in 4.13?

  35. #35
    0
    Promoter
    Join Date
    Jan 2015
    Posts
    153
    I hope so...

  36. #36
    0
    Didn't see it in the 4.13 release notes. If it's true that the larger cordinate system request has been on the backlog for two years (and considering it's on the 2017 backlog now) it could be a while before we see any Epic implemented solution... tis a shame

  37. #37
    1
    Promoter
    Join Date
    Jan 2015
    Posts
    153
    Quote Originally Posted by Blakeanator View Post
    Didn't see it in the 4.13 release notes. If it's true that the larger cordinate system request has been on the backlog for two years (and considering it's on the 2017 backlog now) it could be a while before we see any Epic implemented solution... tis a shame
    Seems like planned to merge into 4.14

  38. #38

  39. #39
    0
    Grats on getting this merged This is going to be great for seeing more large scale multiplayer indie games.
    Storyteller - An immersive VR audiobook player

    Dungeon Survival - WIP First person dungeon crawler with a focus on survival and environmental gameplay ala roguelikes

  40. #40
    0
    Luminary
    Join Date
    Mar 2014
    Posts
    1,700
    This is awesome - Cannot wait for 4.14

Page 1 of 2 12 LastLast

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
  •