[OPEN-SOURCE] Machinery Modelling Toolkit

I fixed this by removing a transform direction that i had in my suspension code and this was making the suspension forces push the tank up and down hills depending on the direction.

Nice! Behavior did sound a bit weird.

Change velocity tick box is the same as on regular AddForce, when true it will ignore mass of the object.
It won’t help with sliding - even if you calcuate inverse of velocity perfectly, object will start to mov again on next take.

I am unsure of where to post this problem so I apologize if this is not in the correct place. I am unable to package my project with the plugin installed. I simply copied the plugin folder from the 4.14 branch zip into my 4.14.3 project. It works in editor but no longer lets me package the game. I have created a c++ none class to convert the project to c++ but that does not fix it. Two errors from the log are:

UATHelper: Packaging (Android (ETC1)): UnrealBuildTool: ERROR: UBT ERROR: Failed to produce item: C:\Users\User\Documents\Unreal Projects\Project\Plugins\MMT\Binaries\Android\UE4-MMT-armv7-es2.a

UATHelper: Packaging (Android (ETC1)): Program.Main: ERROR: AutomationTool terminated with exception: AutomationTool.CommandUtils+CommandFailedException: Command failed (Result:5): C:\Program Files (x86)\Epic Games\4.14\Engine\Binaries\DotNET\UnrealBuildTool.exe Project Android Development -Project=“C:\Users\User\Documents\Unreal Projects\Project\Project.uproject” “C:\Users\User\Documents\Unreal Projects\Project\Project.uproject” -remoteini=“C:\Users\User\Documents\Unreal Projects\Project” -noxge -NoHotReload -ignorejunk. See logfile for details: ‘UnrealBuildTool-2017.07.02-01.51.28.txt’

I’m not including the full log since I’m not sure how without it being a large wall of text.

The folder is kind of weird "Unreal Projects\Project\Plugins". Is your project called “Project”?
I’ve never tested it with Android, does it package for Windows build?

PS: Haven’t received any notification about your post. I guess because it was waiting for approval.

Yes, the project is called “Project” sorry if that causes some confusion.
Also, it does package fine for windows 64bit so this problem is only for android or mobile as far as I can tell.

Hmm, I’ve never tried to compile it for Android. Not sure what problem can be. Do you have experience with building something for Android in UE4? Maybe it’s just a matter of pre-compiling plugin for Android. Try compiling it for Android from VS - but no idea how unfortunately.


Thank you, the tiger can move. Then I want to adjust some of the details, try to make it perfect.;)

;)Funny tool

Build Problems with Unreal Engine 4.17

I was trying to build the plugin for version 4.17, but some things seem to have changed which makes it impossible to build it.

I created an issue on github with the error messages from the build here: https://github.com//MMT_Plugin/issues/2.

I’am not experienced enought to fix those and provide a patch, but It woud be greate if @ could have a look.

I’ve added BlueprintType to all structures that wouldn’t compile. Updated VS to patch 3 (as was requested by UE4 compiler) and now it seams to compile fine. I’ll test if most of the things are working, including packaging.
@alios18 Thank you for reporting this! I would react here earlier but when its a your first post on the forum, subscribers don’t get notifications as it has to be approved by admins first.

Done. Content and Plugin are updated to 4.17. Please, let me know if something is not working.
There where some compilation warnings that I’ve fixed. Seeing more and more warnings about taking square root of negative number or division by zero, will look into it as it spams logs and degrades performance.

Thank you, this is Great!

This is an incredible kit, thank you all for your work on this. I’m excited to dig into how it all works. The example vehicles are great!

This is an incredible plugin! And i thank you sir, and all who have helped on this project for sharing this with the community. The source code is very well documented as well. Plan to dig deep into it and try to understand the process of all of this. I hope you don’t mind me asking you some questions in the future as i’m trying to understand all the process.:slight_smile:

Sure, post here any question you have and I’ll try to reply when I can.

