Announcement

Collapse
No announcement yet.

Dynamic gravity for characters

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

    #61
    Thanks. Got it working, though no idea how to make it work the way Xalske made it work. First part, with dynamic orientation and gravity. I'm trying to set the gravity to the centre of the world (0,0,0) and it always gives odd rotation behavious.
    Should I rotate the capsule and then set the gravity to normalized rotation from the actor location to the centre of the world or how?

    Man, this is confusing. I just don't know and can't figure ouy how to set this up for proper sphere like gravity.
    After a day's break it started working O.o' just like that. Thanks! Brilliant thing

    Comment


      #62
      Is this system applicable to Vehicles? It would instantly solve our problems with completing Track Loops.
      HeadlessStudios.com is now part of TheGameDevStore.com

      Comment


        #63
        Originally posted by Tefel View Post
        I try to update client to not fall, but with no result yet It seems gravity scale and rotation works but not movement direction Anyone can help me with this?

        [ATTACH=CONFIG]54660[/ATTACH]

        I am very confused because on client there is 4x more code executing. It seems server run his own gravity code with different gravity direction. That's why even with no gravity client jitters.

        When I remove ReplicateMoveToServer gravity works fine, but I need replication so I am working on it. Right now it works OK but adding forces so my character is all shaking. Playable but I want to get rid of this mystical force and try to make simple replication. Any ideas?
        The gitter will always happen as the server is trying to set the player to the location it thinks the player should be and the client it trying to set it to its own location and they are basicly fighting each other for the position.

        Once you have both the client and server in sync gravity wise then that gitter should go away. I haven't dug deep into the code to see what exactly that entails yet.

        Comment


          #64
          This is awesome!!! I hope this will be added to next major release.

          Question: as I understand from the video, the character cannot walk from floor to wall at 90°, so you have to put a little curved ramp between them? Is that right? Example: https://youtu.be/IW9E6XzfDbg?t=2m13s

          Actually that totally makes sense, because otherwise you would need special animation for the big step.

          Can't wait to see it in official release.
          Modular Japanese HouseScaffold System
          Snap Plugin for EditorSnap Plugin for Games
          TwitterBlogYoutubeitch.io

          Comment


            #65
            Originally posted by Davixe View Post
            Hi, I've been adapting the xaklse code to the 4.9 version, I spent some hours on doing it (this is my first modification on the ue source code) and I want to share this adaptation with anyone who wants this feature (and, like me, cannot wait to epic to implements it).
            I think there are some bugs, but it works well on my side scroller game. I will do some improvements on the next days
            cpp: http://pastebin.com/sWz0T681 // h: http://pastebin.com/SpXjGtvN
            Also, really thanks to Xaklse for doing this, you saved me a lot of work
            Thanks Davixe, muchas gracias.

            Originally posted by TechLord View Post
            Is this system applicable to Vehicles? It would instantly solve our problems with completing Track Loops.
            Vehicles aren't characters, as far as I know.

            Originally posted by scha View Post
            This is awesome!!! I hope this will be added to next major release.
            Question: as I understand from the video, the character cannot walk from floor to wall at 90°, so you have to put a little curved ramp between them? Is that right? Example: https://youtu.be/IW9E6XzfDbg?t=2m13s
            Actually that totally makes sense, because otherwise you would need special animation for the big step.
            You could listen for wall hit events in blueprints, and change the gravity direction in that moment to align to wall surface. Just a slight reposition would be needed depending on capsule height.
            Ninja Character Code Plugin
            Visual Studio snippets for UE4
            ---------- ---------- ---------- ----------
            SonicGDK / Ashura: Dark Reign
            Heaven of Relics / Relic Madness

            Comment


              #66
              Gravity works great, other than the rotation issues. (which I just haven't had time to address yet)

              Does anyone else have a broken Camera Vector with this build? I can't use camera vector or any children of that (reflection vector, fresnel, etc).

              Comment


                #67
                Someday this could be included in Unreal Engine 4 official Code. Like was spider walk, which has been in UDK! This is a physical phenomenon as important as the gravity is, which should have already been implemented in Unreal Engine 4 Code for non-programmers, or Blueprinters guys. Something, as proposed by Mike Fricker in 01/27, something able to support any sort of gravitational influence, one or multiple influences, this can be very interesting!


                luny
                lunybunny.com
                lunybunny.com

                Comment


                  #68
                  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.
                  I am a part of the Epic games organisation, aswell logged in. I cant seem to find it. It may be my little to no experience with github. When you say "You have to get my pull request" does that mean clicking the link, because that still gives me an error. Hopefully i missed something simple

                  Comment


                    #69
                    Originally posted by Davixe View Post
                    Hi, I've been adapting the xaklse code to the 4.9 version, I spent some hours on doing it (this is my first modification on the ue source code) and I want to share this adaptation with anyone who wants this feature (and, like me, cannot wait to epic to implements it).
                    I think there are some bugs, but it works well on my side scroller game. I will do some improvements on the next days

                    cpp: http://pastebin.com/sWz0T681
                    h: http://pastebin.com/SpXjGtvN

                    Also, really thanks to Xaklse for doing this, you saved me a lot of work
                    Hey Xaklse and Davixe,

                    Thank you for creating this it is a really awesome feature! I tried that code in 4.9.2 and it compiles.
                    Edit: It works perfectly!

                    Keep up the good work!
                    Last edited by YannickLange; 11-09-2015, 04:51 PM.

                    Comment


                      #70
                      Hey all,

                      I updated this for 4.10. But even better, I also made some other modifications to give the engine a non-Z dependent gravity. Here you go!

                      https://github.com/EpicGames/UnrealEngine/pull/1773

                      Comment


                        #71
                        Originally posted by glazed4444 View Post
                        Hey all,

                        I updated this for 4.10. But even better, I also made some other modifications to give the engine a non-Z dependent gravity. Here you go!

                        https://github.com/EpicGames/UnrealEngine/pull/1773
                        OOOh yeahhhh, nice work man, I'm going to try and test this out today.
                        Storyteller - An immersive VR audiobook player

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

                        Comment


                          #72
                          Is there any further updates on integrating this into the main branch?

                          Is getting the source and compiling the engine and modification just like any other library? - Download code open up the visual studio solution and integrate, Compile and away I go?
                          Never say Never, Because Never comes too soon. - ryan20fun

                          Frames Per Second is NOT a proper performance metric, You should use frame time. You can read this or this as to why.
                          (Profiling) Tools: RenderDoc (UE4 Plugin), NVIDIA nSight, AMD GPU PerfStudio, CodeXL
                          Good articles/Series: A trip through the Graphics Pipeline 2011

                          Comment


                            #73
                            Originally posted by Xaklse View Post
                            This looks amazing, AWESOME work!

                            Comment


                              #74
                              Hello there chaps, and thank you for this wonderful piece of code. It's been a blast to use so far.

                              I'm currently trying out a a first person project (I loaded the ShooterGame example on top of the 4.10 version by glazed), and I'm having troubles with the camera. Two separate troubles to be exact. I have tiny tiny planets that one can walk around - the code turns the capsules and my own overlap calculates a new gravity direction, but I run into troubles with setting ViewPitchMin/Max and ViewRollMin/Max. I just can't get my head around how to get them to recalculate based on gravity direction. The other trouble I have is with recentering the camera when I walk - what I mean by this is, as I walk forward on a tiny planet, I would like to see the horizon all the time instead of my view slowly climbing up.

                              Anyways, all ideas appreciated. Thanks again for the code, it's fun!

                              Comment


                                #75
                                Originally posted by Slayemin View Post
                                I have some ideas for this.

                                First, we have to think big. As in planetary bodies. Gravity should be treated as a force vector, proportionate to a mass ratio of a physical body (such as earth). The amount of gravitational force applied to a body is something like an inverse square law of its distance from that object (I'm sure a good physics book has a precise equation). If you have two bodies which exert gravitational forces on an object (such as the Earth and Moon), then to find the gravitational force vector applied to an object, we'd have to go through all gravitational forces, figure out the gravitational force from distance X towards the center position of each body, and come up with a sum of gravitational forces vector. This force vector can then be applied as an acceleration force.


                                Hello, I am the developer for the Orbit and Gravity plugin, its a plugin that calculates Newtonian gravity (so gravity based on distance and an object size constant) and does orbital mechanics calculations. Someone pointed me to this thread asking about if it was possible to integrate the orbit plugin with this one. It turned out to be very easy, and I made a quick video showing how. It turned out to be a pretty cool effect I think. Video is below...

                                Comment

                                Working...
                                X