Announcement

Collapse
No announcement yet.

Advanced 6DOF movement

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

    #46
    Originally posted by adipFTW View Post
    Nice, that worked fine. In your tutorial video you show how to set up a flying pawn with your plugin, could you make another one showing how to use it with a character-like pawn? I'm basically trying to have a character walk normally when hes inside a structure and as soon as he steps outside, gravity will be disabled and he should have 6DOF. But I'm having problems combining both movement patterns...
    Just add SixDOF component to your character, and when you want to switch to it, simply stop sending inputs to CharacterMovement, and send them to SixDOF. If you want him to fly, set gravity scale to 0 in CharacterMovement. And of course don't forget to reset rotation pitch and roll to 0 on landing.

    EDIT: Alternatively, you can use same inputs as character to control SixDOF too. To do that, you'll first have to deactivate the character movement (otherwise it will consume the input), enable autopilot, and set mode to "use controller input".
    Last edited by moookiexl; 02-06-2017, 10:03 PM.

    Comment


      #47
      Originally posted by moookiexl View Post
      Just add SixDOF component to your character, and when you want to switch to it, simply stop sending inputs to CharacterMovement, and send them to SixDOF. If you want him to fly, set gravity scale to 0 in CharacterMovement. And of course don't forget to reset rotation pitch and roll to 0 on landing.

      EDIT: Alternatively, you can use same inputs as character to control SixDOF too. To do that, you'll first have to deactivate the character movement (otherwise it will consume the input), enable autopilot, and set mode to "use controller input".
      I've tried that with something like this for movement and camera rotation (its a third person character):
      Click image for larger version

Name:	38a09b5eaf.jpg
Views:	1
Size:	115.8 KB
ID:	1122707

      I can move and look around normally at first, but if i toggle the gravity variable, the camera rotation locks and the character moves really weirdly...

      Comment


        #48
        Originally posted by adipFTW View Post
        I've tried that with something like this for movement and camera rotation (its a third person character):
        [ATTACH=CONFIG]128456[/ATTACH]

        I can move and look around normally at first, but if i toggle the gravity variable, the camera rotation locks and the character moves really weirdly...
        Can you send me the project again? The setup as in the screenshot is correct for movement. For rotation it's a bit more complex because in sixdof you have rotation inertia, that could be what's causing "weird" camera movement.

        Comment


          #49
          Originally posted by moookiexl View Post
          Can you send me the project again? The setup as in the screenshot is correct for movement. For rotation it's a bit more complex because in sixdof you have rotation inertia, that could be what's causing "weird" camera movement.
          You have a PM.

          Comment


            #50
            Originally posted by adipFTW View Post
            You have a PM.
            Fixed project sent.

            Comment


              #51
              Binaries for UE 4.15 released.
              Download "SixDOFMovement_110_415.zip"

              Comment


                #52
                Ok, just tried the example project in 4.15.

                I love it. The movement is nice and smooth. Really polished
                Cannot wait to see what else you have planned.

                Comment


                  #53
                  Originally posted by moookiexl View Post
                  Fixed project sent.
                  Thanks, I was able to use that! I have another problem you might be able to help with, its not directly related to this plugin, but maybe to another one of yours: My spaceship has gatling guns, who should inherit the velocity of the spaceship when shooting. I've tried various implementations, but the bullets always collide with my ship, could you EZBallistics plugin help with that?

                  Comment


                    #54
                    Originally posted by adipFTW View Post
                    Thanks, I was able to use that! I have another problem you might be able to help with, its not directly related to this plugin, but maybe to another one of yours: My spaceship has gatling guns, who should inherit the velocity of the spaceship when shooting. I've tried various implementations, but the bullets always collide with my ship, could you EZBallistics plugin help with that?
                    Yes, it will probably help. If EBBarrel is attached to a physics body any bullets fired from it inherit that body's velocity. It however won't work if you're using non-physical movement in SixDOF.
                    And for each EBBullet you can ignore collisions with actor that fired it (until first ricochet or until it travels set distance), this will work regardless of mode.

                    That said, you can make default UE4 projectiles ignore some actors too (see "blaster" blueprint in the sixdof demo project).Click image for larger version

