Announcement

Collapse
No announcement yet.

Unreal Z-axis independent gravity

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

    Unreal Z-axis independent gravity

    Lastest Progress
    1. Basic gravity implementation
    2. Gravity support for particles
    3. Gravity support for physics objects



    Hey guys,

    As the thread title suggest, I've been working on adding support for z-axis independent gravity. I just wanted to show off :P what I've managed to do so far and hopefully keep it going as a hobby for myself in my spare time.

    Unfortunately, my circumstances don't allow me to share the source code so please don't ask. However, I am more than happy to point people in the right direction.

    Currently I've only really done some basic stuff and added support for particles, I'm looking to add character movement support and also to support gravity volumes.
    Last edited by Chimpay; 05-22-2014, 03:20 PM. Reason: added list of video to first post
    My Hobby Projects
    - Dynamic Gravity

    #2
    Video 1 - Basic dynamic gravity and CPU particle support



    This was a basic update to the engine replacing the gravity float value in WorldSettings to a vector and then going through the rest of the engine and replacing any instance of a hard coded gravity in the z-axis with the new vector from WorldSettings.

    I also begun updating the particle systems engine as it was 1 of the first things I noticed that did not support dynamic gravity, managed to get the CPU particles working relatively quickly for this.
    My Hobby Projects
    - Dynamic Gravity

    Comment


      #3
      Video 2 - GPU particle support



      This update shows that it is possible to support dynamic gravity with GPU particles too, this involves updating shaders and code that works on the GPU.
      My Hobby Projects
      - Dynamic Gravity

      Comment


        #4
        Had followed your other thread. Great stuff.

        Comment


          #5
          Originally posted by Gigantoad View Post
          Had followed your other thread. Great stuff.
          Cheers, gonna look at making sure all physics objects are woken when the gravity is altered next.
          My Hobby Projects
          - Dynamic Gravity

          Comment


            #6
            Neat! Do you think it would be difficult to expand this and make the FPS controls flip? Do you know the game Prey? They had walls that you could walk up and ceilings that you could walk on.
            Join us on IRC! We are on #unrealengine @ freenode.org

            Comment


              #7
              Originally posted by Bajee View Post
              Neat! Do you think it would be difficult to expand this and make the FPS controls flip? Do you know the game Prey? They had walls that you could walk up and ceilings that you could walk on.
              The movement controller math needs to be rewritten for z-axis independency but yeah it should be doable.
              Last edited by Chimpay; 05-20-2014, 12:15 PM.
              My Hobby Projects
              - Dynamic Gravity

              Comment


                #8
                Nice work! Keep it going

                Comment


                  #9
                  I really hope this gravity thing will be possible to use in projects like UT4.

                  Comment


                    #10
                    Update 3 - Physics objects



                    In this video I managed to get all physics objects to wake up on the world gravity changing. The HUD in the top left shows the current direction of the world gravity, the centre being zero gravity.
                    My Hobby Projects
                    - Dynamic Gravity

                    Comment


                      #11
                      Originally posted by mwadelin View Post
                      Update 3 - Physics objects



                      In this video I managed to get all physics objects to wake up on the world gravity changing. The HUD in the top left shows the current direction of the world gravity, the centre being zero gravity.
                      Its a shame you cant share the source code.... at least can you tell me which files did you modify?

                      Comment


                        #12
                        Its a shame you cant share the source code.... at least can you tell me which files did you modify?
                        Take a look at this tutorial (thanks Rama). These iterator objects are useful in searching through all instances of an object or actor within the world.

                        I used an Object iterator to iterate through all the static mesh components in my world.
                        Code:
                        TObjectIterator<UStaticMeshComponent> MeshIter;
                        Using one of these you can iterate through all the static mesh's with a loop anywhere in your code, place it somewhere that ticks each frame and where you can query the current gravity and check if its changed.

                        Then call WakeAllRigidBodies on each static mesh to kick in their physics simulation and that's it
                        My Hobby Projects
                        - Dynamic Gravity

                        Comment


                          #13
                          Kickass!

                          I love games with non-generic gravity :-) Thanks for pushing the engine in this direction!

                          One of my Epic Friday projects was creating a Lunar Lander game where you had to land on a moon that was a sphere so you could orbit it first, etc. At some point I would love to see a game that is on the inside of a sphere so gravity is outwards.

                          Comment


                            #14
                            Originally posted by Daniel Vogel View Post
                            Kickass!

                            I love games with non-generic gravity :-) Thanks for pushing the engine in this direction!

                            One of my Epic Friday projects was creating a Lunar Lander game where you had to land on a moon that was a sphere so you could orbit it first, etc. At some point I would love to see a game that is on the inside of a sphere so gravity is outwards.
                            Thanks

                            Hopefully I'm gonna be able to expand this implementation with gravity volumes and point gravity, so an inverse point gravity in the centre of a sphere should work for that concept.
                            My Hobby Projects
                            - Dynamic Gravity

                            Comment


                              #15
                              Oh yeah

                              World machine, world machine, world machine...



                              Seriously what you are doing is awesome, I will model you a world machine if you need one



                              Some other links
                              http://isaac3dart.blogspot.com/
                              https://www.youtube.com/user/isaac3dart
                              Isaac Nichols
                              Game Developer & Music Producer - Threaded Pixel Studios
                              Currently working on Drones & Ruins a Sci-Fi twin-stick shooter.

                              Comment

                              Working...
                              X