Announcement

Collapse
No announcement yet.

Improve the none splitscreen

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

    #16
    So, All that will be in the character BP?
    They shouldn't move any further if the distance is more than say 300.
    Raed Abbas
    Multiplayer Game System (MGS)
    Dynamic Shared Camera


    IMDB
    FACEBOOK

    Comment


      #17
      In principle yes. But you could do it also in the camera actor blueprint. That way you would have to do it only once and set the character positions from there. If you do it in the character blueprints you would have to do it twice. Or you communicate the data from one character to the other but that would require you to make two different character blueprints: One to do the computations and the other one to receive them.
      If you do the computation in the camera actor the character blueprints could be the same.

      Comment


        #18
        a screen shot of this calculations would make it much easier. Really sorry but the more you guys explain the more confused I get lol
        Raed Abbas
        Multiplayer Game System (MGS)
        Dynamic Shared Camera


        IMDB
        FACEBOOK

        Comment


          #19
          I made a small example script to illustrate what I am talking about. I am sure there are hundreds of other ways to do that and this one is most certainly not the best one but it should keep your characters within bounds.
          This would be part of the event graph of your camera actor.
          Click image for larger version

Name:	camerascript.png
Views:	1
Size:	267.9 KB
ID:	1066625
          I have not tested the script and it might be necessary flip the two character references in the top left corner if the characters start switching positions on each frame.
          Also the 'divide by two' node can obviously be merged with the clamp node but I hope doing it this way makes the 'why' a little bit clearer.

          Comment


            #20
            OMG!!! that's awesome. This made my day... I'm sitting her with tears in my eyes hahaha
            THANK YOU THANK YOU!!!
            Praseodyl, please PM me your name, I will credit you in my prototype.
            This works great and at least the players are in the frame. I was hoping to stop players from running any further but beggar can't be chooser. This works just fine.
            Really many thanks for all your help.
            Raed Abbas
            Multiplayer Game System (MGS)
            Dynamic Shared Camera


            IMDB
            FACEBOOK

            Comment


              #21
              Originally posted by Raed Abbas View Post
              OMG!!! that's awesome. This made my day... I'm sitting her with tears in my eyes hahaha
              THANK YOU THANK YOU!!!
              Praseodyl, please PM me your name, I will credit you in my prototype.
              This works great and at least the players are in the frame. I was hoping to stop players from running any further but beggar can't be chooser. This works just fine.
              Really many thanks for all your help.
              ^ What he said. That was super-helpful! Thanks
              KITATUS
              "Information shouldn't be behind a paywall, It should be free for all!"

              Comment


                #22
                I am glad I could help.
                And don't worry about it. I was in the same place a few month back.

                Comment


                  #23
                  Originally posted by Praseodyl View Post
                  I am glad I could help.
                  And don't worry about it. I was in the same place a few month back.
                  I keep playing my little game and can't believe it's finally working. I tried to run all over the place, jumping, running towards obstacles and your solution is solid. LOVE IT
                  Raed Abbas
                  Multiplayer Game System (MGS)
                  Dynamic Shared Camera


                  IMDB
                  FACEBOOK

                  Comment


                    #24
                    Originally posted by Praseodyl View Post
                    I made a small example script to illustrate what I am talking about. I am sure there are hundreds of other ways to do that and this one is most certainly not the best one but it should keep your characters within bounds.
                    This would be part of the event graph of your camera actor.

                    I have not tested the script and it might be necessary flip the two character references in the top left corner if the characters start switching positions on each frame.
                    Also the 'divide by two' node can obviously be merged with the clamp node but I hope doing it this way makes the 'why' a little bit clearer.

                    /slowclap
                    Let's Connect [Twitter]

                    Comment


                      #25
                      I've been playing with this trying to make it work for 4 players but it seems much more complicated math than what my brain can take lol
                      Any suggestions?
                      Raed Abbas
                      Multiplayer Game System (MGS)
                      Dynamic Shared Camera


                      IMDB
                      FACEBOOK

                      Comment


                        #26
                        That would be more complicated, indeed. But it is definitivly possible. I have an untested idea in my head that you could try out: ( no warranties )

                        - Imagine the locations of your four characters simply as points in space. As a fifth point you have the camera location.
                        - Now find out which of the four points is closest to your camera point.
                        - Now take the forward vector of your camera and find out at which point along the vector the distance to the point found in step two is shortest and remember that point. I will call that point 'p'
                        - Now construct an imaginary plane that includes the point 'p' and has a normal vector that is parallel to the forward vector of the camera.
                        - Now you need to compute the projection of all four points onto this plane.
                        - Now you must determine the smallest rectangle that includes all four points on that plane.
                        - This rectangle is the area of the level that must be shown on the screen. From this point on things should be simpler:
                        - You need to compare the aspect ratio of your viewport to the ratio of the sides of the rectangle: If the aspect ratio of the rectangle is larger than the aspect ratio of the viewport, you will need the larger side of the rectangle for the next step. Otherwise you will need the shorter one.
                        - From this point on you can use the script you allready have: instead of the distance vector between two actors you would use the vector determined in the previous step.

                        I imagine that sounds pretty confusing but I don't believe there is a straight forward solution for this problem.

                        Comment


                          #27
                          WOW, It sounds very intelligent Math. I don't even want trying this. I'm happy with the 2 players for now lol
                          Raed Abbas
                          Multiplayer Game System (MGS)
                          Dynamic Shared Camera


                          IMDB
                          FACEBOOK

                          Comment


                            #28
                            Another way to do this btw (which we did for Eclipse), is to add a force to each pawn instead of using a hard clamp. That way you get a cool 'spongey' feel. Players can escape if they try hard enough, but they'll always get forced back into the viewpoint.

                            Comment


                              #29
                              Originally posted by TheJamsh View Post
                              Another way to do this btw (which we did for Eclipse), is to add a force to each pawn instead of using a hard clamp. That way you get a cool 'spongey' feel. Players can escape if they try hard enough, but they'll always get forced back into the viewpoint.
                              Thank you TheJamsh, hmm, do you have a video showing Eclipse?
                              Raed Abbas
                              Multiplayer Game System (MGS)
                              Dynamic Shared Camera


                              IMDB
                              FACEBOOK

                              Comment


                                #30
                                Now the problem is I can't ask the Event Tick to fire only if the player selected multiplayer mode in the mail menu. Any idea how can I fire the event based on condition?
                                Raed Abbas
                                Multiplayer Game System (MGS)
                                Dynamic Shared Camera


                                IMDB
                                FACEBOOK

                                Comment

                                Working...
                                X