Announcement

Collapse
No announcement yet.

Dynamic gravity for characters

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

    #16
    I wonder if there's a smart way to utilize the Distance Field to determine the gravitational gradient based on arbitrary gravitational influencers...

    Comment


      #17
      Originally posted by YannickLange View Post
      Do you know when you will upload the code? Whatever you do, I think you are doing an amazing job!
      No, I don't know. Sooner than later, because I think I'm almost done.
      Dynamic gravity for characters
      Visual Studio snippets for UE4
      ---------- ---------- ---------- ----------
      SonicGDK / Ashura: Dark Reign
      Heaven of Relics / Relic Madness

      Comment


        #18
        Would love to see a full PR with this feature, having custom gravity will let us do really crazy stuff!
        Sr. Engine Programmer @ www.playspace.com - moritzwundke.com
        Remember: be polite and respect other peoples opinions - Join the Unofficial Unreal Discord Channel - Found a bug? Then use the Bug Report Form to get it fixed ^^

        Comment


          #19
          Originally posted by zalo View Post
          I wonder if there's a smart way to utilize the Distance Field to determine the gravitational gradient based on arbitrary gravitational influencers...


          Rather, what you could do is get the hit position of the floor right before the action (jumping, falling, being launched in the air...), then make a plane out of that position and the normal direction of the plane, and calculate the distance from the player to that plane. There you can generate the gravity gradient easily.

          If your concern is more about gravity gradient to the OBJECT, you might want to do something more customized, like have an actor posing as the center of mass / gravitational center of your object, then raytrace from your player actor to the gravity point actor and calculate that line's collision with the object, and the length of that vector would e distance from the floor, in which gravity gradient can be handled that way :V

          something more customizable could be a bunch of volumes, or combining volumes with the aforementioned point-line method.
          Last edited by Chimera; 03-04-2015, 11:24 AM.

          Comment


            #20
            The code is up! https://github.com/EpicGames/UnrealEngine/pull/957
            The base code branch is official 'promoted' changelist 2484152 (19/Mar/2015) which is newer than version 4.7.3.
            Dynamic gravity for characters
            Visual Studio snippets for UE4
            ---------- ---------- ---------- ----------
            SonicGDK / Ashura: Dark Reign
            Heaven of Relics / Relic Madness

            Comment


              #21
              link is broken

              Originally posted by Xaklse View Post
              The code is up! https://github.com/EpicGames/UnrealEngine/pull/957
              The base code branch is official 'promoted' changelist 2484152 (19/Mar/2015) which is newer than version 4.7.3.
              I have been waiting for this for a long time!!! your link is for some reason broken so could you help me on how to get the version with your code in it? i am already downloading the promoted branch hoping it comes with it but any more info on how to use would be greatly appreciated.

              thanks in advance

              ps: awesome work again!! ;-)

              Comment


                #22
                The link is broken if you aren't logged in GitHub or you aren't in EpicGames organization.

                Once you get 'promoted', you have to get my pull request or download my two modified files, and recompile UE4.
                Dynamic gravity for characters
                Visual Studio snippets for UE4
                ---------- ---------- ---------- ----------
                SonicGDK / Ashura: Dark Reign
                Heaven of Relics / Relic Madness

                Comment


                  #23
                  I don't know why it took my reply so long to get sent since i actually sent another asking something else which i also found the answer to later )

                  But for the most updated question!!! i have downloaded your fork of unreal engine 4 and found and copied the charactermovementcomponent.h and charactermovementcomponent.cc to a safe location

                  So now i have downloaded and will build the promoted version after that i should just replace the promoted files with the two from yours and rebuild correct?

                  Thanks in advance

                  EDIT : so i did the above the engine built correctly but there was no node added related to gravity so i probably missed something would be realy happy if you could help

                  EDIT 2: ok so i think i had to generateprojectfiles (for noobs like me who might make the same mistake)its now working just wondering why all the nodes related to gravity are doubled? there are two identical nodes for everything

                  Other than that its awesome! just one more thing i will be playing around with this until epic adds it to the main branch and hopefully 4.8 will include it but for now the github builds have shown to be realy uncoopretive when it comes to packaging for ios and android so any way to add this the current launcher version of ue 4.7.3? i was thinking of copy pasting your code on to the classes just by opening vs from inside the editor and rebuilding in that way do you think it'l work?

                  Also would be nice if you could give a list of classes and functions you've added that we can use.

                  Again thanks alot for this
                  Last edited by a_najafi; 03-26-2015, 05:51 AM.

                  Comment


                    #24
                    You can probably use the more stable 4.7.3 code branch (don't forget to replace the two CharacterMovementComponent files before recompiling), but I can't guarantee it will work because I didn't test that. Make sure you don't delete what you already have with 'promoted'.

                    No idea about the two identical nodes. You can see the changes if you compare original with modified versions of the files by using a diff program like WinMerge.
                    Dynamic gravity for characters
                    Visual Studio snippets for UE4
                    ---------- ---------- ---------- ----------
                    SonicGDK / Ashura: Dark Reign
                    Heaven of Relics / Relic Madness

                    Comment


                      #25
                      Originally posted by Xaklse View Post
                      The link is broken if you aren't logged in GitHub or you aren't in EpicGames organization.

                      Once you get 'promoted', you have to get my pull request or download my two modified files, and recompile UE4.

                      any chance i could get the two files ?

                      i am interested in how exactly you got this to work because i am working on something similar
                      Last edited by agit; 03-30-2015, 09:25 PM.

                      Comment


                        #26
                        Originally posted by agit View Post
                        any chance i could get the two files ?

                        i am interested in how exactly you got this to work because i am working on something similar

                        my github ID: agitoez
                        You can do it yourself like he said, register an epic games acc, assign it to your github profile and you can see all changes.




                        Any chance general Actor or Pawn support is coming at some point? I want to use the effects of dynamic gravity with Wheeled Vehicle Pawns! Thanks.

                        Comment


                          #27
                          Hi Xaklse

                          This is looking great.

                          One question: did you or do you plan to test it with mobile devices tilt input? The part of the video where you set the gravity direction suggests that it should work "just like that", but... does it?

                          Comment


                            #28
                            I didn't modify gravity direction with tilt input, but I don't think there would be problems because of that.


                            Originally posted by Eduard Gotwig View Post
                            Any chance general Actor or Pawn support is coming at some point? I want to use the effects of dynamic gravity with Wheeled Vehicle Pawns! Thanks.
                            That's up to Epic, but first they have to take the time to integrate my changes, which are a lot. Maybe they have further plans for other classes.
                            Dynamic gravity for characters
                            Visual Studio snippets for UE4
                            ---------- ---------- ---------- ----------
                            SonicGDK / Ashura: Dark Reign
                            Heaven of Relics / Relic Madness

                            Comment


                              #29
                              Originally posted by Eduard Gotwig View Post
                              You can do it yourself like he said, register an epic games acc, assign it to your github profile and you can see all changes.

                              thanks i don't know how i missed that github account field...

                              Comment


                                #30
                                hey there i was wondering how you acheived to get the gravity to be the center of the sphere or in general how to make the gravity based on the floor angle (i could probably set it up using the ray trace to the floor from the character but just wondering ) )

                                also could you refer to us where you set up the gravity stuff so we could possibly change the gravity of actors in general (now that would be legendary)

                                Comment

                                Working...
                                X