Announcement

Collapse
No announcement yet.

[OPEN-SOURCE] Machinery Modelling Toolkit

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

    Update

    Added Rolling Resistance/Friction force as a part of Anisotropic Friction Component functionality. In Settings->ProjectSettings->Physics->PhysicalSurface we can define a number of the EPhysicalSurface records that can be later used in physics materials to make it very simple to understand what kind of physics material we are dealing with and how should we react to it. For example, by spawning different particle effects when something hits them or changing decals for the tank tracks:
    Click image for larger version

Name:	EPhysicalSurface.JPG
Views:	1
Size:	88.7 KB
ID:	1112499

    Type of the Physical Surface can be read on collision hit events or on raycheck test. For landscapes, you can set physical materials (bound to one of the EPhysical Surface types) in information layer assets.
    Now we can define a set of Rolling Resistance/Friction coefficient for each EPhysical Surface in Anisotropic Friction component:
    Click image for larger version

Name:	RollingFrictionPhysicalSurface.JPG
Views:	1
Size:	294.4 KB
ID:	1112500

    This allows to tune how fast our vehicle should be moving on different surfaces, like tarmak, concrete, dirt, snow or any other type of surface that you want to have in your game.


    Landscape deformation now have a different amount of displacement depending on the paint layer, each paint layer can have a different physical material assigned to it and in combination with binding to EPhysical Surface you can have different particles spawned or physics behavior on different materials. Here you can see that deformation from tracks is deeper on sand than on rocks:
    Click image for larger version

