Announcement

Collapse
No announcement yet.

[OPEN-SOURCE] Machinery Modelling Toolkit

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

    Originally posted by BoredEngineer View Post
    Cool! So you got it working in multiplayer?
    One problem you can encounter when going uphill is that there is too much friction which pushes tracks the other way. This is the issue with the model itself. Tanks needs to have much larger rolling friction in contact with the ground and mechanical friction of the thread elements. Which means we would need a more powerful engine output but things should even out. Right now if you just add more torque from the engine it might drive too fast on the flat.
    I'll solve this problem in the new model.
    Aye, that I have! I've just added functionality for the turret so I can limit both traverse and depression/elevation as well as a speed multiplier to slow it down. I'm not too worried about having the exact traverse speed just yet. I'll be adding a speed limit later, since now it's just multiplied by a low value, so you can move it fast if you move your mouse at lightning speeds.

    Wouldn't it be possible to achieve a temporary workaround for the torque issue using the same method you did for steering? IE, depending on the pitch of the tank tracks, you can assume it's going uphill and the steeper it is - increase the extra power ratio, of course up to a certain limit so you can't climb 90 degree slopes
    Why do all programmers wear glasses? Because they can't C#

    Comment


      Originally posted by Dealman View Post
      Aye, that I have! I've just added functionality for the turret so I can limit both traverse and depression/elevation as well as a speed multiplier to slow it down. I'm not too worried about having the exact traverse speed just yet. I'll be adding a speed limit later, since now it's just multiplied by a low value, so you can move it fast if you move your mouse at lightning speeds.

      Wouldn't it be possible to achieve a temporary workaround for the torque issue using the same method you did for steering? IE, depending on the pitch of the tank tracks, you can assume it's going uphill and the steeper it is - increase the extra power ratio, of course up to a certain limit so you can't climb 90 degree slopes
      The easier solution should be to make mass of track lighter. There is a variable for that, try setting it to 100-200kg less.
      Another thing to tweak is to make Rolling Friction Coefficient higher and higher Engine Power Coefficient, this way it should have enough power to get on slope, it will have a higher top speed because of the too, this is where higher Rolling Friction Coefficient should fix it.

      Added tracks too:
      Click image for larger version

Name:	T-26_Proto_With_Tracks.JPG
Views:	1
Size:	50.5 KB
ID:	1104759
      Youtube Channel

      Comment


        I played around with the settings a bit and got it relatively good, I can climb the hill I made going on 2nd gear. I haven't tried top speed yet, and the suspension might need some more tweaks. Turret rotation seems to not be accurately replicated for some reason, so will need to look at that.

        https://streamable.com/oj61

        But now I have the general functionality for a tank in place;

        • Tank drives around and can get over(or through ) obstacles
        • Driven with a 360 pad(One analog stick per track, one trigger per brake - allows for some smooth driving. Will need to tweak brake force as you can see though)
        • Tank is multi-crewed; so far only the driver and gunner
        • Tank movement is replicated(might need to tweak the replication values here)
        • Turret rotation is replicated over network(though seemingly not very accurate?)
        • Turret can fire a crappy projectile for testing purposes(will probably replace with raycasting)
        • Can limit the turret traverse and elevation as I please, as well as traverse speed

        Still needs more tweaking and tinkering, some more features I'd like as well such as optics for the gunner. I've also made a sort of lobby system so other people can connect to my game via a server list(based on the shootout game) - I have yet to package it and try it with another person though.
        Why do all programmers wear glasses? Because they can't C#

        Comment


          Originally posted by Dealman View Post
          I played around with the settings a bit and got it relatively good, I can climb the hill I made going on 2nd gear. I haven't tried top speed yet, and the suspension might need some more tweaks. Turret rotation seems to not be accurately replicated for some reason, so will need to look at that.

          https://streamable.com/oj61

          But now I have the general functionality for a tank in place;

          • Tank drives around and can get over(or through ) obstacles
          • Driven with a 360 pad(One analog stick per track, one trigger per brake - allows for some smooth driving. Will need to tweak brake force as you can see though)
          • Tank is multi-crewed; so far only the driver and gunner
          • Tank movement is replicated(might need to tweak the replication values here)
          • Turret rotation is replicated over network(though seemingly not very accurate?)
          • Turret can fire a crappy projectile for testing purposes(will probably replace with raycasting)
          • Can limit the turret traverse and elevation as I please, as well as traverse speed

          Still needs more tweaking and tinkering, some more features I'd like as well such as optics for the gunner. I've also made a sort of lobby system so other people can connect to my game via a server list(based on the shootout game) - I have yet to package it and try it with another person though.
          Nice progress! I like how Tigers and Panthers have such a soft drive because of the amount of wheels on suspension. The other thing you could try to tweak is Mu coefficients of friction, try setting all of the to 25% higher, it gets much more grip this way.

          Yesterday was working on the spline tracks. The easiest solution so far:
          1) Move your tank into 0,0,0 of the world
          2) Add Spline Mesh Actor
          3) Spline mesh actor has only two control points, but you can copy/paste their coordinates and tangents right out of the properties.
          4) Place control points of spline mesh actor where two of the track control points should be.
          5) Tweak tangents until you get a proper curve and then just copy/paste tangent values into array.
          6) Move to the next point and repeat.
          Youtube Channel

          Comment


            Very cool stuff.
            Nice physics, to drive around with.
            Thank you, for your nice vehicle work.

            Edit:
            Very cool stuff, you are doing there
            Click image for larger version

