Announcement

Collapse
No announcement yet.

[OPEN-SOURCE] Machinery Modelling Toolkit

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

    Originally posted by OldRaven View Post
    What did you do with the terrain?
    All the vehicles based on the n-tracked blueprint examples like the m113 and the ripsaw.. are not able to move on terrain. The old tiger1 based on the m113 also does not want to drive on the terrain anymore.
    Did you change something?
    I suspect that terrain underneath is confusing ray cast on suspension. For what ever reason Ripsaw is driving fine but M113 just gets stuck. I'll check it.
    Youtube Channel

    Comment


      Originally posted by 0lento View Post
      SpinTires is a DX9 game so it can't even use tessellation. It's also taking the deformations into account in away that I don't believe their collision model is that coarse (possible that they do the math on same data). If you need something like this, I think this could help to achieve it: https://forums.unrealengine.com/show...nerated-meshes! Other option would be to do make the displacement data both on gpu and cpu and use cpu version to offset the suspension values (would only work on linetraces and shape casts and not with actual physics geometry).
      Yes, the best way to solve is by using some custom technique to render landscape. Might be overkill for now. To make it work properly it have to be connected to streaming and etc.
      Youtube Channel

      Comment


        So M113 hull is somehow gets stuck on something, if you enable debug mode (Alt+Shift+D) you will see that collision point is somehow outside of the M113 hull (pink point), which is weird 0_o.
        Youtube Channel

        Comment


          Originally posted by BoredEngineer View Post
          So M113 hull is somehow gets stuck on something, if you enable debug mode (Alt+Shift+D) you will see that collision point is somehow outside of the M113 hull (pink point), which is weird 0_o.
          Did you change anything in the code?

          It's also when you start a new scene.. no driving on terrain and / or geometry

          Comment


            So, this is what I found - something happened to landscape. The collision is happening with heightmap of the main landscape. The landscape in another level (airplanes) works just fine. I found the way to replicate this issue, making a copy of the landscape creates this.
            So no worries, we can fix this by not copying landscape
            I'll try to make a level with this bug being reproducible and report it. Will work on the other piece of the guide now.
            Youtube Channel

            Comment


              Originally posted by OldRaven View Post
              Did you change anything in the code?

              It's also when you start a new scene.. no driving on terrain and / or geometry
              New scene is like new level or something?
              Youtube Channel

              Comment


                Looking at Tiger right now:
                1) Don't rotate root scene component of suspension, just leave it at 0,0,0. Instead rotate the SuspensionArm component.
                2) Now I see what you mean about suspension arms, that's an unusual order, I thought that on both side there were bending toward the back of the tank. Here I see that right side bends to a back and left side to the front.
                3) I've set suspension arms to 25 degrees rotation in Y
                4) For stability of the physics constraints it's important that connected components have not more than 10 times difference in mass (ideal), unfortunately as we are dealing with tanks we can't have torsion bars weight a ton each. But something like 100-200 kg might make a trick.
                5) Projection settings I usually set to 0.1 Linear Tolerance and 1.0 of Angular Tolerance
                6) The collision components which will come in contact with ground, like Collision Wheels, Idler and Sprocket need to have SmallFrictionMaterial physics material, so they can slide easily over obstacles - it improves stability.

                After setting all this, it seams to be working more or less fine. I'll send you file back with the settings.
                Youtube Channel

                Comment


                  To set physics material easier you can do like this:
                  Click image for larger version

Name:	Tiger_physics_material.JPG
Views:	1
Size:	84.7 KB
ID:	1109212
                  Youtube Channel

                  Comment


                    Bug fixed, Yay! The solution to collision issues of M113 and A_Tracked_Vehicle is rather simple. We need to remove center of mass offset from A_Tracked_Vehicle's root body, like this:

                    Click image for larger version

Name:	A_Tracked_Vehicle_Landscape_Collision_Fix.JPG
Views:	1
Size:	106.8 KB
ID:	1109266

                    If center of mass offset is needed, then it can be set in a specific child blueprint like M113. The fix is on the github.
                    Youtube Channel

                    Comment


                      Continuation of the guide

                      "Update Friction" function is responsible for orderly calling "Track Anisotropic Friction" components to apply friction force to the tank. There are couple of things which a necessary to make it happen.
                      First we need to count how many friction points are in the contact with the ground or in collision with some obstacle. The other thing we need to provide is the velocity of the tracks. Tracks velocity is influenced by the engine and friction itself.

                      The velocity of the tracks is handled using Track Transmission Processor component. We need to add two of them, one per each track. Example of components and their settings from T-26 Light Tank:
                      Click image for larger version