Name:	LandscapeDeformationByMaterial.JPG
Views:	1
Size:	138.2 KB
ID:	1112503
    Youtube Channel

    Comment


      Made small correction to the math behind Rolling Resistance/Friction force. Now you can use realistic coefficients from wikipedia: https://en.wikipedia.org/wiki/Rolling_resistance
      Light Tank is now configured to have 0.04 coefficient on sand, 0.02 on rocks and 0.01 on concrete, which is a realistic estimate from an old manual on tank design. Certainly it all can be tweaked and has a large dependency on tank mass. So for example if you have a 60 ton heavy Tiger and 5.4 ton heavy Panzer I tank they speed can be drastically different when driven off road or on the cobblestones.
      Youtube Channel

      Comment


        Update

        Just a small update:
        - Added new method "MMT Set Inertia Tensor" to MMT function library that allows to set custom inertia tensor on component that simulate physics
        - Added sample blueprint to Simple Example levels to demonstrate how Set Inertia Tensor method works

        This function will serve it's purpose in a series of experiments on physics constraint based suspension to make it more stable. The idea is rather simple, to have a high moment of inertia on the axis which is suppose to be locked by physics constraint. The other usage is to solve cases when collision mesh needs to have a shape necessary for proper collision but it's moment of inertia on each axis can be sub-optimal for the function of the mesh in the system of other objects.
        Youtube Channel

        Comment


          Originally posted by BoredEngineer View Post
          Just a small update:
          - Added new method "MMT Set Inertia Tensor" to MMT function library that allows to set custom inertia tensor on component that simulate physics
          - Added sample blueprint to Simple Example levels to demonstrate how Set Inertia Tensor method works

          This function will serve it's purpose in a series of experiments on physics constraint based suspension to make it more stable. The idea is rather simple, to have a high moment of inertia on the axis which is suppose to be locked by physics constraint. The other usage is to solve cases when collision mesh needs to have a shape necessary for proper collision but it's moment of inertia on each axis can be sub-optimal for the function of the mesh in the system of other objects.
          Nice! I see I have plenty of things to do when I get back from france

          Comment




            I moved my Sherman over from the N-wheeled tracked vehicle system and it works very well. This is really a great system and very enjoyable to work with.

            The physics contraint suspension solution fits the VVS suspension of the Sherman nicely.



            The only thing thats still missing is the upper arm of the suspension that slides over the lower arm as far as I understand the construction. My idea was to not have any physics working on it, but instead just rotate by code towards a socket position on the lower arm. Or do you have a better idea on how to handle that?

            Sherman VVS suspension for reference:
            Attached Files

            Comment


              Originally posted by Xazas View Post

              I moved my Sherman over from the N-wheeled tracked vehicle system and it works very well. This is really a great system and very enjoyable to work with.

              The physics contraint suspension solution fits the VVS suspension of the Sherman nicely.

              The only thing thats still missing is the upper arm of the suspension that slides over the lower arm as far as I understand the construction. My idea was to not have any physics working on it, but instead just rotate by code towards a socket position on the lower arm. Or do you have a better idea on how to handle that?

              Sherman VVS suspension for reference:
              I think it's better to animate it using code, physics can be heavy on performance and can glitch out.
              Looks like front wheel is bumping into obstacles, have set a custom physics material on it? With a 0 restitution and very small friction it should slide over. Another option is to shape collision a bit, like what T-26 Light Tank is using.
              Overall, the "obstacle course" in the level is a bit of on extreme side, so far in games that I've seen, people have a bit smoother obstacles and landscape.
              Youtube Channel

              Comment


                ok, I'm back.. is it safe to upgrade now?

                nice work on the m4 Xazas!

                Comment


                  Originally posted by OldRaven View Post
                  ok, I'm back.. is it safe to upgrade now?

                  nice work on the m4 Xazas!
                  Yesterday I've added c++ implementation of friction component and made a Light Tank variant that uses them. Performance is about 2x better and I see some further optimization options here and there, so it should be working faster. Example vehicle is called LightTankCPP, setup is pretty much the same, just some functions have slightly different name.
                  Youtube Channel

                  Comment


                    Hi,
                    I know that this is not MMT question, but since there are lots of posts of tank; perhaps this question will not be too much of diversion .

                    How do I flip the rear wheel rotation of a tank? This is an 8 wheels tank, the first two rotate as they are, but the last two flip their rotations. After a long day, I still cannot figure out the way, except for one: Probably I can flip the tire in 3dsmax and they will rotate accordingly? But I am not sure and I think it doesn't work.

                    TIA.

                    Comment


                      Originally posted by Syed View Post
                      Hi,
                      I know that this is not MMT question, but since there are lots of posts of tank; perhaps this question will not be too much of diversion .

                      How do I flip the rear wheel rotation of a tank? This is an 8 wheels tank, the first two rotate as they are, but the last two flip their rotations. After a long day, I still cannot figure out the way, except for one: Probably I can flip the tire in 3dsmax and they will rotate accordingly? But I am not sure and I think it doesn't work.

                      TIA.
                      Are you using vehicle template? Check that bones are oriented properly in 3dsMax.
                      Youtube Channel

                      Comment


                        Originally posted by BoredEngineer View Post
                        Yesterday I've added c++ implementation of friction component and made a Light Tank variant that uses them. Performance is about 2x better and I see some further optimization options here and there, so it should be working faster. Example vehicle is called LightTankCPP, setup is pretty much the same, just some functions have slightly different name.
                        After new round of profiling, found that slowest part now is animation of tracks. It's done by moving ISM treads along the spline, the slowest operations are getting position, rotation and etc. from spline components, followed by math where they used.
                        So TrackAnimationDrive is the next victim of the c++ transition.

                        Ideally is to use "lighter" technique with skinned mesh and animated material. I should add it as example, it was available in previous project some time ago. Even if you prefer new system more, they both can be used at the same time as LODs - detailed tracks for "hero" tank and skinned mesh for the rest.
                        Youtube Channel

                        Comment


                          yes the skinned mesh method is usefull for lod.. and also for future AI tank..
                          I want to use the instanced tracklink track for the hero tank.. as I do not like skinned tracks.. it's too Oldskool for my liking

                          Comment


                            Originally posted by OldRaven View Post
                            nice work on the m4 Xazas!
                            Thank you!

                            Originally posted by BoredEngineer View Post
                            I think it's better to animate it using code, physics can be heavy on performance and can glitch out.
                            Looks like front wheel is bumping into obstacles, have set a custom physics material on it? With a 0 restitution and very small friction it should slide over. Another option is to shape collision a bit, like what T-26 Light Tank is using.
                            Overall, the "obstacle course" in the level is a bit of on extreme side, so far in games that I've seen, people have a bit smoother obstacles and landscape.
                            Yes the front wheel needs a bit of custom shaped collision like your T-26 then it should work.

                            I've animated the secondary suspension arms with code, however it seems to always lag behid the main arm movement a little, any idea why? I've tried to execute it both in the regular tick and the MMT Physics Tick both with the same result.


                            My next goal is to set up a 4WD wheeled vehicle, the Willys Jeep, and since I'm not entirely familiar with all the components I wonder if my setup is correct. I have 3 differentials, the first one is the central one, connected to the gearbox on the source and to one differential for each axle on the application end. To each axle differential I then connect one of the WheelAxle components. And then I have to use a Friction Component (AnisotropicFriction?) which recieves and delivers forces to the axle component correct?

                            Great to see your progress on performance improvement. Could updating the plugin break anything in my current project?

                            Comment


                              Originally posted by Xazas View Post
                              Yes the front wheel needs a bit of custom shaped collision like your T-26 then it should work.

                              I've animated the secondary suspension arms with code, however it seems to always lag behid the main arm movement a little, any idea why? I've tried to execute it both in the regular tick and the MMT Physics Tick both with the same result.
                              Is your secondary suspension arm is a skeletal mesh? As they do lag behind unless you move them in local space only. Otherwise not sure what is wrong. Can you show how you do calculation for animation?

                              Originally posted by Xazas View Post
                              My next goal is to set up a 4WD wheeled vehicle, the Willys Jeep, and since I'm not entirely familiar with all the components I wonder if my setup is correct. I have 3 differentials, the first one is the central one, connected to the gearbox on the source and to one differential for each axle on the application end. To each axle differential I then connect one of the WheelAxle components. And then I have to use a Friction Component (AnisotropicFriction?) which recieves and delivers forces to the axle component correct?
                              In theory yes. But keep in mind that currently implemented Differential is a Locked Differential and for cars you need a bit more advanced version of it - Limited Slip Differential, which allows for differential to be open when there is no torque coming into the system and gets locked as you push pedal: https://www.youtube.com/watch?v=ujsxq9WBllU
                              Locked differential might work in principal for off-road vehicle, but you might have issue with turning it as wheels will be slipping not able to rotate with different velocities. For the tank it's not a problem as there are clutches between track and differential.

                              Having said that, be aware that WheelAxle component was something that I've added very early in the development of the ModularDriveTrain and never used since, I don't think it will work correctly. Instead, you could use TrackProcessorModular as a "wheel processor", just make sure to set weight of the tread to something very small, like 1kg or less. Pretend that you are driving on sprockets
                              Otherwise, you are correct. Information passes from engine down to differentials and track/wheel processor, here we calculate how track/wheel should rotate because of the engine torque and provide information about "desired" wheel velocity to friction component. Friction component tells back how much "reaction" force we should apply to the track/wheel (handled by track/wheel processor) because of friction and then data flows back to the engine.

                              Originally posted by Xazas View Post
                              Great to see your progress on performance improvement. Could updating the plugin break anything in my current project?
                              I advise to always make backup before upgrading, but overall, new c++ implementation of components comes as new set of classes. They have their own category "MMT" in Add Component interface. So you can safely mix BP version with C++ version in the same project. Mixing it in the same vehicle might be difficult as base class is different.
                              Last edited by BoredEngineer; 08-05-2016, 09:37 AM.
                              Youtube Channel

                              Comment


                                Looking at the Tooner's implementation:
                                https://www.youtube.com/watch?v=8_ky9LhbxZI

                                Tracks animation looks really good, they bend over obstacles and imitate tension of the track. Not sure how exactly he did it, most likely by tracing against ground between roadwheels and adjusting height of the control points if track is not too tense. On the top, most likely some pre-defined points are relaxed if track is not tense. Should try implementing something like this. One could actually test collision of the roadwheels against the spline instead of the ground. Would eliminate most of the issue with getting "stuck" in obstacles and ride should be smoother.
                                Youtube Channel

                                Comment

                                Working...
                                X