Overall, there are two versions of the tracked vehicles implementation:
Old one, based on A_TrackedVehicle class (M113 and Ripsaw), which is outdated in terms of features and mostly done in BP. It has quite a few bugs that are not fixed and won’t be fixed as it’s deprecated.
New one, used for T-26 “LightTank” is based on C++ components, which are orchestrated in BP. The most feature complete example is LightTankWithAnimBP (if I recall name correctly :D), you can find it in the main level next to hovercraft and old tanks.

The main loop of the simulation can be seen in the main event graph under the MMT Physics Tick event.

  • It starts with updating torque produced by the engine.
  • Then torque is fed to track simulation component so new angular/linear velocity of the track can be calculated.
  • To calculate friction between track and the ground, we need to know how hard tank presses on the ground. For this we update suspension components that find where roadwheels/tracks would collide with the surface and how much force each suspension spring will produce.
  • Now we are ready to calculate friction/traction but first we count how many points of the track are in contact with the ground by checking status of suspension component.
  • At this point we know how many points (and where) are in contact with the ground and what kind of normal force is produced there as a result of suspension. From this and velocity of the track friction force is calculated. Calculation of friction force takes into account friction coefficient so tracks can skid. Part of the produced force pushes tank forward and opposing force pushes tracks in reverse.

Rendering/animation loop is separated but based on the results of the simulation loop. The only code heavy part there is animation of the track. Which is based on moving control points of the spline component and then placing instanced static meshes of links along this spline. Extra math is done to make sure that links are synchronized with sprockets.

Not so obvious part is how everything talks to each other. There are a lot of assumptions done of how parameters to functions are passed and when it is done. Unfortunately I haven’t seen a better way on how to keep it modular. It makes it more difficult to use, but one can assemble a different type of vehicle rather easy this way - 4 Wheeled Vehicle example is made mostly from the same components as tank.

Feel free to post here any questions you have. There is a lot of information about system in this thread, but some of it is not too easy to find.

Thanks for the reply man! Need more time to digest this and to try to understand all of the process. Because sometimes in BP, i get lost on what does what. I’ll get back here whenever i have a question that i couldn’t figure out from your work. Thanks a lot man.

This plugin looks fantastic, going to try it out tonight

Thank you! I hope you enjoy it :slight_smile:

Hello,

I think this is more of a confirmation request rather than a questions. So what i got from looking at your work so far is this:

  • We started off by set the throttle. The input throttle value is the value of the scale mapping when we set up the input binding in project settings.
  • Then we basically says in the update throttle function that the input throttle = engine throttle and clamp the value. ( This is the part where i’m not quite sure of, actually).
  • After that, we update the engine torque by getting the engine torque curve float value and multiply the value with the engine throttle, then we get the engine torque.

And while i’m at this, i’m not quite sure about the two float value in the main event graph after you get the engine torque (13.335 and 15). What are these two float value?

My tank setup is different than yours. And i’m trying to better understand your work because its more realistic and for studying purpose. Thanks in advance.

Practically it’s a bit simpler. You don’t need engine curve if you are not keeping track or RPMs, without RPMs it’s just a some scalar value multiplied by throttle position (0…1).
So if your engine can produce 800N torque then:
EngineOutputTorque = 800 * Throttle
Clamp of value could be there just because of how controls are handled, don’t remember exactly. It’s not really important - throttle is a 0…1 value by conversion but practically it can be anything you want.

That was my futile attempt to use semi realistic engine characteristics of T-26 tank. Value of 13.335 is suppose to represent final drive gear as engines are rarely connected directly to tracks or wheels. But power output was till not enough and this is why 15 is there. Later I’ve found out that when you convert from meters to centimeters in UE4, for torque you use factor of 10000. So my math there was wrong all the way. Correct Engine output should be something like this:
EngineOutputTorque = 800 * Throttle * 10000
where 800 is a characteristic of real engine in metric system.

The reason why I didn’t add 10000 after finding this bug is because the rest of the tank is already tuned. Ideally, I would get some realistic characteristics of the T-26 engine first (which I wasn’t able to find) and tune the rest from there, like moment of inertia of tracks, mechanical friction and etc.