Announcement

Collapse
No announcement yet.

[OPEN-SOURCE] Machinery Modelling Toolkit

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

    #76
    Originally posted by Hevedy View Post
    Wow man this is nice, so you added the airplane component from the last 2 post in the repo ?
    Not exactly airplane component, more of a "wing" component. In the video you can see blue and red vectors originating from several points over the wings and tail. Those are produced by individual airfoil components. The airplane itself is assambled from parts, each wing, rudder, ailerons and elevators are individual static meshes components. Airfoil components are attached to these meshes, so in principal you can break them in mid flight and airplane will react accordingly. Simulation itself is rather simplistic and is fine for arcade semi-realistic flight simulation. I have a better model in works which should provide more realistic and interesting results.
    Airfoil component itself is almost exactly the same as current public repo version (component used for flying aerosled), I need to fix couple of things in local version and then it's ready for the public access.
    Youtube Channel

    Comment


      #77
      Originally posted by BoredEngineer View Post
      Not exactly airplane component, more of a "wing" component. In the video you can see blue and red vectors originating from several points over the wings and tail. Those are produced by individual airfoil components. The airplane itself is assambled from parts, each wing, rudder, ailerons and elevators are individual static meshes components. Airfoil components are attached to these meshes, so in principal you can break them in mid flight and airplane will react accordingly. Simulation itself is rather simplistic and is fine for arcade semi-realistic flight simulation. I have a better model in works which should provide more realistic and interesting results.
      Airfoil component itself is almost exactly the same as current public repo version (component used for flying aerosled), I need to fix couple of things in local version and then it's ready for the public access.
      Oh cool just waiting to see the binary demo content of the airplane in the repo ^^
      Hevedy - Instance Tools: https://hevedy.itch.io/hevedyinstances
      Hevedy - Image Tools: https://hevedy.itch.io/imagetools

      Comment


        #78
        Update

        Added new component which is capable of more accurate simulation of the wing. In new implementation, control surfaces are simulated as a part of the wing and modify its aerodynamic properties, instead of being separate smaller "wings". Flight model became more interesting in handling and there is more variety in how airplane reacts to steering. Wings are now separate physics bodies and attached to the fuselage using physics constraints. Lift and drag forces are applied directly on wings, not on fuselage, this should make it possible to "loose" wings because of too much force or flex them during flight. Braking of the wings is not implemented in current version, on Fokker DR1 it should be relatively easy to setup by enabling "breakable" on physics constraints that holds wings.

        For now, only rectangular wings without tapper and sweep are supported. I'm planning to add parameters and functions to support more variety of wing shapes in feature.



        Latest version is uploaded to GitHub: https://github.com/BoredEngineer/MMT_Content
        and latest executable is here: https://www.dropbox.com/s/55dazkm8q4...ntent.zip?dl=0

        Known bugs:
        Doing barrel roll on flying Aerosled can glitch out when machine is upside-down. Most likely related to how suspension works.

        Edit: This is still for version 10.4. I'll make a separate branch to keep this version before switching to 4.11
        Last edited by BoredEngineer; 04-04-2016, 10:54 AM.
        Youtube Channel

        Comment


          #79
          Update to 4.11

          Both plugin and content github repositories are upgraded to 4.11
          In case you still need 4.10, compatible versions are saved in separate branches, called 4.10

          Enjoy all new features of 4.11!
          Youtube Channel

          Comment


            #80
            Checked it out very briefly and it's some of the most impressive stuff I've seen thus far for UE4 in terms of vehicles. I'll be playing around with it a bit, that's for sure. I'm curious about changing the controls however to use a 360 pad so each stick would control each track to sort of simulate how you drove tanks back in the days.

            Is this doable through BP, or? I looked at the M113 and Ripsaw BP but I didn't find anything in them controlling the movement - or maybe I'm just overlooking it since it's rather late and my brain juice is running low.

            This opens a lot of doors for what can be done with UE4 without any extensive C++ knowledge, great work!
            Why do all programmers wear glasses? Because they can't C#

            Comment


              #81
              Nice work with the flying!

              (Dealman, I just stared at the signature for about 5 seconds before I got it

              Comment


                #82
                Originally posted by Dealman View Post
                Checked it out very briefly and it's some of the most impressive stuff I've seen thus far for UE4 in terms of vehicles. I'll be playing around with it a bit, that's for sure. I'm curious about changing the controls however to use a 360 pad so each stick would control each track to sort of simulate how you drove tanks back in the days.

                Is this doable through BP, or? I looked at the M113 and Ripsaw BP but I didn't find anything in them controlling the movement - or maybe I'm just overlooking it since it's rather late and my brain juice is running low.

                This opens a lot of doors for what can be done with UE4 without any extensive C++ knowledge, great work!
                Totally doable
                For this you need to make changes in this graph:
                Click image for larger version

Name:	Tracked_Vehicles_Controls.JPG
Views:	1
Size:	131.8 KB
ID:	1104013

                First I would disable GetThrottleInputForAutoHandling function as it will interfere with your custom steering logic. What it does is controls when reverse gear should be enabled, how torque from the engine should be divided between tracks when you do normal/neutral turn and when to shift gear box. You can add similar logic later if needed.

                What you need to provide into system are values for these variables:
                Wheel Forward Coefficient
                Wheel Right Coefficient
                Wheel Left Coefficient

                "Wheel" is a bit confusing but I don't remember anymore why I called it like that Anyway, this is how these variables are used in UpdateThrottle() function:
                Click image for larger version

Name:	Tracked_Vehicles_Wheel_Coefficients.JPG
Views:	1
Size:	61.5 KB
ID:	1104015
                It was build for keyboard so I had to capture somehow input of pressing both forward and left/right at the same time. This is how it looks:
                Turning right by pressing only "Right" input:
                Click image for larger version

Name:	Traked_Vehicles_Turning_Righ_Without_Forward.JPG
Views:	1
Size:	42.1 KB
ID:	1104017
                Turning right by pressing "Right and Forward" at the same time:
                Click image for larger version

Name:	Traked_Vehicles_Turning_Righ_With_Forward.JPG
Views:	1
Size:	26.7 KB
ID:	1104018
                Rendered numbers are values of TrackTorqueTransferRight and TrackTorqueTransferLeft which are calculated out of "Wheel xxx Coefficient" in UpdateThrottle() function mentioned earlier.
                Maximum absolute total TrackTorqueTransfer you can have is 2, so for example combinations of [-1,1] [0,2] [-2,0] are all valid. They just say how much engine torque is transferred to each tracks and total coefficient of 2 is 100% of engine torque.

                Taking into account explanation above I would implement it in a following way:
                Add two AxisInput for each stick. Set values from sticks in such a way that if only one stick is pressed than you multiple its axis value by 2 and don't multiply if both sticks are pressed. Feed result into Wheel Right Coefficient and Wheel Left Coefficient (you don't need
                Wheel Forward Coefficient in such setup).

                This should handle throttle. Unfortunately there are some issue with my model and turning using engine at higher speed is just won't work as tracks have a lot of inertia. At higher speeds you have to use brakes for steering. There are two input variables for brakes: BrakeRatioRight and BrakeRatioLeft. Both are in range of 0..1. Maybe you could map those to some "buttons" on gamepad. This type of steering is very sensitive, it was hard to control it from keyboard so I've used a PID controller to apply brakes. Look into UpdateSteeringBrakes() function for more details.


                Originally posted by BlueBudgie View Post
                Nice work with the flying!

                (Dealman, I just stared at the signature for about 5 seconds before I got it
                Thank you!
                Youtube Channel

                Comment


                  #83
                  Update

                  Meanwhile I've pushed another update:

                  Added Debug Float Graph element for PSS Visual Debugger component. This new element allows to plot graph of a specific variable in real-time, this makes it much easier to debug as it's not only easier to read current value (debugging using DrawDebugString in subtepping can make text un-readable when values overlap) but see if you have some sudden change in values:
                  Click image for larger version

Name:	DrawDebugFloatGraphs.JPG
Views:	1
Size:	111.6 KB
ID:	1104019

                  To add one of such graphs you need to send an interface message to a pawn, this is how it is done from typical MMT component:
                  Click image for larger version

Name:	AddDrawDebugFloatGraph.JPG
Views:	1
Size:	101.7 KB
ID:	1104020

                  I use Wrap Box in UMG to place graphs on the screen. You can't really control order or placement but all graphs from multiple components of the same pawn can be automatically displayed.


                  Another update - fixed Flying Aerosled getting stuck in the air when trying to fly upside-down.

                  This update is already at GitHub repo and executable was updated too.
                  Youtube Channel

                  Comment


                    #84
                    Cheers for a very descriptive response, I totally overlooked A_TrackedVehicle Will fiddle with it a bit today and if the results are good I may return here in case others are curious about it as well. Again, amazing work.
                    Why do all programmers wear glasses? Because they can't C#

                    Comment


                      #85
                      Originally posted by Dealman View Post
                      Cheers for a very descriptive response, I totally overlooked A_TrackedVehicle Will fiddle with it a bit today and if the results are good I may return here in case others are curious about it as well. Again, amazing work.
                      Thank you! If there any issues with implementing it, just post here and we will figure it out. Part of the plan is to re-build tracked vehicles using components, instead of monolithic single class as it's made right now. But I'm still not sure how to "componentize" steering controllers in such a way that they can be re-usable.
                      Youtube Channel

                      Comment


                        #86
                        Update

                        Added a basic landscape of 8 by 8 kilometers. A bit more interesting for airplanes and there are two "landing strips" to land on.

                        Click image for larger version

Name:	Basic_landscape_for_flying.jpg
Views:	1
Size:	89.3 KB
ID:	1104035

                        The rest of the vehicles are there too, in case someone wants to drive over the larger level.

                        Latest source is on GitHub: https://github.com/BoredEngineer/MMT_Content
                        and latest executable is here: https://www.dropbox.com/s/55dazkm8q4...ntent.zip?dl=0
                        Youtube Channel

                        Comment


                          #87
                          Originally posted by BoredEngineer View Post
                          Thank you! If there any issues with implementing it, just post here and we will figure it out. Part of the plan is to re-build tracked vehicles using components, instead of monolithic single class as it's made right now. But I'm still not sure how to "componentize" steering controllers in such a way that they can be re-usable.
                          Managed to get it to work, very early implementation of it though. I made it so if you lower throttle on for example the left side - it will apply a bit of braking power to help the steering. Works nicely at lower speeds, at higher speeds not so much - so I need to multiply the braking power depending on speed.

                          Also looking at implementing placeholder sound since I can easily get the RPM and all that stuff. Very nice job making sure all variables are easily accessible! Dunno if the UE4 Marketplace accept plugins - but if it does, this is would be well worth buying.

                          Have you done any multiplayer replication testing with this?
                          Why do all programmers wear glasses? Because they can't C#

                          Comment


                            #88
                            Originally posted by Dealman View Post
                            Managed to get it to work, very early implementation of it though. I made it so if you lower throttle on for example the left side - it will apply a bit of braking power to help the steering. Works nicely at lower speeds, at higher speeds not so much - so I need to multiply the braking power depending on speed.

                            Also looking at implementing placeholder sound since I can easily get the RPM and all that stuff. Very nice job making sure all variables are easily accessible! Dunno if the UE4 Marketplace accept plugins - but if it does, this is would be well worth buying.

                            Have you done any multiplayer replication testing with this?
                            You could try using PID controller for that. If I remember correctly, I've set it up in such a way that it measures rate of turn, if it's tuning too slow more brake will be applied. Needs tweaking as well.

                            I want to keep this open source, what could be placed on marketplace is visual parts for these kind of machines. Something like collection of machine guns, tracks, tires and wheel, steering wheels, suspension meshes and etc. like lego blocks. 3D models don't age as quickly as code and don't require the same level of maintenance.

                            I haven't touched replication even a bit, this will require replication with physics and will differ from project to project.
                            Youtube Channel

                            Comment


                              #89
                              Originally posted by BoredEngineer View Post
                              You could try using PID controller for that. If I remember correctly, I've set it up in such a way that it measures rate of turn, if it's tuning too slow more brake will be applied. Needs tweaking as well.

                              I want to keep this open source, what could be placed on marketplace is visual parts for these kind of machines. Something like collection of machine guns, tracks, tires and wheel, steering wheels, suspension meshes and etc. like lego blocks. 3D models don't age as quickly as code and don't require the same level of maintenance.

                              I haven't touched replication even a bit, this will require replication with physics and will differ from project to project.
                              Fair enough, here's the very early implementation of driving it with a 360 pad;

                              https://streamable.com/g2ug

                              A little bit iffy piffy, but will look into how you're doing it via the PID controller and see if I can replicate a similar behaviour. The sound's pretty trash, but I just smashed something together in 5 minutes so there's at least something. Was thinking about maybe throwing some simple prototype together whereas one player control the tank and another handles the gun. Always been a fan of multi-crewed vehicles.

                              Would need to look into what would be the best way to replicate the movement though.
                              Why do all programmers wear glasses? Because they can't C#

                              Comment


                                #90
                                Originally posted by Dealman View Post
                                Fair enough, here's the very early implementation of driving it with a 360 pad;

                                https://streamable.com/g2ug

                                A little bit iffy piffy, but will look into how you're doing it via the PID controller and see if I can replicate a similar behaviour. The sound's pretty trash, but I just smashed something together in 5 minutes so there's at least something. Was thinking about maybe throwing some simple prototype together whereas one player control the tank and another handles the gun. Always been a fan of multi-crewed vehicles.

                                Would need to look into what would be the best way to replicate the movement though.
                                This is awesome! The sound adds really a lot to perception. Did you hooked it into RPM?
                                I didn't do anything for the sounds yet, perhaps I could add events that could be used to trigger sounds. For example when suspension gets compressed to limit or velocity of spring compression.

                                Another thing which can be done for controls is steering mechanism similar to what Panters had during WW2. Driver has a single gas pedal but two separate gear boxes for each track and separate brakes. This allows a lot of different combination in respect to turn radius and speed.

                                For multiplayer. If you are looking at building a coop type of gameplay and you don't expect people to cheat then you can build it as client authority. It's much simpler and smoother setup then server authority.
                                Last edited by BoredEngineer; 04-07-2016, 06:44 PM.
                                Youtube Channel

                                Comment

                                Working...
                                X