Name:	09_SprocketProcessor.JPG
Views:	1
Size:	192.1 KB
ID:	1109267

                      Later, Track Transmission Processor can be replaced by Track Transmission Processor Modular which is build to work plug-in-play with Modular Drive Train. As to parameters, this is their meaning:
                      Reference Frame Component Name - name of the a chassis or root physics component of the tank
                      Sprocket Radius Cm - radius of the track sprocket in centimeters
                      Sprocket Mass - mass of the sprocket in kg
                      Track Mass - total mass of the track in kg
                      These parameters can be hard to find but they are important for the overall handling of the vehicle. Higher mass of the sprocket and track will make a larger inertia of track movement, which will make it harder to slow it down or accelerate. The heavier the tracks and sprocket the more power from the engine is necessary to spin tracks, especially in cases when we want to spin tracks in opposite direction for neutral turn.

                      Brake Force - is the amount of force that we apply to track when brakes are enabled
                      Mechanical Friction Static Limit - is a threshold of track acceleration, if acceleration is lower than this parameter tracks won't move. This parameter imitates some of the mechanical binding that happens in transmission because of mechanical friction and inefficiency.
                      Mechanical Friction Kinetic Coefficient - is a unit-less parameter that effects how fast tracks will slow down without engine torque


                      "Update Friction" function need to be called from MMT Physics Tick event and receive delta time as input.
                      Inside of the function we will have three parts:
                      - counting of valid friction points
                      - setting parameters and calling TrackAnisotropicFriction component to apply friction force
                      - gathering of reaction force and providing it as parameter into TrackTransmissionProcessor

                      To count valid friction points we need a temporary array of all TrackAnisotropicFriction components and local integer variable PointsCount:
                      Click image for larger version

Name:	10_Count_Friction_Points.JPG
Views:	1
Size:	157.5 KB
ID:	1109268

                      For a second and third part we need two local vector variables RightTrackReactionForce and LeftTrackReactionForce, which we will use to accumulate reaction forces from TrackAnisotropicFriction->PhysicsUpdate() output.
                      This is how it all combines:
                      Click image for larger version

Name:	11_ApplyFriction.jpg
Views:	1
Size:	458.6 KB
ID:	1109269

                      For each side of the tracks we have a loop out of corresponding TrackAnisotropicFriction components. In each loop, we get track velocity vector from the TrackTransmissionProcessor component and provide it into each TrackAnisotropicFriction component using UpdateTrackData function. Then we call PhysicsUpdate function, providing PointsCount (calculated earlier) and DeltaTime. The output of this function we accumulate into RightTrackReactionForce and LeftTrackReactionForce.

                      All what is left is to use SetTrackApplicationForce function of TrackTransmissionProcessor to provide reaction force created by friction back into the loop.
                      Youtube Channel

                      Comment


                        Thanx a lot! got some new homework again

                        I'll also fix the center of mass offset .. Let me see if I can manually change that in the blueprint instead of grabbing the new build from git.

                        Comment


                          Did you only change the A_TrackedVehicle Blueprint? Then that is the only file I have to replace..

                          Comment


                            Originally posted by OldRaven View Post
                            Did you only change the A_TrackedVehicle Blueprint? Then that is the only file I have to replace..
                            Yes, just change it there, no need to get a copy. But copy it if you want. Just recompile child BPs after that change.
                            Youtube Channel

                            Comment


                              replaced.. and it works now.

                              What I do find weird.. when you go in you landvehicle map and take the m113 or ripsaw.. and turn on debug mode... I still get a hull collision message popping up that it is hitting the ground when you go on the terrain.

                              Comment


                                Originally posted by OldRaven View Post
                                replaced.. and it works now.

                                What I do find weird.. when you go in you landvehicle map and take the m113 or ripsaw.. and turn on debug mode... I still get a hull collision message popping up that it is hitting the ground when you go on the terrain.
                                You need to make sure that their Center Of Mass offset is set to 0,0,0 and recompile them. Had it on Ripsaw in current version and this is how it is solved. Perhaps Epic changed something in how the offset works, I would need to take a look at it later.
                                Youtube Channel

                                Comment

                                Working...
                                X