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.
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
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?
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?
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.
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.
Looking at the Tooner’s implementation:https://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.
At first I had it set up by doing a LookAt rotation towards a socket on the lower arm, rotating it in world space. However your answer gave me the idea to do it with trignometrics and a local rotation as seen here:
Unfortunatly the result is the same lag as in the gif I already posted. The upper arm is a static mesh, but in what way does it matter if it is a skeletal mesh and wether the rotation happens in word space or local space?
I’m not quite the expert in mechanical engineering but I’ll do some research in how differentials actually work and how it could be implemented, thanks for the heads up. As for driving with the sprocket, thats a great idea and makes things a bit simpler for me.
It might be issue with synchronization. Try using one of the MMT functions to get transform of the lower arm. “MMT Get Transform -Comp” reads transform directly from the rigid body and should get proper coordinates even if “rendering” objects are not synced yet, it has option to use Socket too.
With Skeletal meshes it’s weird when they are updated, they seam to be lagging by one frame behind the “root” body, as if they are synced at a different time, then the rest of the components. I had this problem with the Hovercraft air cushion skirt. When you move them in local space, you immediately see changes as “lagging” transform of the parent doesn’t effect then anymore.
You should be able to drive it with closed differential, it would be kind of like when on 4WD jeeps it’s switched to “maximum grip” mode, when you want to go over mud or some boulders. But usually you drive very slow.
If you start skidding too easily during turns, as wheels can’t spin with proper velocity, just set higher coefficients of friction for Y axis. This won’t be realistic but at least something.
Yes, it’s possible. What is missing is “proper” tyre physics simulation. Anisotropic friction component can be used for a sort of approximation of how tire works but for a racing game with real cars it might be too crude. It should work just fine for something like Mad cars.
Thats great, but Ive tried to make a new blueprint that implamant MMTPawn class, Ive set up cube and added 4 cylinders as wheels, but my pawn wan`t move, may I ask about a little help? How to setup a simple car?
I could make a simple example of the car. Overall, you need 4 track processors - one per each wheel. 4 collision meshes for wheels with some sort of suspension, like linear drive of physics constraint. 4 anisotropic friction components to get some sort of tire simulation.
I’m on vacation right now with Internet access only on the phone. So providing a more detailed tutorial is rather difficult
Hi, thanks for your hard work!
Are there any plans to develop a jet engine type? Or something similar to the ion, plasma?
Maybe you can convert your engine, which he based on traction, friction, air resistance, gave acceleration?
Almost for the aircraft
My technique is different from the aircraft so that it does not fly, and hovering above the ground, as the hovercraft, respectively it has no friction.
As planned, he soars with the help of anti-gravity, and pushes its ion engine.
Sorry for my english)
I haven’t looked into it but there are posts here where people did made it run over the multiplayer. Position replication should work, anything more complicated would require extra work.
A quick question, if you please: using this plugin I would be able to simulate an backhoe, with the arms movement, physics and etc? I was reading about your plugin, but could not find my answear.
Thank you.