Name:	ignoreactor.png
Views:	1
Size:	92.1 KB
ID:	1123248

                    EDIT: and collision between the actor and the projectile must be set to "overlap" for this to work.
                    Last edited by moookiexl; 02-18-2017, 01:19 PM.

                    Comment


                      #55
                      Originally posted by moookiexl View Post
                      Yes, it will probably help. If EBBarrel is attached to a physics body any bullets fired from it inherit that body's velocity. It however won't work if you're using non-physical movement in SixDOF.
                      And for each EBBullet you can ignore collisions with actor that fired it (until first ricochet or until it travels set distance), this will work regardless of mode.

                      That said, you can make default UE4 projectiles ignore some actors too (see "blaster" blueprint in the sixdof demo project).[ATTACH=CONFIG]129913[/ATTACH]

                      EDIT: and collision between the actor and the projectile must be set to "overlap" for this to work.
                      The problem is, since the ship can have different weapons, they are within their own blueprint, so bullets that may ignore the weapons still hit the ship. I think the bullets hit in the first place, because I cant make them inherit the velocity fast enough. Also they use hit instead of overlap at the moment because apparently thats more accurate.

                      Comment


                        #56
                        Originally posted by adipFTW View Post
                        The problem is, since the ship can have different weapons, they are within their own blueprint, so bullets that may ignore the weapons still hit the ship. I think the bullets hit in the first place, because I cant make them inherit the velocity fast enough. Also they use hit instead of overlap at the moment because apparently thats more accurate.
                        For EasyBallistics this isn't a problem, it can recursively go to actor the launching actor is attached to etc, all the way down to the root actor, and then back up, adding everything else attached. If you're going to make your own, you'll have to create something similar (maybe simplified, assuming there's only 1 level of attachment hierarchy).
                        Making the bullets go faster doesn't really *fix* the issue, it's just masking it (and if someone runs your game at fast enough framerate it will show up again).
                        More reliable way would be to maybe spawn bullets ahead of the ship's hitbox, but even that is a workaround.

                        PS. about overlap being unreliable, someone from Epic mentioned on a stream that this has been for the most part fixed in current version of UE, but I can't find where exactly it was now.
                        Last edited by moookiexl; 02-18-2017, 05:58 PM.

                        Comment


                          #57
                          Originally posted by moookiexl View Post
                          Making the bullets go faster doesn't really *fix* the issue, it's just masking it (and if someone runs your game at fast enough framerate it will show up again).
                          More reliable way would be to maybe spawn bullets ahead of the ship's hitbox, but even that is a workaround.
                          This is how it works, the bullets inherit the guns velocity and add their own velocity, but if thats no good, what do you suggest for a game then? I've already made the spawn point about 1m from the actual muzzle to give it more time to escape the ships vicinity, but they still collide.

                          Comment


                            #58
                            Originally posted by adipFTW View Post
                            This is how it works, the bullets inherit the guns velocity and add their own velocity, but if thats no good, what do you suggest for a game then? I've already made the spawn point about 1m from the actual muzzle to give it more time to escape the ships vicinity, but they still collide.
                            As I said before, make them ignore the ship that spawned them. either by using EB, or in blueprint use "Get Attach Parent" to find what actor the weapon that fired it is attached to, and if it's same as the overlapped actor, ignore the overlap, otherwise treat it as collision.

                            The reason why velocity alone isn't enough, is that you don't really have control over the order in which the actors get updated, and sometimes the ship "goes first", before the bullet can get out of the way.
                            Last edited by moookiexl; 02-18-2017, 07:08 PM.

                            Comment


                              #59
                              Originally posted by moookiexl View Post
                              As I said before, make them ignore the ship that spawned them. either by using EB, or in blueprint use "Get Attach Parent" to find what actor the weapon that fired it is attached to, and if it's same as the overlapped actor, ignore the overlap, otherwise treat it as collision.

                              The reason why velocity alone isn't enough, is that you don't really have control over the order in which the actors get updated, and sometimes the ship "goes first", before the bullet can get out of the way.
                              Hmm allright, ill probably go with your plugin. Another thing we just noticed after packaging the game for the first time in 4.15, our ships cant move at all. This error message gets spammed in our dedicated server log, any idea regarding this?

                              [2017.02.19-18.46.25:509][282]LogPhysics:Error: PHYSX: (C:\Program Files (x86)\Epic Games\Source4.15\Engine\Source\Runtime\Engine\Public\PhysXPublic.h 245) eINVALID_OPERATION : PxScene::lockWrite() detected after a PxScene::lockRead(), lock upgrading is not supported, behaviour will be undefined.
                              [2017.02.19-18.46.25:510][282]LogPhysics:Error: PHYSX: (D:\Build\++UE4+Release-4.15+PhysX_Compile\Sync\Engine\Source\ThirdParty\PhysX\PhysX_3.4\Source\PhysX\src\NpScene.cpp 3020) eINVALID_OPERATION : PxScene::unlockWrite() called without matching call to PxScene::lockWrite(), behaviour will be undefined.

                              Comment


                                #60
                                Originally posted by adipFTW View Post
                                Hmm allright, ill probably go with your plugin. Another thing we just noticed after packaging the game for the first time in 4.15, our ships cant move at all. This error message gets spammed in our dedicated server log, any idea regarding this?
                                Yes, there is something screwy about physics in packaged projects in 4.15
                                On my PC it only seems to affect physics when there's multiple instances of the game running on same computer (even when they're not networked). I'm still trying to figure out what exactly causes it and how to get around it.
                                Last edited by moookiexl; 02-19-2017, 07:45 PM.

                                Comment

                                Working...
                                X