Announcement

Collapse
No announcement yet.

[OPEN-SOURCE] Machinery Modelling Toolkit

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

    A bit of illustration for torsion bars spring:
    Click image for larger version

Name:	Torsion_bar_spring.JPG
Views:	1
Size:	72.8 KB
ID:	1108928

    On the left, torsion spring is in the relaxed state and is effected only by gravity which we ignore for simplicity. On the right, torsion spring holds a portion of mass of the tank. So how do we get to this:
    We can set angular limit to 90 degrees, so handle can turn up to M1 and M2. M1 and M2 would be the points where maximum force of the spring is generated. So spring force will go from -Angular Position Strength at M1, to 0 at A and to +Angular Position Strength in M2.
    We want force of the spring to be equal "Mass of tank in kg * acceleration due gravity / amount of wheels " at 15 degrees (point B), which is 70% from point A. Which means that we should set Angular Position Strength to:
    (Mass of tank in kg * acceleration due gravity / amount of wheels) * 1.3
    to add 30% of force that we should have at M1 and M2.

    We can take different angle. For example default position is 30 degrees and we allow freedom of 60, it means that lever can travel from 0 to 60 degrees and if our desired position under tank load is 15 degrees then we need to set Angular Position Strength as:
    (Mass of tank in kg * acceleration due gravity / amount of wheels) * 2
    as 15 degrees is a half way between relaxed position and fully compressed.
    Youtube Channel

    Comment


      Originally posted by BoredEngineer View Post
      A bit of illustration for torsion bars spring:
      [ATTACH=CONFIG]99073[/ATTACH]

      On the left, torsion spring is in the relaxed state and is effected only by gravity which we ignore for simplicity. On the right, torsion spring holds a portion of mass of the tank. So how do we get to this:
      We can set angular limit to 90 degrees, so handle can turn up to M1 and M2. M1 and M2 would be the points where maximum force of the spring is generated. So spring force will go from -Angular Position Strength at M1, to 0 at A and to +Angular Position Strength in M2.
      We want force of the spring to be equal "Mass of tank in kg * acceleration due gravity / amount of wheels " at 15 degrees (point B), which is 70% from point A. Which means that we should set Angular Position Strength to:
      (Mass of tank in kg * acceleration due gravity / amount of wheels) * 1.3
      to add 30% of force that we should have at M1 and M2.

      We can take different angle. For example default position is 30 degrees and we allow freedom of 60, it means that lever can travel from 0 to 60 degrees and if our desired position under tank load is 15 degrees then we need to set Angular Position Strength as:
      (Mass of tank in kg * acceleration due gravity / amount of wheels) * 2
      as 15 degrees is a half way between relaxed position and fully compressed.
      makes sense.. the initial 15 degrees when it standing on all wheels was more or less a measurement. If I rotate the springarm 15 degrees from its horizontal position.. the wheels seem to be at the point where they are in real life.
      I will experiment with the angle and weight. I did not enable any weight of the actual wheel or springarm (yet)
      My fear with settting M1 at 90 degrees is that when you drop the tank on schene activation the wheels go the other way.. Haven't tried that.

      Contraints always seem to be some sort of struggle.. for years I've setup 3D character for film and animarion in general and constraints always seem kind of iffy. It's probably because of how they are implemented. They always seem to do "something" .. relusting in all sorts of wobble and errors.
      I'm curious how they do it in Vortex, I'm pretty sure they wrote their own physics code for it. In the long run I think it would be nice to have some sort of seperate torsion bar node, just like the spring.. if you do it with the current constraint it's kind of a pain to setup.. and I'm curious if it will ever react the way you predict this way.

      If you want me to send you the tiger to also experiment with the torsion bar, just let me know.. I can send it to you. If it's all working we can also include the tiger as an example for other people to try.

      Comment


        Originally posted by OldRaven View Post
        makes sense.. the initial 15 degrees when it standing on all wheels was more or less a measurement. If I rotate the springarm 15 degrees from its horizontal position.. the wheels seem to be at the point where they are in real life.
        I will experiment with the angle and weight. I did not enable any weight of the actual wheel or springarm (yet)
        My fear with settting M1 at 90 degrees is that when you drop the tank on schene activation the wheels go the other way.. Haven't tried that.

        Contraints always seem to be some sort of struggle.. for years I've setup 3D character for film and animarion in general and constraints always seem kind of iffy. It's probably because of how they are implemented. They always seem to do "something" .. relusting in all sorts of wobble and errors.
        I'm curious how they do it in Vortex, I'm pretty sure they wrote their own physics code for it. In the long run I think it would be nice to have some sort of seperate torsion bar node, just like the spring.. if you do it with the current constraint it's kind of a pain to setup.. and I'm curious if it will ever react the way you predict this way.

        If you want me to send you the tiger to also experiment with the torsion bar, just let me know.. I can send it to you. If it's all working we can also include the tiger as an example for other people to try.
        That would be great. It's possible that I'm missing something important as so far I've setup just few tanks. It would be faster to take a loot at assembled model than to build another one. I do have a high poly model of MLRS provided by DaveFace but I only yesterday got proper Modo license and it will take some time to bring it into UE4.

        0lento suggested a hybrid approach - were some wheels are driven by physical bodies and the rest is done using raycheck. This would limit suspension to a simpler setup like torsion bar but can be more stable and less iffy.
        At the same time constraint based approach is not completely researched, just last week I've played with setting of suspension on T-26 and got a very different behavior. The main problem on T-26 is not even settings of the constraints but collision shapes of the wheels getting stuck in obstacles

        I think you are right regarding using custom spring instead of using physics constraint motor. I can make it work one way - so lever can go from 30 to 0 degrees and creates maximum force at 0 and no force at 30, instead of heaving this symmetry as we have right now with constraints.
        Last edited by BoredEngineer; 06-24-2016, 07:47 AM.
        Youtube Channel

        Comment


          Originally posted by BoredEngineer View Post
          That would be great. It's possible that I'm missing something important as so far I've setup just few tanks. It would be faster to take a loot at assembled model than to build another one. I do have a high poly model of MLRS provided by DaveFace but I only yesterday got proper Modo license and it will take some time to bring it into UE4.

          0lento suggested a hybrid approach - were some wheels are driven by physical bodies and the rest is done using raycheck. This would limit suspension to a simpler setup like torsion bar but can be more stable and less iffy.
          At the same time constraint based approach is not completely researched, just last week I've played with setting of suspension on T-26 and got a very different behavior. The main problem on T-26 is not even settings of the constraints but collision shapes of the wheels getting stuck in obstacles

          I think you are right regarding using custom spring instead of using physics constraint motor. I can make it work one way - so lever can go from 30 to 0 degrees and creates maximum force at 0 and no force at 30, instead of heaving this symmetry as we have right now with constraints.
          What's the best way to send it? just "migrate" the Tiger_BP? and will just send all attached meshes etc...

          btw, What version of UE4 are you currently on?

          I'm using 4.11 now, but would like to move to 4.12 because there are some fixes to foliage I need.
          If I am correct.. all I have to do is install a 4.12 version of the plugin and my project should load fine right?

          Comment


            Originally posted by OldRaven View Post
            What's the best way to send it? just "migrate" the Tiger_BP? and will just send all attached meshes etc...

            btw, What version of UE4 are you currently on?

            I'm using 4.11 now, but would like to move to 4.12 because there are some fixes to foliage I need.
            If I am correct.. all I have to do is install a 4.12 version of the plugin and my project should load fine right?
            I've made a branch of 4.11 and master is on 4.12 right now. To migrate to 4.12 you need to copy/paste new version of plugin into plugin folder and then you can migrate by right clicking on project file in explorer. Just make sure to make a backup before that.

            Asset migration should work fine after that. If needed I can check it in 4.11 too.
            Youtube Channel

            Comment


              Originally posted by BoredEngineer View Post
              I've made a branch of 4.11 and master is on 4.12 right now. To migrate to 4.12 you need to copy/paste new version of plugin into plugin folder and then you can migrate by right clicking on project file in explorer. Just make sure to make a backup before that.

              Asset migration should work fine after that. If needed I can check it in 4.11 too.
              Thanx..

              I will backup first, then move it to 4.12. When that all works out.. I will migrate just the tiger and send it to you.

              Can I make one suggestion for the MMT Content package? make a root folder called MMT in the content , and put all your directories in there. This makes it a bit more organized if someone want to add other packages to the project.
              I moved everything MMT related to an MMT root directory.. and UE4 just went awol .. was scared that I just lost everything trying to reorganize.. but all went ok.. as far as I can see.

              correction : It seems I broke something .. hmm
              Last edited by OldRaven; 06-25-2016, 09:44 AM.

              Comment


                Originally posted by OldRaven View Post
                Thanx..

                I will backup first, then move it to 4.12. When that all works out.. I will migrate just the tiger and send it to you.

                Can I make one suggestion for the MMT Content package? make a root folder called MMT in the content , and put all your directories in there. This makes it a bit more organized if someone want to add other packages to the project.
                I moved everything MMT related to an MMT root directory.. and UE4 just went awol .. was scared that I just lost everything trying to reorganize.. but all went ok.. as far as I can see.

                correction : It seems I broke something .. hmm
                That would be a good thing indeed. I've tried to do it on folder by folder and fix redirectors - it didn't worked well. I still cants delete old folders as redirectors as somehow locked.
                Youtube Channel

                Comment


                  I got the same thing.

                  Now all sort of lins are broken

                  see if I can move them back to the original structure

                  Comment


                    I moved them all back to their original folders and it all works again.

                    Weird that UE4 is unable to reconnect everything.. seems as is a lot is sort of a hard link you cannot move anymore.

                    Comment


                      I moved everything to 4.12 and it's all up and running again.

                      I see you are experimenting with terrain deformation.. haha.. nice.. I'm curious how heavy it is on a terrain with grass. I assume it's stencils that spawn with a deformation map. Could also be a normal map that does not deform the terrain, but does give the impression of leaving trackmarks. If it's gets to heavy you could also set an optional timer that erases the stencil after an X amount of time.
                      I love the terrain deforming.. Did you ever see spintires?



                      I added all the OnHit component events also for the wheels. So now it's time for the rest.. I'll wait until you have time to give me some guidance on how to proceed
                      In the meantime I can return to modeling.. and the interior control blueprint.

                      I need a way to set it up seperate from the tiger blueprint. Now all the interior controls are also in the tiger blueprint.. it would somehow be nice If I could seperate it so that it is easy to add to a different tank also.
                      I just have no idea how to organize something like that.
                      Hence.. I don't even know how to ask for ideas about it

                      Comment


                        Originally posted by OldRaven View Post
                        I moved everything to 4.12 and it's all up and running again.

                        I see you are experimenting with terrain deformation.. haha.. nice.. I'm curious how heavy it is on a terrain with grass. I assume it's stencils that spawn with a deformation map. Could also be a normal map that does not deform the terrain, but does give the impression of leaving trackmarks. If it's gets to heavy you could also set an optional timer that erases the stencil after an X amount of time.
                        I love the terrain deforming.. Did you ever see spintires?



                        I added all the OnHit component events also for the wheels. So now it's time for the rest.. I'll wait until you have time to give me some guidance on how to proceed
                        In the meantime I can return to modeling.. and the interior control blueprint.

                        I need a way to set it up seperate from the tiger blueprint. Now all the interior controls are also in the tiger blueprint.. it would somehow be nice If I could seperate it so that it is easy to add to a different tank also.
                        I just have no idea how to organize something like that.
                        Hence.. I don't even know how to ask for ideas about it
                        It works in pretty hacky way right now, because I don't want to bring custom shaders into MMT just yet.
                        What I do is very similar to this tutorial:
                        https://forums.unrealengine.com/show...nreal-Engine-4
                        the difference is that I don't place deformation decals on the visible landscape but on the copy of the landscape deep "underground". So visual landscape can get proper decals for marks, with color and normal map and ground deformation (which uses tessellation) can be always switched of for performance improvement. What I don't like in this approach is that I have to spawn to sets of decals and they are pretty dense in how they are placed around, might be a hit to performance. I'm not seeing performance drop but I'm running it on GTX590 and current bottleneck is somewhere on CPU anyway.
                        A better approach which I will try later is similar to what WarThunder does - they don't use decals but check for actual geometry penetrating "soft" landscape and use that for deformation. Which means that all kind of stuff can leave those marks, like overturned tank will leave tracks from its turret sliding over the hill, or explosions, rocks, fallen trees and etc.
                        Anyway, I want to sort of finalize this approach first.

                        Not sure what exactly SpinTires does, in our case if someone uses this kind of deformation we would have to solve other issue like for example character walking over such surface. Don't have good ideas regarding this yet. Ideally a custom landscape with tessellation and some coarse collision mesh would be used.

                        Regarding Tiger, so where are you so far? Have you managed to assemble UpdateFriction function?
                        Last edited by BoredEngineer; 06-25-2016, 05:02 PM.
                        Youtube Channel

                        Comment


                          I've send you the current tiger if you want to check and test the torsion bar setup.

                          I added the ResetFrictionPoints function and did all the OnComponentHit events for the wheels in the event graph.

                          The next step is Update friction function, but i was waiting for a short descrition of the order you added it all.
                          I can just redo it the way you did it in the T26, and will probably work.. but then I'm just copying and pasting stuff and have no idea what I'm actually doing.
                          And I'm trying to understand the way you think and set things up

                          Spintires has some crazy terrain deformation.. don't know if the demo is still out.. but it's fun driving through mud with a 4x4 and seeings the way it reacts.

                          Comment


                            Originally posted by BoredEngineer View Post
                            Not sure what exactly SpinTires does, in our case if someone uses this kind of deformation we would have to solve other issue like for example character walking over such surface. Don't have good ideas regarding this yet. Ideally a custom landscape with tessellation and some coarse collision mesh would be used.
                            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).
                            https://github.com/0lento/UnrealEngine (GameWorks tech merges & upgrades, UE4 physics modifications)

                            Comment


                              Also do note that if you have actual mesh there and not something that's displaced with GPU, you can enable complex trace on the trace parameters to get per polygon response (instead of using the collision that's used for other physics).
                              https://github.com/0lento/UnrealEngine (GameWorks tech merges & upgrades, UE4 physics modifications)

                              Comment


                                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?

                                Comment

                                Working...
                                X