Name:	aexample.jpg
Views:	1
Size:	937.1 KB
ID:	1104876
            About stall: For that downloop spiral stuff. I thought about adding a rotating (mace) massobject with a constraint to the Hull.
            When stall occurs, raise up spiral radius and or mass of object.
            Very cool flystuff.
            Last edited by Luftbauch; 04-19-2016, 03:28 PM.
            My small game on IndieDB ****** Beams on Twitter ****** Beams on Steam ****** VideoStuff ****** PictureStuff
            UE brings Math back into my life or i am not sure.

            Comment


              Update

              Video for the new update to highlight new features:


              Just for clarification, new tank is based on Russian T-26 light tank from pre-WW2 years, but suspension is slightly different and re-assembles one from modifications of German Panzer I tank.

              - New tank/tracked vehicle model is based on assembly of various components rather than a single monolithic class. This simplifies refactoring and gives more freedom in configuration of the tank.
              - Track friction model is now based on CollisionHit events of various parts that build up the track. This means that any part of the track, including sprocket and idler can provide traction with the ground. Previously it was limited to road wheels which are pushed by suspension spring and suspension spring had to be made using custom component. Now you can assemble moving parts of suspension using physics constraints which allows to build pretty much any kind of suspension not limited to a linear springs.
              - Tracks now have a mechanical friction, which will slow down their rotation without torque coming from the engine and require some minimal amount of torque to start moving from full stop. You can see how "from still to rolling" transition is now more aggressive than a very slow smooth rotation of the tracks as it was before.

              Know issues:
              - Version on repository has a bug in implementation of mechanical friction function, where delta time is not taken into account, which changes acceleration rate of the vehicle at different FPS
              - CollisionHit events usually happen on edges of surfaces which can push one wheel to the left and next wheel to the right, this creates inconsistent behavior of the friction when driving over the flat surface in straight line
              - Some of the collision shapes of track are a bit rough which can lead to unnatural collision of the "wheel" with the ground
              - There is a small jittering from the friction when vehicle is standing still
              - Suspension is not completely tuned and is too stiff but overall represents the concept of how multi-body suspension can work

              As always, you can find full source code on GitHub repository: https://github.com/BoredEngineer/MMT_Content
              and latest compiled executable is here: https://www.dropbox.com/s/55dazkm8q4...ntent.zip?dl=0

              [Temporary Controls for T-26]
              To reverse, hold Shift key while holding W
              W - move forward
              A/D - apply brake to left/right track for steering
              S - brake both tracks

              To get over the vertical obstacle in front of the vehicle on the demo level, keep holding W until tank gets enough grip, it might take few seconds.
              Youtube Channel

              Comment


                Are there plans to implement track-ground collisions? (like say for example, on a toy tank, with just 1 powered and 1 idler wheel connected by a track; the track should push against obstacles between the wheels. With the current system, unless you add many wheels close together, there would be noticeable overlaps; right? )

                Comment


                  Originally posted by TiagoTiago View Post
                  Are there plans to implement track-ground collisions? (like say for example, on a toy tank, with just 1 powered and 1 idler wheel connected by a track; the track should push against obstacles between the wheels. With the current system, unless you add many wheels close together, there would be noticeable overlaps; right? )
                  In principal you can do full physics track as a chain of treads with collision mesh, connected to each other using physics constraint. There is a working example of this in Tracked Vehicles thread. Main problem with such approach is performance and stability of joints. Stability can be fine for low velocity but at something over 20km/h things will go ugly.
                  I have some ideas based on modifying shape of the track spline by raytracing multiple points against the ground, but nothing concrete yet.
                  With current implementation you can always add some small invisible spheres with collision and drag track by them. I could actually try this.
                  Youtube Channel

                  Comment


                    I'm not finding it now; but a while back I saw a video about a technique for simulating ropes and cables where instead of having everything flexible, they had straight segments that were divided and joined based on the desired curvature and along contact surfaces, and lengthened and shortened when the rope was being pulled around an obstacle. Would an approach like that work for making the track simulation stable? (is it even clear at all with the way I'm describing it?)

                    Comment


                      I have to admit I have not read through everything, but is there a way with this method to have the wheels react less suddenly. Like at ~ 1:41 in the video you see how the wheels hop from one frame to the next into the new position. Like binary 0 to 1 switching with nothing in between. Maybe some interpolation of the position over a few frames, or tracing a few frames ahead on a projected path could solve this.

                      Comment


                        Originally posted by TiagoTiago View Post
                        I'm not finding it now; but a while back I saw a video about a technique for simulating ropes and cables where instead of having everything flexible, they had straight segments that were divided and joined based on the desired curvature and along contact surfaces, and lengthened and shortened when the rope was being pulled around an obstacle. Would an approach like that work for making the track simulation stable? (is it even clear at all with the way I'm describing it?)
                        Yeah, that should work. You can measure a lenght of the current spline do decide if top segment should be tense or hanging for example. For the ground contact part you could even dynamically add spline points when spline segment intersects something.

                        There is slightly easier solution to all this - displaced landscape for visual appearance and coarse height field map for calculating track position and wheel displacement. Most of the time, tanks will be driving on soil instead of a flat plate and sharp geometry as here.
                        There are issues with landscape collisions so I need to introduce that extra layer of soil on top of landscape anyway. Otherwise we have to stick to raytraced wheels for a "smooth" ride.

                        If you find that article please share a link!
                        Youtube Channel

                        Comment


                          Originally posted by BoredEngineer View Post
                          ...

                          If you find that article please share a link!

                          I think this might be it: http://www.physics.umu.se/english/re...re-simulation/

                          I also found this video; but I remember they had one that went into more details and showed more examples, I haven't found that yet.

                          edit: and looks like these guys are doing something similar: https://youtu.be/81ZSOeaBVwY
                          Last edited by TiagoTiago; 04-21-2016, 01:54 PM.

                          Comment


                            Originally posted by TiagoTiago View Post
                            I think this might be it: http://www.physics.umu.se/english/re...re-simulation/

                            I also found this video; but I remember they had one that went into more details and showed more examples, I haven't found that yet.

                            edit: and looks like these guys are doing something similar: https://youtu.be/81ZSOeaBVwY
                            Interesting read, I'll check articles in more details but at first glance this would require a custom collisions detection. Need to think about this.
                            Youtube Channel

                            Comment


                              Originally posted by BlueBudgie View Post
                              I have to admit I have not read through everything, but is there a way with this method to have the wheels react less suddenly. Like at ~ 1:41 in the video you see how the wheels hop from one frame to the next into the new position. Like binary 0 to 1 switching with nothing in between. Maybe some interpolation of the position over a few frames, or tracing a few frames ahead on a projected path could solve this.
                              Sorry, missed your post. Not sure what you mean, I can barely see any wheels at 1:41
                              Youtube Channel

                              Comment


                                I took a quick screenie. The 'wheels' (not the right name probably) marked in red. They move, or flip, just between two frames and therefore appear to have zero mass.
                                In general the lack of inertia of the wheels and the chains looks a tad unnatural. Interpolating to the new spline positions to not have them go instantly there might help with this.

                                Click image for larger version

Name:	Unbenannt.jpg
Views:	1
Size:	98.8 KB
ID:	1105026
                                Last edited by BlueBudgie; 04-21-2016, 02:36 PM.

                                Comment

                                Working...
                                X