Announcement

Collapse
No announcement yet.

Rolling ball template doesn't work with multiplayer

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Rolling ball template doesn't work with multiplayer

    Hello everyone,

    I'm coming with an issue since this week, I created a ball game 2 weeks ago with simple physics movements and I wanted to be able to spawn 2 ball on the same map (using networking client and server). My ball is a pawn and I use a special game mode to use it. Well when I launch 2 instances of the game my 2 ball are together but only the server is able to move, the client is just stuck (we can see input are working but the ball is forcing without moving). My first idea is that client is not replicated correctly for the server so the ball stay stuck but actually I'm just lost with that and I don't know what to do.

    Today with the 4.1 release I was happy because I was sure that the ball template will work with that and I could probably be inspired to fix my issue but it looks like the exact same issue is happening with the UE4 ball template, when you have 2 ball, only the server can move and the client is stuck and not replicated correctly.

    Please can someone help me? Do you have any idea why this is happening and how it is possible to fix?

    Thanks in advance for your help, the community is really active and that's really a good thing. Just know that I planned to make a big tutorial to create a small ball game (with a lot of small cool feature only in blueprint) but I can't manage to do this without this extra coop feature. So I really hope someone could help me :-)

    Alexandre

    #3
    I actually never thought about adding multiplayer support to the rolling template, but I think it would be a good idea! The upcoming vehicle game does work in netplay, I'll check how that works, and see if we can make it easy to add to any other game using physics.
    Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
    Twitter: @EpicJamesG

    Comment


      #4
      Originally posted by PenguinTD View Post
      Hi, first thanks for the link it's really instructive.

      My real question is, why all the template are working immediately in multiplayer (1st person / 3rd / side / top / ship) and only the ball system is not working? Why is it not taking in charge immediately like the rest of template?
      I'm probably sure this is because it's not a character and it's physics related but I would like to have a confirmation for that.

      I will take a close look to your link anyway maybe I could find some tricks but if someone know why don't hesitate to learn to me :-)

      Comment


        #5
        Originally posted by misterdante View Post
        My real question is, why all the template are working immediately in multiplayer (1st person / 3rd / side / top / ship) and only the ball system is not working?
        I can't say ive checked it out yet as i've not tried the new template.

        I would expect however that it is simply an oversight in how the players have been set up.
        I don't think i've really heard of any multiplayer rolling games, so i am unsurprised nobody remember to fix up the networking.

        Not saying it wouldn't be nice to see it fixed, i'm just saying it sounds plausible to forget to include it, if that was what happened.

        Comment


          #6
          All the templates in 4.0 used our Character class, which has networking built in. That is one of the nice things about it! The new templates (Rolling and Flying) do not use Character, so require additional work to function in multiplayer. I'm not sure we want to complicate Flying by adding replication, but making it work easily for physics simulation sounds like a good idea, so we are looking into it.
          Lead Programmer - UE4 Animation/Physics/Audio Team - Epic Games
          Twitter: @EpicJamesG

          Comment


            #7
            The first answer given seems to talk about the exact issue I have, once you enable physics on your pawn it becomes tricky. But it seems like it's possible to make it work, I suppose I'm not skilled enough with networking but I will keep searshing for it and I hope I could come with a possible siolution if it can help anyone esle :-). My goal is to have something similar to the coop of Portal 2 so I really think that having 2 ball with my actual gameplay can bring some fun and tricky puzzles :-).

            I have planned to make a big tutorial on how to create a complete ball game (jump, double jump, dash, pickup, powers etc...), everything works fine for now so as soon as I have the time hopefully I could use the wiki to add a tutorial :-). And if I can add this coop feature it could be even better, my goad is really to bring as many small features as possible to help people seeing all possibilities of blueprint with only 1 small project.

            thanks you anyway for your answer ;-)

            Comment


              #8
              Originally posted by JamesG View Post
              All the templates in 4.0 used our Character class, which has networking built in. That is one of the nice things about it! The new templates (Rolling and Flying) do not use Character, so require additional work to function in multiplayer. I'm not sure we want to complicate Flying by adding replication, but making it work easily for physics simulation sounds like a good idea, so we are looking into it.
              Thanks james for your activity on Forum, this is just really nice to have someone at Epic here to help us :-). That was my first idea that character already fit with networking that's good to have a confirmation now I'm 100% sure why this is not working with the ball.

              Comment


                #9
                I know this is a very old post, but if there's anyone wondering, here's how I managed to get the rolling ball example working with MP

                to make it work, first we got to understand how phys simulations work with MP:
                imagine all physics objects are contained inside this "mini universe" and each player has it's own copy of it, including the server.
                now imagine a grenade exploding near a barrel, what happens is: the server would push the barrel, then send this "hey, i'm pushing this" information to all clients, this is so to make everybody see the same thing, each "client universe" is updated every so often with the "server universe"

                The problem: all physics simulation HAS to be done on the server, the client only calculates the simulations between server updates, making it impossible for the client to move the ball, since the BP apply a torque force to it

                To make the ball move, the client has to ask the server to apply this force, hence, edit the PhysicsBallBP like this:
                Click image for larger version

Name:	Capturar.PNG
Views:	1
Size:	214.6 KB
ID:	1065940
                doing so, the server will apply the force then update the transform of the ball (speed, position, rotation..) to all clients
                This does make input lag noticeable on the client-side and can only be fix if epic allow the "client universe" to also update the "server universe", or maybe with some C++ fiddling.

                Comment


                  #10
                  Originally posted by LouKs View Post
                  I know this is a very old post, but if there's anyone wondering, here's how I managed to get the rolling ball example working with MP

                  to make it work, first we got to understand how phys simulations work with MP:
                  imagine all physics objects are contained inside this "mini universe" and each player has it's own copy of it, including the server.
                  now imagine a grenade exploding near a barrel, what happens is: the server would push the barrel, then send this "hey, i'm pushing this" information to all clients, this is so to make everybody see the same thing, each "client universe" is updated every so often with the "server universe"

                  The problem: all physics simulation HAS to be done on the server, the client only calculates the simulations between server updates, making it impossible for the client to move the ball, since the BP apply a torque force to it

                  To make the ball move, the client has to ask the server to apply this force, hence, edit the PhysicsBallBP like this:
                  [ATTACH=CONFIG]24326[/ATTACH]
                  doing so, the server will apply the force then update the transform of the ball (speed, position, rotation..) to all clients
                  This does make input lag noticeable on the client-side and can only be fix if epic allow the "client universe" to also update the "server universe", or maybe with some C++ fiddling.
                  works fine with this...nice tip dude

                  Comment

                  Working...
                  X