Announcement

Collapse
No announcement yet.

Rolling ball jumps on flat surface

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

    #16
    I have the same issue - after hours of googling I still don't know what to do here

    Comment


      #17
      Originally posted by Chris.Jack View Post
      As of at least 4.21 this no longer works, and the ball will jump when rolling over the seams. I can't seem to get any combination of values to provide the desired results.
      Yeah, that fix no longer works, had to get very creative to get around it in the physic vehicle project I am doing.

      Comment


        #18
        I'm on 4.20.3 and changing those values doesn't seem to do anything either.

        Comment


          #19
          Could it be that the surfaces are being triangulated by the engine? Maybe setting the mesh/surface not to deform and or, keep quads, will reduce additional geometry? If the physics are correct, enough velocity will introduce aerodynamics. Perhaps giving the ball a Physical Material of lead .

          Just occurred to me, have you tried raising the value of gravity?
          Last edited by Immersive-Games; 12-20-2018, 05:34 PM.
          Politeness is Priceless when received, cost nothing to own or give, yet some cannot afford..... ARC2003

          Comment


            #20
            It looks pretty decent :3

            Comment


              #21
              I can also confirm that the behavior has changed from 4.19 onwards and MaxContactOffset only has a limited impact. Looking at the source code it seems the problem comes from a line in FBodySetupShapeIterator::ForEachShape in BodySetup.cpp. In 4.19 it looked like this:
              Code:
              const float ContactOffset = ComputeContactOffset(Geom);
              And in 4.20 it is this:
              Code:
              const float ContactOffset = FMath::Max(ComputeContactOffset(Geom), RestOffset + 1.f);
              So the contact offset will never be able to go lower than 1 + whatever RestOffset is. I reverted this particular line of code with theone from 4.19 and that seemed to fix the problem.

              Comment


                #22
                Originally posted by Fluppi393 View Post
                I can also confirm that the behavior has changed from 4.19 onwards and MaxContactOffset only has a limited impact. Looking at the source code it seems the problem comes from a line in FBodySetupShapeIterator::ForEachShape in BodySetup.cpp. In 4.19 it looked like this:
                Code:
                const float ContactOffset = ComputeContactOffset(Geom);
                And in 4.20 it is this:
                Code:
                const float ContactOffset = FMath::Max(ComputeContactOffset(Geom), RestOffset + 1.f);
                So the contact offset will never be able to go lower than 1 + whatever RestOffset is. I reverted this particular line of code with theone from 4.19 and that seemed to fix the problem.
                Why did they change it to that? surely there had to be a good reason for it?
                Edit: also, is there a way I revert this line of code without compiling from source?

                Comment


                  #23
                  > also, is there a way I revert this line of code without compiling from source?

                  Something I'm still working on but if somebody else works it out before me I'd love to know

                  Comment


                    #24
                    Any further news on this?

                    Tried fiddling with absolutely everything I could possibly think of and still can't solve this problem
                    Right now am just generating a big plane and resizing it to the level, solves the problem but really not in the way I want

                    Is it possible to just change that one thing in the source code and recompile it?
                    I've never tried compiling from source, so I'm not sure how it works when you only want to edit one thing and apply that as the version of the engine with the game


                    edit:
                    i gave up and spent like 3 days recompiling unreal from source & generating an installedbuild version to use
                    not sure it was the best tactic and wasted a tonne of time but at least i managed to change that one line of the source code haha
                    fixed the problem though even if it did take forever
                    Last edited by woooolen; 01-25-2019, 04:07 PM.

                    Comment


                      #25
                      I've been battling this for a long time. Lack of C++ experience had limited my ability to overcome it.

                      Recently I partnered with someone and they looked into it following this thread. We found the line listed above is currently in PhysicsGeometryPhysX.cpp rather than BodySetup.cpp

                      Replacing the line as indicated above seems to have fixed this issue when related to joined static meshes however it's still an issue with landscapes.
                      Itch | Twitter

                      Comment


                        #26
                        God I'd love to pay a proper physics programmer, send him over to Epic Games and have him just ****** fix their crazy physics. It really cant be that hard to sort this **** out. Ive never heard people using Unity complain about bad physics.

                        Comment


                          #27
                          I have a project that was affected by this bug and I've managed to work around it by turning off the collision on my static meshes and replacing it with blocking volumes that I align perfectly to match the static meshes.

                          My ball rolls without any problem on the blocking volumes.

                          Comment


                            #28
                            Replacing the line as indicated above seems to have fixed this issue when related to joined static meshes however it's still an issue with landscapes.
                            To fix this issue for the landscape, you will have to apply the same contact offset to the landscape collision shapes in ULandscapeHeightfieldCollisionComponent::OnCreatePhysicsState.

                            eg. HeightFieldShapeSync->setContactOffset(MaxContactOffset);

                            Comment


                              #29
                              Originally posted by Fluppi393 View Post
                              I can also confirm that the behavior has changed from 4.19 onwards and MaxContactOffset only has a limited impact. Looking at the source code it seems the problem comes from a line in FBodySetupShapeIterator::ForEachShape in BodySetup.cpp. In 4.19 it looked like this:
                              Code:
                              const float ContactOffset = ComputeContactOffset(Geom);
                              And in 4.20 it is this:
                              Code:
                              const float ContactOffset = FMath::Max(ComputeContactOffset(Geom), RestOffset + 1.f);
                              So the contact offset will never be able to go lower than 1 + whatever RestOffset is. I reverted this particular line of code with theone from 4.19 and that seemed to fix the problem.
                              and
                              Originally posted by bybw View Post
                              To fix this issue for the landscape, you will have to apply the same contact offset to the landscape collision shapes in ULandscapeHeightfieldCollisionComponent::OnCreatePhysicsState.

                              eg. HeightFieldShapeSync->setContactOffset(MaxContactOffset);

                              4.22.0 shows a whole different BodySetup.cpp file now. It looks almost completely rewritten. Thankyou for giving out this vital information to fix this long lasting Physics Issue. I thought I'd never get an answer to this. But still working on it.. Right now I'm completely stuck on what to do and how to fix this for 4.22... I was hoping one of ya'll can help look into that. Hope you guys can get back to me on this ASAP. This is crazy news to see we found some files that we can edit back to 4.19's original state!

                              Comment


                                #30
                                I think part of what is causing this problem is actually penetration issue. I am not the most savvy guy, but based on my playing with this issue, I think the engine is "struggling" to come up with a proper way to calculate collision for the angular velocity of the ball. This issue happens considerably more frequently at high speeds and on flat surfaces and slopes using complex collision, with slopes causing even more trouble.

                                So my reasoning is that the increase in colliding faces multiple angles increases the odds of this happening.

                                Comment

                                Working...
                                X